Skip to content

Commit 92b3659

Browse files
author
Alexander Barkov
committed
MDEV-7268 Column of table cannot be converted from type 'decimal(0,?)' to type ' 'decimal(10,7)'
Changing the error message to: "...from type 'decimal(0,?)/*old*/' to type ' 'decimal(10,7)'..." So it's now clear that the master data type is OLD decimal.
1 parent b1e1039 commit 92b3659

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
include/master-slave.inc
2+
[connection master]
3+
CREATE TABLE t1dec102 (a DECIMAL(10,2));
4+
INSERT INTO t1dec102 VALUES(999.99);
5+
call mtr.add_suppression("Slave SQL.*Column 0 of table .* cannot be converted from type.* Error_code: 1677");
6+
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
7+
Last_SQL_Error = 'Column 0 of table 'test.t1dec102' cannot be converted from type 'decimal(0,?)/*old*/' to type 'decimal(10,2)''
8+
DROP TABLE t1dec102;
9+
include/rpl_end.inc
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--source include/have_binlog_format_row.inc
2+
--source include/master-slave.inc
3+
4+
5+
--connection slave
6+
CREATE TABLE t1dec102 (a DECIMAL(10,2));
7+
8+
--connection master
9+
let $MYSQLD_DATADIR= `select @@datadir`;
10+
11+
--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm
12+
--copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD
13+
--copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI
14+
INSERT INTO t1dec102 VALUES(999.99);
15+
16+
--let $slave_sql_errno=1677
17+
--let $show_slave_sql_error= 1
18+
call mtr.add_suppression("Slave SQL.*Column 0 of table .* cannot be converted from type.* Error_code: 1677");
19+
--source include/wait_for_slave_sql_error_and_skip.inc
20+
21+
--connection master
22+
DROP TABLE t1dec102;
23+
--sync_slave_with_master
24+
25+
--source include/rpl_end.inc

sql/rpl_utility.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ void show_sql_type(enum_field_types type, uint16 metadata, String *str, CHARSET_
417417
CHARSET_INFO *cs= str->charset();
418418
uint32 length=
419419
cs->cset->snprintf(cs, (char*) str->ptr(), str->alloced_length(),
420-
"decimal(%d,?)", metadata);
420+
"decimal(%d,?)/*old*/", metadata);
421421
str->length(length);
422422
}
423423
break;

0 commit comments

Comments
 (0)