Forum Stats

  • 3,770,743 Users
  • 2,253,162 Discussions
  • 7,875,573 Comments

Discussions

MySQL open-source code for error code 1677

user6108784
user6108784 Member Posts: 1 Green Ribbon

I am getting error from MySQL5.7 on target replica node when data is being inserted on it's table. This environment is setup for row-based replication. The error message is after altering schema to just increase column length from varchar(4) to varchar(10) which was only done on source DB's table and not the target DB. Further I looked at the MySQL open-source code available for all as per git link https://github.com/mysql/mysql-server/blob/5.7/sql/sql_insert.cc. But I am not able to find which exact piece of code is responsible of this functionality that will throw below error message: -

 [ERROR] XXXXX SQL: Column 1 of table 'xxxxx.aaa' cannot be converted from type 'varchar(40(bytes))' to type 'varchar(16(bytes) utf8mb4)', Error_code: 1677

 

Please let me know which piece of code is responsible for this functionality and error message?

 Appreciate any pointers.

Thanks 

Answers

  • Dave Stokes-MySQL Community Team-Oracle
    Dave Stokes-MySQL Community Team-Oracle MySQL Community Manager TexasMember Posts: 366 Employee

    Can you look for the code running the ALTER TABLE?

    Dave Stokes

    MySQL Community Manager

  • dvohra21
    dvohra21 Member Posts: 14,258 Gold Crown

    The reason for error message is clear:

    The error message is after altering schema to just increase column length from varchar(4) to varchar(10) which was only done on source DB's table and not the target DB.

  • User_8QWWQ
    User_8QWWQ Member Posts: 6 Green Ribbon

    I think piece of code is not for this functionlity.

    I think code is flow:

    include/mysqld_ername.h:680

    msg format difine:

    "ER_SLAVE_CONVERSION_FAILED", 1677, "Column %d of table \'%-.192s.%-.192s\' cannot be converted from type \'%-.32s\' to type \'%-.32s\'" 


    sql/rpl_utility.cc:696

    table_def::compatible_with is for this functionlity,this code piece : 

     if (report_level != INFORMATION_LEVEL)

      696     rli->report(report_level, ER_SLAVE_CONVERSION_FAILED,

      697           ER(ER_SLAVE_CONVERSION_FAILED),

      698           col, db_name, tbl_name,

      699           source_type.c_ptr_safe(), target_type.c_ptr_safe());

      700    return false;