← Back to team overview

maria-developers team mailing list archive

bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (monty:2779)

 

#At lp:maria based on revid:monty@xxxxxxxxxxxx-20091204151222-xq8zhmvtas511f91

 2779 Michael Widenius	2009-12-06
      Changed -1 row number in some warnings to 0
      (-1 doesn't make sence as a row number and when doing insert / load data, first row is 1, so 0 is free to use)
      modified:
        mysql-test/r/warnings.result
        mysql-test/suite/funcs_1/r/innodb_func_view.result
        mysql-test/suite/funcs_1/r/memory_func_view.result
        mysql-test/suite/funcs_1/r/myisam_func_view.result
        mysql-test/t/warnings.test
        sql/my_decimal.cc
        sql/share/errmsg.txt

per-file messages:
  mysql-test/r/warnings.result
    Added test for warnings with row number
  mysql-test/suite/funcs_1/r/innodb_func_view.result
    Updated test results
  mysql-test/suite/funcs_1/r/memory_func_view.result
    Updated test results
  mysql-test/suite/funcs_1/r/myisam_func_view.result
    Updated test results
  mysql-test/t/warnings.test
    Added test for warnings with row numberAdded test for warnings with row number
  sql/my_decimal.cc
    Don't use -1 as row number
  sql/share/errmsg.txt
    Make row numbers unsigned
=== modified file 'mysql-test/r/warnings.result'
--- a/mysql-test/r/warnings.result	2009-09-10 08:49:49 +0000
+++ b/mysql-test/r/warnings.result	2009-12-06 17:26:12 +0000
@@ -319,3 +319,17 @@ SHOW ERRORS;
 Level	Code	Message
 Error	1051	Unknown table 't1'
 End of 5.0 tests
+set sql_mode = default;
+select CAST(a AS DECIMAL(13,5)) FROM (SELECT '' as a) t;
+CAST(a AS DECIMAL(13,5))
+0.00000
+Warnings:
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Warning	1292	Truncated incorrect DECIMAL value: ''
+create table t1 (a integer unsigned);
+insert into t1 values (1),(-1),(0),(-2);
+Warnings:
+Warning	1264	Out of range value for column 'a' at row 2
+Warning	1264	Out of range value for column 'a' at row 4
+drop table t1;
+End of 5.1 tests

=== modified file 'mysql-test/suite/funcs_1/r/innodb_func_view.result'
--- a/mysql-test/suite/funcs_1/r/innodb_func_view.result	2009-05-15 12:57:51 +0000
+++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result	2009-12-06 17:26:12 +0000
@@ -3372,9 +3372,9 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	29
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
 v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`	latin1	latin1_swedish_ci
@@ -3389,9 +3389,9 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	29
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 DROP VIEW v1;
 
 
@@ -3408,11 +3408,11 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	28
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ' ---����@�*$-- '
 Warning	1292	Truncated incorrect DECIMAL value: '-1'
 Warning	1292	Truncated incorrect DECIMAL value: '-3333.3333'
@@ -3430,11 +3430,11 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	28
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ' ---����@�*$-- '
 Warning	1292	Truncated incorrect DECIMAL value: '-1'
 Warning	1292	Truncated incorrect DECIMAL value: '-3333.3333'
@@ -3454,9 +3454,9 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	27
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
 v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`	latin1	latin1_swedish_ci
@@ -3471,9 +3471,9 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	27
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 DROP VIEW v1;
 
 
@@ -3490,11 +3490,11 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	26
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '                              '
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ' ---����@�*$--           '
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
@@ -3510,11 +3510,11 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	26
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '                              '
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ' ---����@�*$--           '
 DROP VIEW v1;
 

=== modified file 'mysql-test/suite/funcs_1/r/memory_func_view.result'
--- a/mysql-test/suite/funcs_1/r/memory_func_view.result	2009-02-14 16:00:11 +0000
+++ b/mysql-test/suite/funcs_1/r/memory_func_view.result	2009-12-06 17:26:12 +0000
@@ -3373,9 +3373,9 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	29
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
 v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`	latin1	latin1_swedish_ci
@@ -3390,9 +3390,9 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	29
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 DROP VIEW v1;
 
 
@@ -3409,11 +3409,11 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	28
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ' ---����@�*$-- '
 Warning	1292	Truncated incorrect DECIMAL value: '-1'
 Warning	1292	Truncated incorrect DECIMAL value: '-3333.3333'
@@ -3431,11 +3431,11 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	28
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ' ---����@�*$-- '
 Warning	1292	Truncated incorrect DECIMAL value: '-1'
 Warning	1292	Truncated incorrect DECIMAL value: '-3333.3333'
@@ -3455,9 +3455,9 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	27
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
 v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`	latin1	latin1_swedish_ci
@@ -3472,9 +3472,9 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	27
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 DROP VIEW v1;
 
 
@@ -3491,11 +3491,11 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	26
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '                              '
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ' ---����@�*$--           '
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
@@ -3511,11 +3511,11 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	26
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '                              '
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ' ---����@�*$--           '
 DROP VIEW v1;
 

=== modified file 'mysql-test/suite/funcs_1/r/myisam_func_view.result'
--- a/mysql-test/suite/funcs_1/r/myisam_func_view.result	2009-02-14 16:00:11 +0000
+++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result	2009-12-06 17:26:12 +0000
@@ -3373,9 +3373,9 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	29
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
 v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values`	latin1	latin1_swedish_ci
@@ -3390,9 +3390,9 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	29
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 DROP VIEW v1;
 
 
@@ -3409,11 +3409,11 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	28
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ' ---����@�*$-- '
 Warning	1292	Truncated incorrect DECIMAL value: '-1'
 Warning	1292	Truncated incorrect DECIMAL value: '-3333.3333'
@@ -3431,11 +3431,11 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	28
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ' ---����@�*$-- '
 Warning	1292	Truncated incorrect DECIMAL value: '-1'
 Warning	1292	Truncated incorrect DECIMAL value: '-3333.3333'
@@ -3455,9 +3455,9 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	27
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
 v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values`	latin1	latin1_swedish_ci
@@ -3472,9 +3472,9 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	27
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 DROP VIEW v1;
 
 
@@ -3491,11 +3491,11 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	26
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '                              '
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ' ---����@�*$--           '
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
@@ -3511,11 +3511,11 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	26
 Warnings:
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '                              '
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Error	1366	Incorrect decimal value: '' for column '' at row -1
+Error	1366	Incorrect decimal value: '' for column '' at row 0
 Warning	1292	Truncated incorrect DECIMAL value: ' ---����@�*$--           '
 DROP VIEW v1;
 

=== modified file 'mysql-test/t/warnings.test'
--- a/mysql-test/t/warnings.test	2009-12-03 11:19:05 +0000
+++ b/mysql-test/t/warnings.test	2009-12-06 17:26:12 +0000
@@ -194,7 +194,6 @@ DROP PROCEDURE sp1;
 DROP PROCEDURE sp2;
 DROP PROCEDURE sp3;
 
-
 #
 # Bug#30059: End-space truncation warnings are inconsistent or incorrect
 #
@@ -235,3 +234,15 @@ DROP TABLE t1;
 SHOW ERRORS;
 
 --echo End of 5.0 tests
+
+#
+# Test warning with row numbers
+#
+
+set sql_mode = default;
+select CAST(a AS DECIMAL(13,5)) FROM (SELECT '' as a) t;
+create table t1 (a integer unsigned);
+insert into t1 values (1),(-1),(0),(-2);
+drop table t1;
+
+--echo End of 5.1 tests

=== modified file 'sql/my_decimal.cc'
--- a/sql/my_decimal.cc	2008-11-27 11:33:04 +0000
+++ b/sql/my_decimal.cc	2009-12-06 17:26:12 +0000
@@ -38,7 +38,7 @@ int decimal_operation_results(int result
   case E_DEC_TRUNCATED:
     push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 			WARN_DATA_TRUNCATED, ER(WARN_DATA_TRUNCATED),
-			"", (long)-1);
+			"", (ulong) 0);
     break;
   case E_DEC_OVERFLOW:
     push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
@@ -54,7 +54,7 @@ int decimal_operation_results(int result
     push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
 			ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
 			ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
-			"decimal", "", "", (long)-1);
+			"decimal", "", "", (ulong) 0);
     break;
   case E_DEC_OOM:
     my_error(ER_OUT_OF_RESOURCES, MYF(0));

=== modified file 'sql/share/errmsg.txt'
--- a/sql/share/errmsg.txt	2009-12-04 15:12:22 +0000
+++ b/sql/share/errmsg.txt	2009-12-06 17:26:12 +0000
@@ -3173,22 +3173,22 @@ ER_CANT_CREATE_THREAD  
         swe "Kan inte skapa en ny tr�d (errno %d)"
         ukr "�� ���� �������� ���� ����� (������� %d). ���� �� �� ����������� ��� ���'���, �� ���������� ������������ �� ����� �� - ������� �� ������� ��"
 ER_WRONG_VALUE_COUNT_ON_ROW 21S01 
-        cze "Po-B�et sloupc� neodpov�d� po�tu hodnot na ��dku %ld"
-        dan "Kolonne antallet stemmer ikke overens med antallet af v�rdier i post %ld"
-        nla "Kolom aantal komt niet overeen met waarde aantal in rij %ld"
-        eng "Column count doesn't match value count at row %ld"
-        est "Tulpade hulk erineb v��rtuste hulgast real %ld"
-        ger "Anzahl der Felder stimmt nicht mit der Anzahl der Werte in Zeile %ld �berein"
-        hun "Az oszlopban talalhato ertek nem egyezik meg a %ld sorban szamitott ertekkel"
-        ita "Il numero delle colonne non corrisponde al conteggio alla riga %ld"
-        kor "Row %ld���� ���� �������� value �������� �������� ��������."
-        por "Contagem de colunas n�o confere com a contagem de valores na linha %ld"
-        rum "Numarul de coloane nu corespunde cu numarul de valori la linia %ld"
-        rus "���������� �������� �� ��������� � ����������� �������� � ������ %ld"
-        serbian "Broj kolona ne odgovara broju vrednosti u slogu %ld"
-        spa "El n�mero de columnas no corresponde al n�mero en la l�nea %ld"
-        swe "Antalet kolumner motsvarar inte antalet v�rden p� rad: %ld"
-        ukr "��������� �������� �� ��������� � ��������� ������� � ������ %ld"
+        cze "Po-B�et sloupc� neodpov�d� po�tu hodnot na ��dku %lu"
+        dan "Kolonne antallet stemmer ikke overens med antallet af v�rdier i post %lu"
+        nla "Kolom aantal komt niet overeen met waarde aantal in rij %lu"
+        eng "Column count doesn't match value count at row %lu"
+        est "Tulpade hulk erineb v��rtuste hulgast real %lu"
+        ger "Anzahl der Felder stimmt nicht mit der Anzahl der Werte in Zeile %lu �berein"
+        hun "Az oszlopban talalhato ertek nem egyezik meg a %lu sorban szamitott ertekkel"
+        ita "Il numero delle colonne non corrisponde al conteggio alla riga %lu"
+        kor "Row %lu���� ���� �������� value �������� �������� ��������."
+        por "Contagem de colunas n�o confere com a contagem de valores na linha %lu"
+        rum "Numarul de coloane nu corespunde cu numarul de valori la linia %lu"
+        rus "���������� �������� �� ��������� � ����������� �������� � ������ %lu"
+        serbian "Broj kolona ne odgovara broju vrednosti u slogu %lu"
+        spa "El n�mero de columnas no corresponde al n�mero en la l�nea %lu"
+        swe "Antalet kolumner motsvarar inte antalet v�rden p� rad: %lu"
+        ukr "��������� �������� �� ��������� � ��������� ������� � ������ %lu"
 ER_CANT_REOPEN_TABLE  
         cze "Nemohu znovuotev-B��t tabulku: '%-.192s"
         dan "Kan ikke gen�bne tabel '%-.192s"
@@ -4887,29 +4887,29 @@ ER_CUT_VALUE_GROUP_CONCAT  
         swe "%d rad(er) kapades av group_concat()"
         ukr "%d line(s) was(were) cut by group_concat()"
 ER_WARN_TOO_FEW_RECORDS 01000 
-        eng "Row %ld doesn't contain data for all columns"
-        ger "Zeile %ld enth�lt nicht f�r alle Felder Daten"
-        nla "Rij %ld bevat niet de data voor alle kolommen"
-        por "Conta de registro � menor que a conta de coluna na linha %ld"
-        spa "L�nea %ld no contiene datos para todas las columnas"
+        eng "Row %lu doesn't contain data for all columns"
+        ger "Zeile %lu enth�lt nicht f�r alle Felder Daten"
+        nla "Rij %lu bevat niet de data voor alle kolommen"
+        por "Conta de registro � menor que a conta de coluna na linha %lu"
+        spa "L�nea %lu no contiene datos para todas las columnas"
 ER_WARN_TOO_MANY_RECORDS 01000 
-        eng "Row %ld was truncated; it contained more data than there were input columns"
-        ger "Zeile %ld gek�rzt, die Zeile enthielt mehr Daten, als es Eingabefelder gibt"
-        nla "Regel %ld ingekort, bevatte meer data dan invoer kolommen"
-        por "Conta de registro � maior que a conta de coluna na linha %ld"
-        spa "L�nea %ld fu� truncada; La misma contine mas datos que las que existen en las columnas de entrada"
+        eng "Row %lu was truncated; it contained more data than there were input columns"
+        ger "Zeile %lu gek�rzt, die Zeile enthielt mehr Daten, als es Eingabefelder gibt"
+        nla "Regel %lu ingekort, bevatte meer data dan invoer kolommen"
+        por "Conta de registro � maior que a conta de coluna na linha %lu"
+        spa "L�nea %lu fu� truncada; La misma contine mas datos que las que existen en las columnas de entrada"
 ER_WARN_NULL_TO_NOTNULL 22004 
-        eng "Column set to default value; NULL supplied to NOT NULL column '%s' at row %ld"
-        ger "Feld auf Vorgabewert gesetzt, da NULL f�r NOT-NULL-Feld '%s' in Zeile %ld angegeben"
-        por "Dado truncado, NULL fornecido para NOT NULL coluna '%s' na linha %ld"
-        spa "Datos truncado, NULL suministrado para NOT NULL columna '%s' en la l�nea %ld"
+        eng "Column set to default value; NULL supplied to NOT NULL column '%s' at row %lu"
+        ger "Feld auf Vorgabewert gesetzt, da NULL f�r NOT-NULL-Feld '%s' in Zeile %lu angegeben"
+        por "Dado truncado, NULL fornecido para NOT NULL coluna '%s' na linha %lu"
+        spa "Datos truncado, NULL suministrado para NOT NULL columna '%s' en la l�nea %lu"
 ER_WARN_DATA_OUT_OF_RANGE 22003 
-        eng "Out of range value for column '%s' at row %ld"
+        eng "Out of range value for column '%s' at row %lu"
 WARN_DATA_TRUNCATED 01000 
-        eng "Data truncated for column '%s' at row %ld"
-        ger "Daten abgeschnitten f�r Feld '%s' in Zeile %ld"
-        por "Dado truncado para coluna '%s' na linha %ld"
-        spa "Datos truncados para columna '%s' en la l�nea %ld"
+        eng "Data truncated for column '%s' at row %lu"
+        ger "Daten abgeschnitten f�r Feld '%s' in Zeile %lu"
+        por "Dado truncado para coluna '%s' na linha %lu"
+        spa "Datos truncados para columna '%s' en la l�nea %lu"
 ER_WARN_USING_OTHER_HANDLER  
         eng "Using storage engine %s for table '%s'"
         ger "F�r Tabelle '%s' wird Speicher-Engine %s benutzt"
@@ -5090,8 +5090,8 @@ ER_UNKNOWN_TIME_ZONE  
         eng "Unknown or incorrect time zone: '%-.64s'"
         ger "Unbekannte oder falsche Zeitzone: '%-.64s'"
 ER_WARN_INVALID_TIMESTAMP  
-        eng "Invalid TIMESTAMP value in column '%s' at row %ld"
-        ger "Ung�ltiger TIMESTAMP-Wert in Feld '%s', Zeile %ld"
+        eng "Invalid TIMESTAMP value in column '%s' at row %lu"
+        ger "Ung�ltiger TIMESTAMP-Wert in Feld '%s', Zeile %lu"
 ER_INVALID_CHARACTER_STRING  
         eng "Invalid %s character string: '%.64s'"
         ger "Ung�ltiger %s-Zeichen-String: '%.64s'"
@@ -5456,8 +5456,8 @@ ER_PROC_AUTO_REVOKE_FAIL
         eng "Failed to revoke all privileges to dropped routine"
         ger "R�cknahme aller Rechte f�r die gel�schte Routine fehlgeschlagen"
 ER_DATA_TOO_LONG 22001
-        eng "Data too long for column '%s' at row %ld"
-        ger "Daten zu lang f�r Feld '%s' in Zeile %ld"
+        eng "Data too long for column '%s' at row %lu"
+        ger "Daten zu lang f�r Feld '%s' in Zeile %lu"
 ER_SP_BAD_SQLSTATE 42000
         eng "Bad SQLSTATE: '%s'"
         ger "Ung�ltiger SQLSTATE: '%s'"