Skip to content

Commit a398fcb

Browse files
committed
MDEV-26635 ROW_NUMBER is not 0 for errors not caused because of rows
1 parent f845a98 commit a398fcb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+383
-373
lines changed

mysql-test/main/default.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ ERROR 42000: Invalid default value for 'a'
799799
#
800800
CREATE TABLE t1 (a INT DEFAULT '1 ');
801801
Warnings:
802-
Note 1265 Data truncated for column 'a' at row 1
802+
Note 1265 Data truncated for column 'a' at row 0
803803
SHOW CREATE TABLE t1;
804804
Table Create Table
805805
t1 CREATE TABLE `t1` (
@@ -812,7 +812,7 @@ a
812812
DROP TABLE t1;
813813
CREATE TABLE t1 (a INT DEFAULT CONCAT('1 '));
814814
Warnings:
815-
Note 1265 Data truncated for column 'a' at row 1
815+
Note 1265 Data truncated for column 'a' at row 0
816816
SHOW CREATE TABLE t1;
817817
Table Create Table
818818
t1 CREATE TABLE `t1` (
@@ -827,7 +827,7 @@ a
827827
DROP TABLE t1;
828828
CREATE TABLE t1 (a INT DEFAULT COALESCE('1 '));
829829
Warnings:
830-
Note 1265 Data truncated for column 'a' at row 1
830+
Note 1265 Data truncated for column 'a' at row 0
831831
SHOW CREATE TABLE t1;
832832
Table Create Table
833833
t1 CREATE TABLE `t1` (

mysql-test/main/get_diagnostics.result

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ v
628628
NULL
629629
Warnings:
630630
Note 1050 Table 't1' already exists
631-
Error 1406 Data too long for column 'v' at row 1
631+
Error 1406 Data too long for column 'v' at row 0
632632
DROP TABLE t1;
633633
DROP PROCEDURE p1;
634634

@@ -1476,7 +1476,7 @@ ERROR 42000: Column 'id1' specified twice
14761476
GET DIAGNOSTICS CONDITION 1 @var118= ROW_NUMBER;
14771477
SELECT @var118;
14781478
@var118
1479-
1
1479+
0
14801480
CREATE FUNCTION f1() RETURNS INT
14811481
BEGIN
14821482
INSERT INTO t1 VALUES (1);
@@ -1487,38 +1487,38 @@ ERROR HY000: Can't update table 't1' in stored function/trigger because it is al
14871487
GET DIAGNOSTICS CONDITION 1 @var119= ROW_NUMBER;
14881488
SELECT @var119;
14891489
@var119
1490-
1
1490+
0
14911491
INSERT INTO t1 VALUES (1) RETURNING id2;
14921492
ERROR 42S22: Unknown column 'id2' in 'field list'
14931493
GET DIAGNOSTICS CONDITION 1 @var120= ROW_NUMBER;
14941494
SELECT @var120;
14951495
@var120
1496-
1
1496+
0
14971497
INSERT INTO t1(id2) VALUES(1);
14981498
ERROR 42S22: Unknown column 'id2' in 'field list'
14991499
GET DIAGNOSTICS CONDITION 1 @var121= ROW_NUMBER;
15001500
SELECT @var121;
15011501
@var121
1502-
1
1502+
0
15031503
INSERT INTO v VALUES(1,2);
15041504
ERROR HY000: Can not insert into join view 'test.v' without fields list
15051505
GET DIAGNOSTICS CONDITION 1 @var122= ROW_NUMBER;
15061506
SELECT @var122;
15071507
@var122
1508-
1
1508+
0
15091509
INSERT INTO v(a,b) VALUES (1,2);
15101510
ERROR HY000: Can not modify more than one base table through a join view 'test.v'
15111511
GET DIAGNOSTICS CONDITION 1 @var123= ROW_NUMBER;
15121512
SELECT @var123;
15131513
@var123
1514-
1
1514+
0
15151515
# REPLACE STATEMENT
15161516
REPLACE INTO t1(id1, id1) VALUES (1,1);
15171517
ERROR 42000: Column 'id1' specified twice
15181518
GET DIAGNOSTICS CONDITION 1 @var124= ROW_NUMBER;
15191519
SELECT @var124;
15201520
@var124
1521-
1
1521+
0
15221522
CREATE FUNCTION f2() RETURNS INT
15231523
BEGIN
15241524
REPLACE INTO t1 VALUES (1);
@@ -1529,31 +1529,31 @@ ERROR HY000: Can't update table 't1' in stored function/trigger because it is al
15291529
GET DIAGNOSTICS CONDITION 1 @var125= ROW_NUMBER;
15301530
SELECT @var125;
15311531
@var125
1532-
1
1532+
0
15331533
REPLACE INTO t1 VALUES (1) RETURNING id2;
15341534
ERROR 42S22: Unknown column 'id2' in 'field list'
15351535
GET DIAGNOSTICS CONDITION 1 @var126= ROW_NUMBER;
15361536
SELECT @var126;
15371537
@var126
1538-
1
1538+
0
15391539
REPLACE INTO t1(id2) VALUES(1);
15401540
ERROR 42S22: Unknown column 'id2' in 'field list'
15411541
GET DIAGNOSTICS CONDITION 1 @var127= ROW_NUMBER;
15421542
SELECT @var127;
15431543
@var127
1544-
1
1544+
0
15451545
REPLACE INTO v VALUES(1,2);
15461546
ERROR HY000: Can not insert into join view 'test.v' without fields list
15471547
GET DIAGNOSTICS CONDITION 1 @var128= ROW_NUMBER;
15481548
SELECT @var128;
15491549
@var128
1550-
1
1550+
0
15511551
REPLACE INTO v(a,b) VALUES (1,2);
15521552
ERROR HY000: Can not modify more than one base table through a join view 'test.v'
15531553
GET DIAGNOSTICS CONDITION 1 @var129= ROW_NUMBER;
15541554
SELECT @var129;
15551555
@var129
1556-
1
1556+
0
15571557
DROP TABLE t1,t2;
15581558
DROP FUNCTION f1;
15591559
DROP FUNCTION f2;
@@ -1598,7 +1598,7 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
15981598
GET DIAGNOSTICS CONDITION 1 @num = ROW_NUMBER, @msg = MESSAGE_TEXT;
15991599
SELECT @num, @msg;
16001600
@num @msg
1601-
2 Duplicate entry '1' for key 'PRIMARY'
1601+
1 Duplicate entry '1' for key 'PRIMARY'
16021602
DROP PROCEDURE sp;
16031603
DROP TABLE t1;
16041604
# Checking more errors

mysql-test/main/ps.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5241,21 +5241,21 @@ DECLARE a DATETIME;
52415241
CALL p1(a);
52425242
END;
52435243
$$
5244-
ERROR 22007: Incorrect datetime value: '10' for column ``.``.`a` at row 1
5244+
ERROR 22007: Incorrect datetime value: '10' for column ``.``.`a` at row 0
52455245
BEGIN NOT ATOMIC
52465246
DECLARE a DATETIME;
52475247
EXECUTE IMMEDIATE 'CALL p1(?)' USING a;
52485248
END;
52495249
$$
5250-
ERROR 22007: Incorrect datetime value: '10' for column ``.``.`a` at row 1
5250+
ERROR 22007: Incorrect datetime value: '10' for column ``.``.`a` at row 0
52515251
BEGIN NOT ATOMIC
52525252
DECLARE a DATETIME;
52535253
PREPARE stmt FROM 'CALL p1(?)';
52545254
EXECUTE stmt USING a;
52555255
DEALLOCATE PREPARE stmt;
52565256
END;
52575257
$$
5258-
ERROR 22007: Incorrect datetime value: '10' for column ``.``.`a` at row 1
5258+
ERROR 22007: Incorrect datetime value: '10' for column ``.``.`a` at row 0
52595259
DROP PROCEDURE p1;
52605260
#
52615261
# MDEV-14454 Binary protocol returns wrong collation ID for SP OUT parameters

mysql-test/main/signal_sqlmode.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ call p;
3232
length(utf8_var) utf8_var
3333
128 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
3434
Warnings:
35-
Warning 1265 Data truncated for column 'utf8_var' at row 1
35+
Warning 1265 Data truncated for column 'utf8_var' at row 0
3636
call p2;
3737
length(msg) msg
3838
129 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
@@ -71,7 +71,7 @@ table_name = name;
7171
end
7272
$$
7373
call p;
74-
ERROR 22001: Data too long for column 'utf8_var' at row 1
74+
ERROR 22001: Data too long for column 'utf8_var' at row 0
7575
call p2;
7676
length(msg) msg
7777
513 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX

mysql-test/main/sp-anchor-type.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ CALL p1();
6262
a b
6363
127 200
6464
Warnings:
65-
Warning 1264 Out of range value for column 'a' at row 1
65+
Warning 1264 Out of range value for column 'a' at row 0
6666
DROP PROCEDURE p1;
6767
DROP TABLE t1;
6868
SET sql_mode=DEFAULT;

mysql-test/main/sp-cursor.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@ CALL p1('1b');
167167
v_a
168168
1
169169
Warnings:
170-
Warning 1265 Data truncated for column 'p_a' at row 1
170+
Warning 1265 Data truncated for column 'p_a' at row 0
171171
CALL p1('b1');
172172
v_a
173173
0
174174
Warnings:
175-
Warning 1366 Incorrect integer value: 'b1' for column ``.``.`p_a` at row 1
175+
Warning 1366 Incorrect integer value: 'b1' for column ``.``.`p_a` at row 0
176176
DROP PROCEDURE p1;
177177
SET sql_mode=DEFAULT;
178178
#

mysql-test/main/sp-error.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2780,7 +2780,7 @@ END|
27802780

27812781
CALL p1()|
27822782
Warnings:
2783-
Warning 1366 Incorrect integer value: 'string' for column ``.``.`var1` at row 1
2783+
Warning 1366 Incorrect integer value: 'string' for column ``.``.`var1` at row 0
27842784

27852785
SET sql_mode = DEFAULT|
27862786
CREATE PROCEDURE p2()

mysql-test/main/sp-vars.result

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ v7 v8 v9 v10 v11 v12 v13 v14 v15 v16
110110
v17 v18 v19 v20
111111
12.00 12.12 12.00 12.12
112112
Warnings:
113-
Note 1265 Data truncated for column 'v20' at row 1
113+
Note 1265 Data truncated for column 'v20' at row 0
114114
CALL sp_vars_check_assignment();
115115
i1 i2 i3 i4
116116
127 -128 127 -128
@@ -130,22 +130,22 @@ SELECT sp_vars_check_ret1();
130130
sp_vars_check_ret1()
131131
127
132132
Warnings:
133-
Warning 1264 Out of range value for column 'sp_vars_check_ret1()' at row 1
133+
Warning 1264 Out of range value for column 'sp_vars_check_ret1()' at row 0
134134
SELECT sp_vars_check_ret2();
135135
sp_vars_check_ret2()
136136
127
137137
Warnings:
138-
Warning 1264 Out of range value for column 'sp_vars_check_ret2()' at row 1
138+
Warning 1264 Out of range value for column 'sp_vars_check_ret2()' at row 0
139139
SELECT sp_vars_check_ret3();
140140
sp_vars_check_ret3()
141141
0
142142
Warnings:
143-
Warning 1366 Incorrect integer value: 'Hello, world' for column ``.``.`sp_vars_check_ret3()` at row 1
143+
Warning 1366 Incorrect integer value: 'Hello, world' for column ``.``.`sp_vars_check_ret3()` at row 0
144144
SELECT sp_vars_check_ret4();
145145
sp_vars_check_ret4()
146146
154.12
147147
Warnings:
148-
Note 1265 Data truncated for column 'sp_vars_check_ret4()' at row 1
148+
Note 1265 Data truncated for column 'sp_vars_check_ret4()' at row 0
149149
SELECT sp_vars_div_zero();
150150
sp_vars_div_zero()
151151
NULL
@@ -165,7 +165,7 @@ v7 v8 v9 v10 v11 v12 v13 v14 v15 v16
165165
v17 v18 v19 v20
166166
12.00 12.12 12.00 12.12
167167
Warnings:
168-
Note 1265 Data truncated for column 'v20' at row 1
168+
Note 1265 Data truncated for column 'v20' at row 0
169169
CALL sp_vars_check_assignment();
170170
i1 i2 i3 i4
171171
127 -128 127 -128
@@ -185,22 +185,22 @@ SELECT sp_vars_check_ret1();
185185
sp_vars_check_ret1()
186186
127
187187
Warnings:
188-
Warning 1264 Out of range value for column 'sp_vars_check_ret1()' at row 1
188+
Warning 1264 Out of range value for column 'sp_vars_check_ret1()' at row 0
189189
SELECT sp_vars_check_ret2();
190190
sp_vars_check_ret2()
191191
127
192192
Warnings:
193-
Warning 1264 Out of range value for column 'sp_vars_check_ret2()' at row 1
193+
Warning 1264 Out of range value for column 'sp_vars_check_ret2()' at row 0
194194
SELECT sp_vars_check_ret3();
195195
sp_vars_check_ret3()
196196
0
197197
Warnings:
198-
Warning 1366 Incorrect integer value: 'Hello, world' for column ``.``.`sp_vars_check_ret3()` at row 1
198+
Warning 1366 Incorrect integer value: 'Hello, world' for column ``.``.`sp_vars_check_ret3()` at row 0
199199
SELECT sp_vars_check_ret4();
200200
sp_vars_check_ret4()
201201
154.12
202202
Warnings:
203-
Note 1265 Data truncated for column 'sp_vars_check_ret4()' at row 1
203+
Note 1265 Data truncated for column 'sp_vars_check_ret4()' at row 0
204204
SELECT sp_vars_div_zero();
205205
sp_vars_div_zero()
206206
NULL
@@ -306,20 +306,20 @@ Calling the routines, created in TRADITIONAL mode.
306306
---------------------------------------------------------------
307307

308308
CALL sp_vars_check_dflt();
309-
ERROR 22003: Out of range value for column 'v1' at row 1
309+
ERROR 22003: Out of range value for column 'v1' at row 0
310310
CALL sp_vars_check_assignment();
311-
ERROR 22003: Out of range value for column 'i1' at row 1
311+
ERROR 22003: Out of range value for column 'i1' at row 0
312312
SELECT sp_vars_check_ret1();
313-
ERROR 22003: Out of range value for column 'sp_vars_check_ret1()' at row 1
313+
ERROR 22003: Out of range value for column 'sp_vars_check_ret1()' at row 0
314314
SELECT sp_vars_check_ret2();
315-
ERROR 22003: Out of range value for column 'sp_vars_check_ret2()' at row 1
315+
ERROR 22003: Out of range value for column 'sp_vars_check_ret2()' at row 0
316316
SELECT sp_vars_check_ret3();
317-
ERROR 22007: Incorrect integer value: 'Hello, world' for column ``.``.`sp_vars_check_ret3()` at row 1
317+
ERROR 22007: Incorrect integer value: 'Hello, world' for column ``.``.`sp_vars_check_ret3()` at row 0
318318
SELECT sp_vars_check_ret4();
319319
sp_vars_check_ret4()
320320
154.12
321321
Warnings:
322-
Note 1265 Data truncated for column 'sp_vars_check_ret4()' at row 1
322+
Note 1265 Data truncated for column 'sp_vars_check_ret4()' at row 0
323323
SELECT sp_vars_div_zero();
324324
ERROR 22012: Division by 0
325325
SET @@sql_mode = 'ansi';
@@ -385,7 +385,7 @@ FF
385385
HEX(v10)
386386
FF
387387
Warnings:
388-
Warning 1264 Out of range value for column 'v5' at row 1
388+
Warning 1264 Out of range value for column 'v5' at row 0
389389
DROP PROCEDURE p1;
390390

391391
---------------------------------------------------------------
@@ -602,7 +602,7 @@ CALL p1('alpha', 'abcdef');
602602
x y
603603
alpha abc
604604
Warnings:
605-
Warning 1265 Data truncated for column 'y' at row 1
605+
Warning 1265 Data truncated for column 'y' at row 0
606606
DROP PROCEDURE p1;
607607

608608
---------------------------------------------------------------
@@ -628,7 +628,7 @@ t1 CREATE TABLE "t1" (
628628
"x" datetime DEFAULT NULL
629629
)
630630
Warnings:
631-
Warning 1265 Data truncated for column 'x' at row 1
631+
Warning 1265 Data truncated for column 'x' at row 0
632632
DROP PROCEDURE p1;
633633

634634
---------------------------------------------------------------
@@ -777,17 +777,17 @@ SET var := arg;
777777
SELECT arg, var;
778778
END|
779779
CALL p1();
780-
ERROR 22003: Out of range value for column 'v' at row 1
780+
ERROR 22003: Out of range value for column 'v' at row 0
781781
CALL p2();
782-
ERROR 22003: Out of range value for column 'v' at row 1
782+
ERROR 22003: Out of range value for column 'v' at row 0
783783
CALL p3();
784-
ERROR 22001: Data too long for column 'v' at row 1
784+
ERROR 22001: Data too long for column 'v' at row 0
785785
CALL p4('aaa');
786-
ERROR 22001: Data too long for column 'arg' at row 1
786+
ERROR 22001: Data too long for column 'arg' at row 0
787787
CALL p5('aa');
788-
ERROR 22001: Data too long for column 'var' at row 1
788+
ERROR 22001: Data too long for column 'var' at row 0
789789
CALL p6(10);
790-
ERROR 22003: Out of range value for column 'var' at row 1
790+
ERROR 22003: Out of range value for column 'var' at row 0
791791
SET @@sql_mode = 'ansi';
792792
DROP PROCEDURE p1;
793793
DROP PROCEDURE p2;
@@ -817,7 +817,7 @@ CALL p1(1929.003);
817817
var
818818
1929.00
819819
Warnings:
820-
Note 1265 Data truncated for column 'arg' at row 1
820+
Note 1265 Data truncated for column 'arg' at row 0
821821
DROP PROCEDURE p1;
822822

823823
---------------------------------------------------------------
@@ -950,17 +950,17 @@ CALL p1('c');
950950
arg
951951

952952
Warnings:
953-
Warning 1265 Data truncated for column 'arg' at row 1
953+
Warning 1265 Data truncated for column 'arg' at row 0
954954
CALL p2('a');
955955
arg var
956956
a
957957
Warnings:
958-
Warning 1265 Data truncated for column 'var' at row 1
958+
Warning 1265 Data truncated for column 'var' at row 0
959959
SELECT f1('a');
960960
f1('a')
961961

962962
Warnings:
963-
Warning 1265 Data truncated for column 'f1('a')' at row 1
963+
Warning 1265 Data truncated for column 'f1('a')' at row 0
964964
DROP PROCEDURE p1;
965965
DROP PROCEDURE p2;
966966
DROP FUNCTION f1;

0 commit comments

Comments
 (0)