Skip to content

Commit fa2875b

Browse files
committed
Merge branch 'bb-10.11-release' into bb-11.4-release
2 parents f48be8a + 835df42 commit fa2875b

15 files changed

Lines changed: 125 additions & 193 deletions

File tree

libmariadb

mysql-test/main/gis.result

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5583,4 +5583,16 @@ set sql_mode= @orig_sql_mode;
55835583
select st_astext(st_geomfromwkb(x'0103000000020000000400000000000000000000000000000000000000000000000000f03f0000000000000000000000000000f03f000000000000f03f0000000000000000000000000000000005000000000000000000e03f000000000000e03f')) 'no asan error here';
55845584
no asan error here
55855585
NULL
5586+
SELECT ST_GeomFromWKB(x'0103000000020000000400000000000000000000000000000000000000000000000000F03F0000000000000000000000000000F03F000000000000F03F0000000000000000000000000000000001000000') IS NOT NULL AS pg;
5587+
pg
5588+
0
5589+
SELECT ST_GeomFromWKB(x'01050000000200000001020000000200000000000000000000000000000000000000000000000000F03F000000000000F03F01020000000100000000000000000000') IS NOT NULL AS ml;
5590+
ml
5591+
0
5592+
SELECT ST_GeomFromWKB(x'01060000000100000001030000000100000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000') IS NOT NULL AS mp;
5593+
mp
5594+
0
5595+
SELECT ST_GeomFromWKB(x'01070000000100000001070000000100000001070000000100000001020000000100000000000000') IS NOT NULL AS gc;
5596+
gc
5597+
0
55865598
# End of 10.6 tests

mysql-test/main/gis.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3563,4 +3563,9 @@ set sql_mode= @orig_sql_mode;
35633563
--echo #
35643564
select st_astext(st_geomfromwkb(x'0103000000020000000400000000000000000000000000000000000000000000000000f03f0000000000000000000000000000f03f000000000000f03f0000000000000000000000000000000005000000000000000000e03f000000000000e03f')) 'no asan error here';
35653565

3566+
SELECT ST_GeomFromWKB(x'0103000000020000000400000000000000000000000000000000000000000000000000F03F0000000000000000000000000000F03F000000000000F03F0000000000000000000000000000000001000000') IS NOT NULL AS pg;
3567+
SELECT ST_GeomFromWKB(x'01050000000200000001020000000200000000000000000000000000000000000000000000000000F03F000000000000F03F01020000000100000000000000000000') IS NOT NULL AS ml;
3568+
SELECT ST_GeomFromWKB(x'01060000000100000001030000000100000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000') IS NOT NULL AS mp;
3569+
SELECT ST_GeomFromWKB(x'01070000000100000001070000000100000001070000000100000001020000000100000000000000') IS NOT NULL AS gc;
3570+
35663571
--echo # End of 10.6 tests

mysql-test/suite/galera/t/galera_sst_mariabackup_encrypt_with_key_server.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ call mtr.add_suppression('Removing .*/xtrabackup_galera_info file due to signal'
4545
--exec echo ssl-key=$MYSQL_TEST_DIR/std_data/server-new-key.pem >> $MYSQLTEST_VARDIR/my.cnf
4646

4747
--echo # start the server
48-
--error 0
48+
--error 0,134
4949
--exec $MYSQLD_LAST_CMD
5050
--echo # the server failed to start
5151

@@ -55,6 +55,7 @@ call mtr.add_suppression('Removing .*/xtrabackup_galera_info file due to signal'
5555
--echo # cleanup
5656
# we have to kill joiner's socat here, because the donor has aborted SST
5757
# and joiner's socat will timeout in 5 minutes
58+
--error 0,15
5859
--exec pkill -f 'socat.*server-new-cert'
5960
--exec echo ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert.pem >> $MYSQLTEST_VARDIR/my.cnf
6061
--exec echo ssl-key=$MYSQL_TEST_DIR/std_data/server-key.pem >> $MYSQLTEST_VARDIR/my.cnf

mysql-test/suite/merge/merge.result

Lines changed: 5 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3964,73 +3964,18 @@ a
39643964
5
39653965
DROP TABLE t1;
39663966
#
3967-
# End of 10.11 tests
3968-
#
3969-
#
3970-
# MDEV-30088 Assertion `cond_selectivity <= 1.0' failed in get_range_limit_read_cost
3971-
#
3972-
CREATE TABLE t1 (a TIMESTAMP, KEY(a)) ENGINE=MRG_MyISAM;
3973-
explain SELECT a, COUNT(*) FROM t1 WHERE a >= '2000-01-01 00:00:00' GROUP BY a;
3974-
id select_type table type possible_keys key key_len ref rows Extra
3975-
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3976-
SELECT a, COUNT(*) FROM t1 WHERE a >= '2000-01-01 00:00:00' GROUP BY a;
3977-
a COUNT(*)
3978-
DROP TABLE t1;
3967+
# MDEV-39494 UBSAN failure
39793968
#
3980-
# MDEV-30525: Assertion `ranges > 0' fails in IO_AND_CPU_COST handler::keyread_time
3969+
# This test was ported down from 11.x and was originally implemented under MDEV-30525.
3970+
# Under 10.11, this scenario results in a divide-by-zero failure because there are zero
3971+
# table records available.
39813972
#
39823973
CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
39833974
CREATE TABLE t2 (a INT, KEY(a)) ENGINE=MyISAM;
39843975
CREATE TABLE tm (a INT, KEY(a)) ENGINE=MRG_MyISAM UNION=(t1,t2);
39853976
SELECT DISTINCT a FROM tm WHERE a > 50;
39863977
a
39873978
DROP TABLE tm, t1, t2;
3988-
# Testcase 2:
3989-
CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
3990-
CREATE TABLE t2 (a INT, KEY(a)) ENGINE=MyISAM;
3991-
CREATE TABLE tm (a INT, KEY(a)) ENGINE=MERGE UNION = (t1, t2) INSERT_METHOD=FIRST;
3992-
ANALYZE TABLE tm PERSISTENT FOR ALL;
3993-
Table Op Msg_type Msg_text
3994-
test.tm analyze status Engine-independent statistics collected
3995-
test.tm analyze note The storage engine for the table doesn't support analyze
3996-
SELECT DISTINCT a FROM (SELECT * FROM tm WHERE a iS NOT NULL) AS sq;
3997-
a
3998-
DROP TABLE tm, t1, t2;
3999-
#
4000-
# MDEV-30568 Assertion `cond_selectivity <= 1.000000001' failed in get_range_limit_read_cost
4001-
#
4002-
CREATE TABLE t1 (f INT, KEY(f)) ENGINE=MyISAM;
4003-
CREATE TABLE t2 (f INT, KEY(f)) ENGINE=MyISAM;
4004-
CREATE TABLE tm (f INT, KEY(f)) ENGINE=MERGE UNION = (t1, t2);
4005-
SELECT DISTINCT f FROM tm WHERE f IN (47, 126, 97, 48, 73, 0);
4006-
f
4007-
DROP TABLE tm, t1, t2;
4008-
#
4009-
# MDEV-30786 SIGFPE in cost_group_min_max on EXP
4010-
#
4011-
SET use_stat_tables='preferably';
4012-
CREATE TABLE t1 (a INT,b INT,KEY i1 (a),KEY i2 (b)) ENGINE=MRG_MyISAM;
4013-
ANALYZE LOCAL TABLE t1;
4014-
Table Op Msg_type Msg_text
4015-
test.t1 analyze status Engine-independent statistics collected
4016-
test.t1 analyze note The storage engine for the table doesn't support analyze
4017-
EXPLAIN SELECT DISTINCT a FROM t1;
4018-
id select_type table type possible_keys key key_len ref rows Extra
4019-
1 SIMPLE t1 range NULL i1 5 NULL 1 Using index for group-by
4020-
drop table t1;
4021-
set use_stat_tables=default;
4022-
#
4023-
# End of 11.0 tests
4024-
#
4025-
#
4026-
# MDEV-29174: UPDATE of view that uses MERGE table
4027-
#
4028-
CREATE TABLE t1 (a int) ENGINE=MERGE;
4029-
CREATE VIEW v1 AS SELECT a FROM t1;
4030-
UPDATE v1 SET a=0;
4031-
DROP VIEW v1;
4032-
DROP TABLE t1;
4033-
# End of 11.1 tests
40343979
#
40353980
# MDEV-38474 Double free or corruption, ASAN heap-use-after-free in st_join_table::cleanup
40363981
#
@@ -4057,5 +4002,5 @@ UPDATE t1 STRAIGHT_JOIN t2 SET a = 89 WHERE 9 IN (SELECT c FROM t3 WHERE c IN (S
40574002
ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
40584003
DROP TABLE t1, t2, t3, t4;
40594004
#
4060-
# End of 11.4 tests
4005+
# End of 10.11 tests
40614006
#

mysql-test/suite/merge/merge.test

Lines changed: 6 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2903,69 +2903,19 @@ EXECUTE nested;
29032903
DROP TABLE t1;
29042904

29052905
--echo #
2906-
--echo # End of 10.11 tests
2907-
--echo #
2908-
2909-
--echo #
2910-
--echo # MDEV-30088 Assertion `cond_selectivity <= 1.0' failed in get_range_limit_read_cost
2911-
--echo #
2912-
2913-
CREATE TABLE t1 (a TIMESTAMP, KEY(a)) ENGINE=MRG_MyISAM;
2914-
explain SELECT a, COUNT(*) FROM t1 WHERE a >= '2000-01-01 00:00:00' GROUP BY a;
2915-
SELECT a, COUNT(*) FROM t1 WHERE a >= '2000-01-01 00:00:00' GROUP BY a;
2916-
DROP TABLE t1;
2917-
2906+
--echo # MDEV-39494 UBSAN failure
29182907
--echo #
2919-
--echo # MDEV-30525: Assertion `ranges > 0' fails in IO_AND_CPU_COST handler::keyread_time
2908+
--echo # This test was ported down from 11.x and was originally implemented under MDEV-30525.
2909+
--echo # Under 10.11, this scenario results in a divide-by-zero failure because there are zero
2910+
--echo # table records available.
29202911
--echo #
29212912
CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
29222913
CREATE TABLE t2 (a INT, KEY(a)) ENGINE=MyISAM;
29232914
CREATE TABLE tm (a INT, KEY(a)) ENGINE=MRG_MyISAM UNION=(t1,t2);
2915+
# Must have zero records to produce UBSAN failure on divide-by-zero.
29242916
SELECT DISTINCT a FROM tm WHERE a > 50;
29252917
DROP TABLE tm, t1, t2;
29262918

2927-
--echo # Testcase 2:
2928-
CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
2929-
CREATE TABLE t2 (a INT, KEY(a)) ENGINE=MyISAM;
2930-
CREATE TABLE tm (a INT, KEY(a)) ENGINE=MERGE UNION = (t1, t2) INSERT_METHOD=FIRST;
2931-
ANALYZE TABLE tm PERSISTENT FOR ALL;
2932-
SELECT DISTINCT a FROM (SELECT * FROM tm WHERE a iS NOT NULL) AS sq;
2933-
DROP TABLE tm, t1, t2;
2934-
2935-
--echo #
2936-
--echo # MDEV-30568 Assertion `cond_selectivity <= 1.000000001' failed in get_range_limit_read_cost
2937-
--echo #
2938-
CREATE TABLE t1 (f INT, KEY(f)) ENGINE=MyISAM;
2939-
CREATE TABLE t2 (f INT, KEY(f)) ENGINE=MyISAM;
2940-
CREATE TABLE tm (f INT, KEY(f)) ENGINE=MERGE UNION = (t1, t2);
2941-
SELECT DISTINCT f FROM tm WHERE f IN (47, 126, 97, 48, 73, 0);
2942-
DROP TABLE tm, t1, t2;
2943-
2944-
--echo #
2945-
--echo # MDEV-30786 SIGFPE in cost_group_min_max on EXP
2946-
--echo #
2947-
SET use_stat_tables='preferably';
2948-
CREATE TABLE t1 (a INT,b INT,KEY i1 (a),KEY i2 (b)) ENGINE=MRG_MyISAM;
2949-
ANALYZE LOCAL TABLE t1;
2950-
EXPLAIN SELECT DISTINCT a FROM t1;
2951-
drop table t1;
2952-
set use_stat_tables=default;
2953-
2954-
--echo #
2955-
--echo # End of 11.0 tests
2956-
--echo #
2957-
--echo #
2958-
--echo # MDEV-29174: UPDATE of view that uses MERGE table
2959-
--echo #
2960-
2961-
CREATE TABLE t1 (a int) ENGINE=MERGE;
2962-
CREATE VIEW v1 AS SELECT a FROM t1;
2963-
UPDATE v1 SET a=0;
2964-
DROP VIEW v1;
2965-
DROP TABLE t1;
2966-
2967-
--echo # End of 11.1 tests
2968-
29692919
--echo #
29702920
--echo # MDEV-38474 Double free or corruption, ASAN heap-use-after-free in st_join_table::cleanup
29712921
--echo #
@@ -2997,5 +2947,5 @@ UPDATE t1 STRAIGHT_JOIN t2 SET a = 89 WHERE 9 IN (SELECT c FROM t3 WHERE c IN (S
29972947
DROP TABLE t1, t2, t3, t4;
29982948

29992949
--echo #
3000-
--echo # End of 11.4 tests
2950+
--echo # End of 10.11 tests
30012951
--echo #

mysql-test/suite/s3/debug.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ select count(*) from t1;
2424
count(*)
2525
100
2626
set @@global.s3_debug=0;
27-
FOUND 6 /s3_test_/ in mysqld.1.err
27+
FOUND 8 /s3_test_/ in mysqld.1.err
2828
select count(*) from t1;
2929
count(*)
3030
100
3131
drop table t1;
32-
FOUND 6 /s3_test_/ in mysqld.1.err
32+
FOUND 8 /s3_test_/ in mysqld.1.err

sql/opt_range.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15529,6 +15529,9 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
1552915529
else
1553015530
num_groups= records;
1553115531

15532+
DBUG_ASSERT(keys_per_group > 0);
15533+
DBUG_ASSERT(num_groups > 0);
15534+
1553215535
/* Apply the selectivity of the quick select for group prefixes. */
1553315536
if (range_tree && (quick_prefix_records != HA_POS_ERROR))
1553415537
{

sql/spatial.cc

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
double my_double_round(double value, longlong dec, bool dec_unsigned,
2626
bool truncate);
2727

28+
#define advance(wkb,len,N) do { wkb+=(N); len-=(N); } while(0)
29+
2830
#ifdef HAVE_SPATIAL
2931

3032
/*
@@ -472,16 +474,17 @@ Geometry *Geometry::create_from_wkb(Geometry_buffer *buffer,
472474

473475
if (len < WKB_HEADER_SIZE)
474476
return NULL;
475-
geom_type= wkb_get_uint(wkb+1, (wkbByteOrder)wkb[0]);
477+
wkbByteOrder bo= (wkbByteOrder)wkb[0];
478+
geom_type= wkb_get_uint(wkb+1, bo);
476479
if (!(geom= create_by_typeid(buffer, (int) geom_type)) ||
477480
res->reserve(WKB_HEADER_SIZE, 512))
478481
return NULL;
479482

480483
res->q_append((char) wkb_ndr);
481484
res->q_append(geom_type);
482485

483-
return geom->init_from_wkb(wkb + WKB_HEADER_SIZE, len - WKB_HEADER_SIZE,
484-
(wkbByteOrder) wkb[0], res) ? geom : NULL;
486+
advance(wkb,len,WKB_HEADER_SIZE);
487+
return geom->init_from_wkb(wkb, len, bo, res) ? geom : 0;
485488
}
486489

487490

@@ -1634,8 +1637,7 @@ uint Gis_polygon::init_from_wkb(const char *wkb, uint len, wkbByteOrder bo,
16341637

16351638
if (res->reserve(4, 512))
16361639
return 0;
1637-
wkb+= 4;
1638-
len-= 4;
1640+
advance(wkb,len,4);
16391641
res->q_append(n_linear_rings);
16401642

16411643
while (n_linear_rings--)
@@ -1652,8 +1654,7 @@ uint Gis_polygon::init_from_wkb(const char *wkb, uint len, wkbByteOrder bo,
16521654

16531655
if (ls.is_closed(&closed) || !closed)
16541656
return 0;
1655-
wkb+= ls_len;
1656-
len-= ls_len;
1657+
advance(wkb,len,ls_len);
16571658
}
16581659

16591660
return (uint) (wkb - wkb_orig);
@@ -2518,7 +2519,7 @@ uint Gis_multi_line_string::init_from_wkb(const char *wkb, uint len,
25182519
return 0;
25192520
res->q_append(n_line_strings);
25202521

2521-
wkb+= 4;
2522+
advance(wkb,len,4);
25222523
while (n_line_strings--)
25232524
{
25242525
Gis_line_string ls;
@@ -2530,13 +2531,12 @@ uint Gis_multi_line_string::init_from_wkb(const char *wkb, uint len,
25302531

25312532
res->q_append((char) wkb_ndr);
25322533
res->q_append((uint32) wkb_linestring);
2534+
wkbByteOrder bo= (wkbByteOrder)wkb[0];
2535+
advance(wkb,len,WKB_HEADER_SIZE);
25332536

2534-
if (!(ls_len= ls.init_from_wkb(wkb + WKB_HEADER_SIZE, len,
2535-
(wkbByteOrder) wkb[0], res)))
2537+
if (!(ls_len= ls.init_from_wkb(wkb, len, bo, res)))
25362538
return 0;
2537-
ls_len+= WKB_HEADER_SIZE;;
2538-
wkb+= ls_len;
2539-
len-= ls_len;
2539+
advance(wkb,len,ls_len);
25402540
}
25412541
return (uint) (wkb - wkb_orig);
25422542
}
@@ -2893,7 +2893,7 @@ uint Gis_multi_polygon::init_from_wkb(const char *wkb, uint len,
28932893
return 0;
28942894
res->q_append(n_poly);
28952895

2896-
wkb+=4;
2896+
advance(wkb,len,4);
28972897
while (n_poly--)
28982898
{
28992899
Gis_polygon p;
@@ -2905,12 +2905,11 @@ uint Gis_multi_polygon::init_from_wkb(const char *wkb, uint len,
29052905
res->q_append((char) wkb_ndr);
29062906
res->q_append((uint32) wkb_polygon);
29072907

2908-
if (!(p_len= p.init_from_wkb(wkb + WKB_HEADER_SIZE, len,
2909-
(wkbByteOrder) wkb[0], res)))
2908+
wkbByteOrder bo= (wkbByteOrder)wkb[0];
2909+
advance(wkb,len,WKB_HEADER_SIZE);
2910+
if (!(p_len= p.init_from_wkb(wkb, len, bo, res)))
29102911
return 0;
2911-
p_len+= WKB_HEADER_SIZE;
2912-
wkb+= p_len;
2913-
len-= p_len;
2912+
advance(wkb,len,p_len);
29142913
}
29152914
return (uint) (wkb - wkb_orig);
29162915
}
@@ -3409,7 +3408,7 @@ uint Gis_geometry_collection::init_from_wkb(const char *wkb, uint len,
34093408
return 0;
34103409
res->q_append(n_geom);
34113410

3412-
wkb+= 4;
3411+
advance(wkb,len,4);
34133412
while (n_geom--)
34143413
{
34153414
Geometry_buffer buffer;
@@ -3421,17 +3420,16 @@ uint Gis_geometry_collection::init_from_wkb(const char *wkb, uint len,
34213420
res->reserve(WKB_HEADER_SIZE, 512))
34223421
return 0;
34233422

3423+
wkbByteOrder bo= (wkbByteOrder)wkb[0];
34243424
res->q_append((char) wkb_ndr);
3425-
wkb_type= wkb_get_uint(wkb+1, (wkbByteOrder) wkb[0]);
3425+
wkb_type= wkb_get_uint(wkb+1, bo);
34263426
res->q_append(wkb_type);
34273427

3428+
advance(wkb,len,WKB_HEADER_SIZE);
34283429
if (!(geom= create_by_typeid(&buffer, wkb_type)) ||
3429-
!(g_len= geom->init_from_wkb(wkb + WKB_HEADER_SIZE, len,
3430-
(wkbByteOrder) wkb[0], res)))
3430+
!(g_len= geom->init_from_wkb(wkb, len, bo, res)))
34313431
return 0;
3432-
g_len+= WKB_HEADER_SIZE;
3433-
wkb+= g_len;
3434-
len-= g_len;
3432+
advance(wkb,len,g_len);
34353433
}
34363434
return (uint) (wkb - wkb_orig);
34373435
}

sql/sql_select.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7604,7 +7604,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
76047604
{
76057605
uint and_level,i;
76067606
KEY_FIELD *key_fields, *end, *field;
7607-
uint sz;
7607+
size_t sz;
76087608
uint m= MY_MAX(select_lex->max_equal_elems,1);
76097609
DBUG_ENTER("update_ref_and_keys");
76107610
DBUG_PRINT("enter", ("normal_tables: %llx", normal_tables));

0 commit comments

Comments
 (0)