Skip to content

Commit 73f5094

Browse files
committed
Merge mysql-trunk --> mysql-trunk-wl5259
2 parents dc0a18c + e061a55 commit 73f5094

File tree

118 files changed

+2061
-321
lines changed

Some content is hidden

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

118 files changed

+2061
-321
lines changed

mysql-test/include/order_by.inc

+31
Original file line numberDiff line numberDiff line change
@@ -1750,3 +1750,34 @@ INSERT INTO t1 VALUES (1), (2);
17501750
INSERT INTO t2 VALUES (1,2), (2,3);
17511751
SELECT (SELECT 1 FROM t1 WHERE a=b AND c=1 ORDER BY a DESC) FROM t2;
17521752
DROP TABLE t1, t2;
1753+
1754+
--echo #
1755+
--echo # Bug #13531865
1756+
--echo # TEST_IF_SKIP_SORT_ORDER() INCORRECTLY SKIP FILESORT IF
1757+
--echo # 'TYPE' IS REF_OR_NULL
1758+
--echo #
1759+
--echo #
1760+
1761+
CREATE TABLE t1 (
1762+
a INT,
1763+
c INT,
1764+
UNIQUE KEY a_c (a,c),
1765+
KEY (a)) engine=myisam;
1766+
1767+
INSERT INTO t1 VALUES (1,10), (2,NULL), (2,10);
1768+
ANALYZE TABLE t1;
1769+
1770+
--echo # Using 'KEY a_c' for order-by opt, would have required
1771+
--echo # REF_OR_NULL access which never can be order_by skipped.
1772+
--echo # -> Keep initial REF on 'KEY a' selected by cond. optimizer
1773+
EXPLAIN
1774+
SELECT c FROM t1 WHERE a=2 AND (c=10 OR c IS NULL);
1775+
EXPLAIN
1776+
SELECT c FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
1777+
SELECT c FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
1778+
1779+
EXPLAIN
1780+
SELECT c FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c DESC;
1781+
SELECT c FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c DESC;
1782+
1783+
DROP TABLE t1;
+12-27
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# ==== Purpose ====
22
#
3-
# Several test primitives from mysql-test/extra/rpl_tests
4-
# shared for test cases for MyISAM, InnoDB, NDB and other
5-
# engines. But for NDB all events will be added by NDB
6-
# injector and now there are no way to detect the state of
7-
# NDB injector therefore this primitive waits 5 sec
8-
# if engine type is NDB.
9-
# In future that should be fixed by waiting of proper
10-
# state of NDB injector.
3+
# Several test primitives from mysql-test/extra/rpl_tests
4+
# are shared for test cases for MyISAM, InnoDB, NDB and
5+
# other engines.
6+
# For NDB engine all events will be added by NDB injector
7+
# so tests only can continue after injector is ready,
8+
# this test waits for proper injector thread state.
119
#
1210
# ==== Usage ====
1311
#
@@ -17,25 +15,12 @@
1715
# ==== Parameters =====
1816
#
1917
# $engine_type
20-
# Type of engine. If type is NDB then it waits $wait_time sec
21-
#
22-
# $wait_time
23-
# Test will wait $wait_time seconds
24-
25-
let $_wait_time= 5;
26-
27-
if (!$wait_time) {
28-
let $_wait_time= $wait_time;
29-
}
18+
# Type of engine. If type is NDB then it waits for injector
19+
# thread proper state.
3020

3121
if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) {
32-
while (!$_wait_time) {
33-
let $_wait_time_internal= 10;
34-
while (!$_wait_time_internal) {
35-
sleep 0.1;
36-
dec $_wait_time_internal;
37-
}
38-
dec $_wait_time;
39-
}
22+
let $show_statement= SHOW PROCESSLIST;
23+
let $field= State;
24+
let $condition= = 'Waiting for event from ndbcluster';
25+
source include/wait_show_condition.inc;
4026
}
41-

mysql-test/mysql-test-run.pl

+2-1
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,8 @@ ()
20142014
$exe_mysql_plugin= mtr_exe_exists("$path_client_bindir/mysql_plugin");
20152015

20162016
$exe_mysql_embedded=
2017-
mtr_exe_maybe_exists("$bindir/libmysqld/examples/mysql_embedded",
2017+
mtr_exe_maybe_exists(vs_config_dirs('libmysqld/examples','mysql_embedded'),
2018+
"$bindir/libmysqld/examples/mysql_embedded",
20182019
"$bindir/bin/mysql_embedded");
20192020

20202021
if ( ! $opt_skip_ndbcluster )

mysql-test/r/bigint.result

+64
Original file line numberDiff line numberDiff line change
@@ -438,3 +438,67 @@ Level Code Message
438438
Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 0) and ('0' = `test`.`t1`.`b`))
439439
DROP TABLE t1;
440440
# End of 5.1 tests
441+
#
442+
# Bug#13463415 63502: INCORRECT RESULTS OF BIGINT AND DECIMAL COMPARISON
443+
#
444+
CREATE TABLE t_bigint(id BIGINT);
445+
INSERT INTO t_bigint VALUES (1), (2);
446+
SELECT id, id >= 1.1 FROM t_bigint;
447+
id id >= 1.1
448+
1 0
449+
2 1
450+
SELECT id, 1.1 <= id FROM t_bigint;
451+
id 1.1 <= id
452+
1 0
453+
2 1
454+
SELECT id, id = 1.1 FROM t_bigint;
455+
id id = 1.1
456+
1 0
457+
2 0
458+
SELECT id, 1.1 = id FROM t_bigint;
459+
id 1.1 = id
460+
1 0
461+
2 0
462+
SELECT * from t_bigint WHERE id = 1.1;
463+
id
464+
SELECT * from t_bigint WHERE id = 1.1e0;
465+
id
466+
SELECT * from t_bigint WHERE id = '1.1';
467+
id
468+
SELECT * from t_bigint WHERE id = '1.1e0';
469+
id
470+
SELECT * from t_bigint WHERE id IN (1.1, 2.2);
471+
id
472+
SELECT * from t_bigint WHERE id IN (1.1e0, 2.2e0);
473+
id
474+
SELECT * from t_bigint WHERE id IN ('1.1', '2.2');
475+
id
476+
SELECT * from t_bigint WHERE id IN ('1.1e0', '2.2e0');
477+
id
478+
SELECT * from t_bigint WHERE id BETWEEN 1.1 AND 1.9;
479+
id
480+
SELECT * from t_bigint WHERE id BETWEEN 1.1e0 AND 1.9e0;
481+
id
482+
SELECT * from t_bigint WHERE id BETWEEN '1.1' AND '1.9';
483+
id
484+
SELECT * from t_bigint WHERE id BETWEEN '1.1e0' AND '1.9e0';
485+
id
486+
DROP TABLE t_bigint;
487+
#
488+
# Bug#11758543 50756: BIGINT '100' MATCHES 1.001E2
489+
#
490+
CREATE TABLE t1 (a BIGINT);
491+
INSERT INTO t1 VALUES (1);
492+
SELECT * FROM t1 WHERE coalesce(a) BETWEEN 0 and 0.9;
493+
a
494+
SELECT * FROM t1 WHERE coalesce(a)=0.9;
495+
a
496+
SELECT * FROM t1 WHERE coalesce(a) in (0.8,0.9);
497+
a
498+
SELECT * FROM t1 WHERE a BETWEEN 0 AND 0.9;
499+
a
500+
SELECT * FROM t1 WHERE a=0.9;
501+
a
502+
SELECT * FROM t1 WHERE a IN (0.8,0.9);
503+
a
504+
DROP TABLE t1;

mysql-test/r/date_formats.result

+31
Original file line numberDiff line numberDiff line change
@@ -558,3 +558,34 @@ SET NAMES latin1;
558558
#
559559
# End of 5.1 tests
560560
#
561+
#
562+
# Start of 5.6 tests
563+
#
564+
#
565+
# WL#946 Fractional seconds precision
566+
# Testing Item_func_date_format with NULL argument.
567+
#
568+
SELECT CAST(TIME_FORMAT(NULL, '%s') AS CHAR);
569+
CAST(TIME_FORMAT(NULL, '%s') AS CHAR)
570+
NULL
571+
SELECT CAST(TIME_FORMAT(NULL, '%s') AS SIGNED);
572+
CAST(TIME_FORMAT(NULL, '%s') AS SIGNED)
573+
NULL
574+
SELECT CAST(TIME_FORMAT(NULL, '%s') AS DECIMAL(23,6));
575+
CAST(TIME_FORMAT(NULL, '%s') AS DECIMAL(23,6))
576+
NULL
577+
SELECT CAST(TIME_FORMAT(NULL, '%s') AS TIME);
578+
CAST(TIME_FORMAT(NULL, '%s') AS TIME)
579+
NULL
580+
SELECT CAST(TIME_FORMAT(NULL, '%s') AS DATE);
581+
CAST(TIME_FORMAT(NULL, '%s') AS DATE)
582+
NULL
583+
SELECT CAST(TIME_FORMAT(NULL, '%s') AS DATETIME);
584+
CAST(TIME_FORMAT(NULL, '%s') AS DATETIME)
585+
NULL
586+
SELECT TIME_FORMAT(NULL, '%s')+0e0;
587+
TIME_FORMAT(NULL, '%s')+0e0
588+
NULL
589+
#
590+
# End of 5.6 tests
591+
#

mysql-test/r/func_in_icp.result

+2
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ SELECT HEX(a) FROM t2 WHERE a IN
470470
HEX(a)
471471
7FFFFFFFFFFFFFFE
472472
7FFFFFFFFFFFFFFF
473+
Warnings:
474+
Warning 1292 Truncated incorrect DOUBLE value: 'abc'
473475
CREATE TABLE t3 (a BIGINT UNSIGNED);
474476
INSERT INTO t3 VALUES (9223372036854775551);
475477
SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42);

mysql-test/r/func_in_icp_mrr.result

+2
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ SELECT HEX(a) FROM t2 WHERE a IN
470470
HEX(a)
471471
7FFFFFFFFFFFFFFE
472472
7FFFFFFFFFFFFFFF
473+
Warnings:
474+
Warning 1292 Truncated incorrect DOUBLE value: 'abc'
473475
CREATE TABLE t3 (a BIGINT UNSIGNED);
474476
INSERT INTO t3 VALUES (9223372036854775551);
475477
SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42);

mysql-test/r/func_in_mrr.result

+2
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ SELECT HEX(a) FROM t2 WHERE a IN
470470
HEX(a)
471471
7FFFFFFFFFFFFFFE
472472
7FFFFFFFFFFFFFFF
473+
Warnings:
474+
Warning 1292 Truncated incorrect DOUBLE value: 'abc'
473475
CREATE TABLE t3 (a BIGINT UNSIGNED);
474476
INSERT INTO t3 VALUES (9223372036854775551);
475477
SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42);

mysql-test/r/func_in_mrr_cost.result

+2
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ SELECT HEX(a) FROM t2 WHERE a IN
470470
HEX(a)
471471
7FFFFFFFFFFFFFFE
472472
7FFFFFFFFFFFFFFF
473+
Warnings:
474+
Warning 1292 Truncated incorrect DOUBLE value: 'abc'
473475
CREATE TABLE t3 (a BIGINT UNSIGNED);
474476
INSERT INTO t3 VALUES (9223372036854775551);
475477
SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42);

mysql-test/r/func_in_none.result

+2
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,8 @@ SELECT HEX(a) FROM t2 WHERE a IN
469469
HEX(a)
470470
7FFFFFFFFFFFFFFE
471471
7FFFFFFFFFFFFFFF
472+
Warnings:
473+
Warning 1292 Truncated incorrect DOUBLE value: 'abc'
472474
CREATE TABLE t3 (a BIGINT UNSIGNED);
473475
INSERT INTO t3 VALUES (9223372036854775551);
474476
SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42);

mysql-test/r/func_str.result

+36
Original file line numberDiff line numberDiff line change
@@ -2876,6 +2876,42 @@ SELECT ((0xf3) * (rpad(1.0,2048,1)) << (0xcc));
28762876
((0xf3) * (rpad(1.0,2048,1)) << (0xcc))
28772877
0
28782878
#
2879+
# Bug#13359121 LARGE NUMBERS, /STRINGS/DTOA.C:662:
2880+
# BALLOC: ASSERTION `K <= 15' FAILED.
2881+
# Bug#12985021 SIMPLE QUERY WITH DECIMAL NUMBERS TAKE AN
2882+
# EXTRAORDINARY LONG TIME TO EXECUTE
2883+
SELECT @tmp_max:= @@global.max_allowed_packet;
2884+
@tmp_max:= @@global.max_allowed_packet
2885+
1048576
2886+
SET @@global.max_allowed_packet=1024*1024*1024;
2887+
SELECT @@global.max_allowed_packet;
2888+
@@global.max_allowed_packet
2889+
1073741824
2890+
do
2891+
format(rpad('111111111.1',
2892+
1111111,
2893+
'999999999999999999999999999999999999999999'),0,'be_BY')
2894+
;
2895+
DO
2896+
round(
2897+
concat( (
2898+
coalesce( (
2899+
linefromwkb('2147483648',
2900+
-b'1111111111111111111111111111111111111111111')),
2901+
( convert('[.DC2.]',decimal(30,30)) ),
2902+
bit_count('')
2903+
) ),
2904+
( lpad( ( elt('01','}:K5')),
2905+
sha1('P'),
2906+
( ( select '-9223372036854775808.1' > all (select '')))
2907+
)
2908+
)
2909+
)
2910+
);
2911+
Warnings:
2912+
Warning 1292 Truncated incorrect DECIMAL value: '[.DC2.]'
2913+
SET @@global.max_allowed_packet:= @tmp_max;
2914+
#
28792915
# End of 5.5 tests
28802916
#
28812917
#

0 commit comments

Comments
 (0)