Skip to content

Commit 062216d

Browse files
author
Tor Didriksen
committed
Bug #33881339 Default collation causes inconsistent results
Equivalent queries would return different results, caused by slightly different execution paths. Item::val_int_from_string() and Item_string::val_int() should use the same algorithm for string to int conversion. Remove some old gis tests. They were not testing anything useful. Change-Id: If36fc3eb79671f21a25eb9d06fa75ba1a567095e (cherry picked from commit c1bfa079149a06229feb43eece4019886b27dc9b)
1 parent 3171d5c commit 062216d

File tree

11 files changed

+39
-833
lines changed

11 files changed

+39
-833
lines changed

mysql-test/r/func_date_add.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ End of 5.0 tests
5454
#
5555
SELECT ADDDATE('8112-06-20', REPEAT('1', 32));
5656
ADDDATE('8112-06-20', REPEAT('1', 32))
57-
NULL
57+
8112-06-19
5858
Warnings:
59-
Warning 1441 Datetime function: datetime field overflow
59+
Warning 1292 Truncated incorrect INTEGER value: '11111111111111111111111111111111'
6060
# Bug#32915973: Prepare DATE_ADD/DATE_SUB incorrectly returns DATETIME
6161
SELECT ADDDATE(DATE'2021-01-01', INTERVAL 1 DAY);
6262
ADDDATE(DATE'2021-01-01', INTERVAL 1 DAY)

mysql-test/r/func_str.result

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5661,3 +5661,16 @@ NULL
56615661
DROP TABLE t1;
56625662
CREATE TABLE t1 AS SELECT HEX(-1) AS f;
56635663
DROP TABLE t1;
5664+
#
5665+
# Bug #33881339 Default collation causes inconsistent results
5666+
#
5667+
CREATE TABLE t0(c0 DECIMAL);
5668+
INSERT INTO t0 VALUES(NULL);
5669+
UPDATE t0 SET c0 = 1 WHERE (t0.c0 IS NULL)>>('');
5670+
ERROR 22007: Truncated incorrect INTEGER value: ''
5671+
DROP TABLE t0;
5672+
CREATE TABLE t0(c0 DECIMAL);
5673+
INSERT INTO t0 VALUES(NULL);
5674+
UPDATE t0 SET c0 = 1 WHERE (t0.c0 IS NULL)>>('' COLLATE 'utf8mb4_0900_ai_ci');
5675+
ERROR 22007: Truncated incorrect INTEGER value: ''
5676+
DROP TABLE t0;

mysql-test/r/gis-rtree.result

Lines changed: 0 additions & 400 deletions
Large diffs are not rendered by default.

mysql-test/r/type_temporal_fractional.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17719,7 +17719,7 @@ DROP TABLE t1;
1771917719
#
1772017720
do date_add(utc_time(), interval(oct(-11779)) microsecond);
1772117721
Warnings:
17722-
Warning 1441 Datetime function: time field overflow
17722+
Warning 1292 Truncated incorrect INTEGER value: '1777777777777777750775'
1772317723
#
1772417724
# Bug #31054071 UBSAN: SIGNED INTEGER OVERFLOW IN
1772517725
# ITEM_DATE_ADD_INTERVAL::GET_TIME_INTERNAL

mysql-test/r/varbinary.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,8 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
453453
def CAST(0x01 AS char) | 0x31393838 8 21 9 Y 32928 0 63
454454
CAST(0x01 AS char) | 0x31393838
455455
825833528
456+
Warnings:
457+
Warning 1292 Truncated incorrect INTEGER value: ''
456458
SELECT 0x01 << 1;
457459
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
458460
def 0x01 << 1 8 21 1 N 32929 0 63

mysql-test/r/xml.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,8 @@ Warnings:
11901190
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
11911191
do weight_string(extractvalue('','/*/a'));
11921192
do char((weight_string(extractvalue((''),('tX')))) using cp852);
1193+
Warnings:
1194+
Warning 1292 Truncated incorrect INTEGER value: ''
11931195
set names default;
11941196
#
11951197
# Bug#22552615 EXTRACTVALUE RETURNS NULL WHEN NO MATCHING

0 commit comments

Comments
 (0)