Commit 17a7debb authored by Michael Widenius's avatar Michael Widenius

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)


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
parent d8e44ef5
...@@ -319,3 +319,17 @@ SHOW ERRORS; ...@@ -319,3 +319,17 @@ SHOW ERRORS;
Level Code Message Level Code Message
Error 1051 Unknown table 't1' Error 1051 Unknown table 't1'
End of 5.0 tests 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
...@@ -194,7 +194,6 @@ DROP PROCEDURE sp1; ...@@ -194,7 +194,6 @@ DROP PROCEDURE sp1;
DROP PROCEDURE sp2; DROP PROCEDURE sp2;
DROP PROCEDURE sp3; DROP PROCEDURE sp3;
# #
# Bug#30059: End-space truncation warnings are inconsistent or incorrect # Bug#30059: End-space truncation warnings are inconsistent or incorrect
# #
...@@ -235,3 +234,15 @@ DROP TABLE t1; ...@@ -235,3 +234,15 @@ DROP TABLE t1;
SHOW ERRORS; SHOW ERRORS;
--echo End of 5.0 tests --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
...@@ -38,7 +38,7 @@ int decimal_operation_results(int result) ...@@ -38,7 +38,7 @@ int decimal_operation_results(int result)
case E_DEC_TRUNCATED: case E_DEC_TRUNCATED:
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
WARN_DATA_TRUNCATED, ER(WARN_DATA_TRUNCATED), WARN_DATA_TRUNCATED, ER(WARN_DATA_TRUNCATED),
"", (long)-1); "", (ulong) 0);
break; break;
case E_DEC_OVERFLOW: case E_DEC_OVERFLOW:
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
...@@ -54,7 +54,7 @@ int decimal_operation_results(int result) ...@@ -54,7 +54,7 @@ int decimal_operation_results(int result)
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD), ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
"decimal", "", "", (long)-1); "decimal", "", "", (ulong) 0);
break; break;
case E_DEC_OOM: case E_DEC_OOM:
my_error(ER_OUT_OF_RESOURCES, MYF(0)); my_error(ER_OUT_OF_RESOURCES, MYF(0));
......
...@@ -3173,22 +3173,22 @@ ER_CANT_CREATE_THREAD ...@@ -3173,22 +3173,22 @@ ER_CANT_CREATE_THREAD
swe "Kan inte skapa en ny trd (errno %d)" swe "Kan inte skapa en ny trd (errno %d)"
ukr " Ǧ ( %d). ', æ ϧ - " ukr " Ǧ ( %d). ', æ ϧ - "
ER_WRONG_VALUE_COUNT_ON_ROW 21S01 ER_WRONG_VALUE_COUNT_ON_ROW 21S01
cze "Po-Bet sloupc neodpovd potu hodnot na dku %ld" cze "Po-Bet sloupc neodpovd potu hodnot na dku %lu"
dan "Kolonne antallet stemmer ikke overens med antallet af vrdier i post %ld" dan "Kolonne antallet stemmer ikke overens med antallet af vrdier i post %lu"
nla "Kolom aantal komt niet overeen met waarde aantal in rij %ld" nla "Kolom aantal komt niet overeen met waarde aantal in rij %lu"
eng "Column count doesn't match value count at row %ld" eng "Column count doesn't match value count at row %lu"
est "Tulpade hulk erineb vrtuste hulgast real %ld" est "Tulpade hulk erineb vrtuste hulgast real %lu"
ger "Anzahl der Felder stimmt nicht mit der Anzahl der Werte in Zeile %ld berein" ger "Anzahl der Felder stimmt nicht mit der Anzahl der Werte in Zeile %lu berein"
hun "Az oszlopban talalhato ertek nem egyezik meg a %ld sorban szamitott ertekkel" hun "Az oszlopban talalhato ertek nem egyezik meg a %lu sorban szamitott ertekkel"
ita "Il numero delle colonne non corrisponde al conteggio alla riga %ld" ita "Il numero delle colonne non corrisponde al conteggio alla riga %lu"
kor "Row %ld Į īƮ value īͿ ġ ʽϴ." kor "Row %lu Į īƮ value īͿ ġ ʽϴ."
por "Contagem de colunas no confere com a contagem de valores na linha %ld" por "Contagem de colunas no confere com a contagem de valores na linha %lu"
rum "Numarul de coloane nu corespunde cu numarul de valori la linia %ld" rum "Numarul de coloane nu corespunde cu numarul de valori la linia %lu"
rus " %ld" rus " %lu"
serbian "Broj kolona ne odgovara broju vrednosti u slogu %ld" serbian "Broj kolona ne odgovara broju vrednosti u slogu %lu"
spa "El nmero de columnas no corresponde al nmero en la lnea %ld" spa "El nmero de columnas no corresponde al nmero en la lnea %lu"
swe "Antalet kolumner motsvarar inte antalet vrden p rad: %ld" swe "Antalet kolumner motsvarar inte antalet vrden p rad: %lu"
ukr "˦ æ Ц ˦˦ æ %ld" ukr "˦ æ Ц ˦˦ æ %lu"
ER_CANT_REOPEN_TABLE ER_CANT_REOPEN_TABLE
cze "Nemohu znovuotev-Bt tabulku: '%-.192s" cze "Nemohu znovuotev-Bt tabulku: '%-.192s"
dan "Kan ikke genbne tabel '%-.192s" dan "Kan ikke genbne tabel '%-.192s"
...@@ -4887,29 +4887,29 @@ ER_CUT_VALUE_GROUP_CONCAT ...@@ -4887,29 +4887,29 @@ ER_CUT_VALUE_GROUP_CONCAT
swe "%d rad(er) kapades av group_concat()" swe "%d rad(er) kapades av group_concat()"
ukr "%d line(s) was(were) cut by group_concat()" ukr "%d line(s) was(were) cut by group_concat()"
ER_WARN_TOO_FEW_RECORDS 01000 ER_WARN_TOO_FEW_RECORDS 01000
eng "Row %ld doesn't contain data for all columns" eng "Row %lu doesn't contain data for all columns"
ger "Zeile %ld enthlt nicht fr alle Felder Daten" ger "Zeile %lu enthlt nicht fr alle Felder Daten"
nla "Rij %ld bevat niet de data voor alle kolommen" nla "Rij %lu bevat niet de data voor alle kolommen"
por "Conta de registro menor que a conta de coluna na linha %ld" por "Conta de registro menor que a conta de coluna na linha %lu"
spa "Lnea %ld no contiene datos para todas las columnas" spa "Lnea %lu no contiene datos para todas las columnas"
ER_WARN_TOO_MANY_RECORDS 01000 ER_WARN_TOO_MANY_RECORDS 01000
eng "Row %ld was truncated; it contained more data than there were input columns" eng "Row %lu was truncated; it contained more data than there were input columns"
ger "Zeile %ld gekrzt, die Zeile enthielt mehr Daten, als es Eingabefelder gibt" ger "Zeile %lu gekrzt, die Zeile enthielt mehr Daten, als es Eingabefelder gibt"
nla "Regel %ld ingekort, bevatte meer data dan invoer kolommen" nla "Regel %lu ingekort, bevatte meer data dan invoer kolommen"
por "Conta de registro maior que a conta de coluna na linha %ld" por "Conta de registro maior que a conta de coluna na linha %lu"
spa "Lnea %ld fu truncada; La misma contine mas datos que las que existen en las columnas de entrada" spa "Lnea %lu fu truncada; La misma contine mas datos que las que existen en las columnas de entrada"
ER_WARN_NULL_TO_NOTNULL 22004 ER_WARN_NULL_TO_NOTNULL 22004
eng "Column set to default value; NULL supplied to NOT NULL column '%s' at row %ld" eng "Column set to default value; NULL supplied to NOT NULL column '%s' at row %lu"
ger "Feld auf Vorgabewert gesetzt, da NULL fr NOT-NULL-Feld '%s' in Zeile %ld angegeben" ger "Feld auf Vorgabewert gesetzt, da NULL fr NOT-NULL-Feld '%s' in Zeile %lu angegeben"
por "Dado truncado, NULL fornecido para NOT NULL coluna '%s' na linha %ld" 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 lnea %ld" spa "Datos truncado, NULL suministrado para NOT NULL columna '%s' en la lnea %lu"
ER_WARN_DATA_OUT_OF_RANGE 22003 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 WARN_DATA_TRUNCATED 01000
eng "Data truncated for column '%s' at row %ld" eng "Data truncated for column '%s' at row %lu"
ger "Daten abgeschnitten fr Feld '%s' in Zeile %ld" ger "Daten abgeschnitten fr Feld '%s' in Zeile %lu"
por "Dado truncado para coluna '%s' na linha %ld" por "Dado truncado para coluna '%s' na linha %lu"
spa "Datos truncados para columna '%s' en la lnea %ld" spa "Datos truncados para columna '%s' en la lnea %lu"
ER_WARN_USING_OTHER_HANDLER ER_WARN_USING_OTHER_HANDLER
eng "Using storage engine %s for table '%s'" eng "Using storage engine %s for table '%s'"
ger "Fr Tabelle '%s' wird Speicher-Engine %s benutzt" ger "Fr Tabelle '%s' wird Speicher-Engine %s benutzt"
...@@ -5090,8 +5090,8 @@ ER_UNKNOWN_TIME_ZONE ...@@ -5090,8 +5090,8 @@ ER_UNKNOWN_TIME_ZONE
eng "Unknown or incorrect time zone: '%-.64s'" eng "Unknown or incorrect time zone: '%-.64s'"
ger "Unbekannte oder falsche Zeitzone: '%-.64s'" ger "Unbekannte oder falsche Zeitzone: '%-.64s'"
ER_WARN_INVALID_TIMESTAMP ER_WARN_INVALID_TIMESTAMP
eng "Invalid TIMESTAMP value in column '%s' at row %ld" eng "Invalid TIMESTAMP value in column '%s' at row %lu"
ger "Ungltiger TIMESTAMP-Wert in Feld '%s', Zeile %ld" ger "Ungltiger TIMESTAMP-Wert in Feld '%s', Zeile %lu"
ER_INVALID_CHARACTER_STRING ER_INVALID_CHARACTER_STRING
eng "Invalid %s character string: '%.64s'" eng "Invalid %s character string: '%.64s'"
ger "Ungltiger %s-Zeichen-String: '%.64s'" ger "Ungltiger %s-Zeichen-String: '%.64s'"
...@@ -5456,8 +5456,8 @@ ER_PROC_AUTO_REVOKE_FAIL ...@@ -5456,8 +5456,8 @@ ER_PROC_AUTO_REVOKE_FAIL
eng "Failed to revoke all privileges to dropped routine" eng "Failed to revoke all privileges to dropped routine"
ger "Rcknahme aller Rechte fr die gelschte Routine fehlgeschlagen" ger "Rcknahme aller Rechte fr die gelschte Routine fehlgeschlagen"
ER_DATA_TOO_LONG 22001 ER_DATA_TOO_LONG 22001
eng "Data too long for column '%s' at row %ld" eng "Data too long for column '%s' at row %lu"
ger "Daten zu lang fr Feld '%s' in Zeile %ld" ger "Daten zu lang fr Feld '%s' in Zeile %lu"
ER_SP_BAD_SQLSTATE 42000 ER_SP_BAD_SQLSTATE 42000
eng "Bad SQLSTATE: '%s'" eng "Bad SQLSTATE: '%s'"
ger "Ungltiger SQLSTATE: '%s'" ger "Ungltiger SQLSTATE: '%s'"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment