mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '10.0' into 10.1
This commit is contained in:
@@ -106,5 +106,25 @@ Note 1003 select `test`.`t2`.`d1` AS `d1`,`test`.`t1`.`d1` AS `d1` from `test`.`
|
|||||||
DROP VIEW v1;
|
DROP VIEW v1;
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
#
|
#
|
||||||
|
# MDEV-15475: Assertion `!table || (!table->read_set ||
|
||||||
|
# bitmap_is_set(table->read_set, field_index))'
|
||||||
|
# failed on EXPLAIN EXTENDED with constant table and view
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM;
|
||||||
|
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||||
|
INSERT INTO t1 VALUES (1);
|
||||||
|
EXPLAIN EXTENDED SELECT ISNULL(pk) FROM v1;
|
||||||
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||||
|
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||||
|
Warnings:
|
||||||
|
Note 1003 select isnull(/*always not null*/ 1) AS `ISNULL(pk)` from dual
|
||||||
|
EXPLAIN EXTENDED SELECT IFNULL(pk,0) FROM v1;
|
||||||
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||||
|
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||||
|
Warnings:
|
||||||
|
Note 1003 select ifnull(1,0) AS `IFNULL(pk,0)` from dual
|
||||||
|
DROP VIEW v1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
# End of 5.5 tests
|
# End of 5.5 tests
|
||||||
#
|
#
|
||||||
|
@@ -2796,6 +2796,11 @@ SEC_TO_TIME(MAKEDATE(0,RAND(~0)))
|
|||||||
838:59:59
|
838:59:59
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1292 Truncated incorrect time value: '20000101'
|
Warning 1292 Truncated incorrect time value: '20000101'
|
||||||
|
SELECT PERIOD_DIFF(2018, AES_ENCRYPT('Rae Bareli', 'Rae Bareli'));
|
||||||
|
PERIOD_DIFF(2018, AES_ENCRYPT('Rae Bareli', 'Rae Bareli'))
|
||||||
|
24257
|
||||||
|
Warnings:
|
||||||
|
Warning 1292 Truncated incorrect INTEGER value: '-3S\xFA\xDE?\x00\x00\xCA\xB3\xEEE\xA4\xD1\xC1\xA8'
|
||||||
#
|
#
|
||||||
# End of 5.5 tests
|
# End of 5.5 tests
|
||||||
#
|
#
|
||||||
|
@@ -482,3 +482,22 @@ DROP TABLE t1,t2;
|
|||||||
set optimizer_switch= @tmp_subselect_extra_derived;
|
set optimizer_switch= @tmp_subselect_extra_derived;
|
||||||
set optimizer_switch= @subselect_extra_no_sj_tmp;
|
set optimizer_switch= @subselect_extra_no_sj_tmp;
|
||||||
set @optimizer_switch_for_subselect_extra_test=null;
|
set @optimizer_switch_for_subselect_extra_test=null;
|
||||||
|
#
|
||||||
|
# MDEV-6439: Server crashes in Explain_union::print_explain with explain in slow log, tis620 charset
|
||||||
|
#
|
||||||
|
SET NAMES tis620;
|
||||||
|
set @tmp= @@global.slow_query_log;
|
||||||
|
SET GLOBAL slow_query_log = 1;
|
||||||
|
SET long_query_time = 0.000001;
|
||||||
|
SET log_slow_verbosity = 'explain';
|
||||||
|
CREATE TABLE t1 (a VARCHAR(3)) ENGINE=MyISAM;
|
||||||
|
SELECT * FROM t1 WHERE a >= ANY ( SELECT 'foo');
|
||||||
|
a
|
||||||
|
SELECT * FROM t1 WHERE a >= ANY ( SELECT 'foo' UNION SELECT 'bar' );
|
||||||
|
ERROR HY000: Illegal mix of collations (tis620_thai_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<='
|
||||||
|
create table t2 (b int);
|
||||||
|
insert into t2 values (1),(2),(3);
|
||||||
|
SELECT * FROM t1 WHERE a >= ANY ( SELECT 'foo' FROM t2);
|
||||||
|
ERROR HY000: Illegal mix of collations (tis620_thai_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<='
|
||||||
|
drop table t1,t2;
|
||||||
|
SET GLOBAL slow_query_log=@tmp;
|
||||||
|
@@ -499,7 +499,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
|||||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a1`,`test`.`t1`.`a2`>(<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),<exists>(select '1 - 01','2 - 01' having (((<cache>(`test`.`t1`.`a1`) = '1 - 01') or isnull('1 - 01')) and ((<cache>(`test`.`t1`.`a2`) = '2 - 01') or isnull('2 - 01')) and <is_not_null_test>('1 - 01') and <is_not_null_test>('2 - 01')))))
|
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a1`,`test`.`t1`.`a2`>(<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),<exists>(select '1 - 01','2 - 01' having (((<cache>(`test`.`t1`.`a1`) = '1 - 01') or isnull(/*always not null*/ 1)) and ((<cache>(`test`.`t1`.`a2`) = '2 - 01') or isnull(/*always not null*/ 1)) and <is_not_null_test>('1 - 01') and <is_not_null_test>('2 - 01')))))
|
||||||
select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01');
|
select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01');
|
||||||
a1 a2
|
a1 a2
|
||||||
1 - 01 2 - 01
|
1 - 01 2 - 01
|
||||||
@@ -509,7 +509,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
|||||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a1`,`test`.`t1`.`a2`>(<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),<exists>(select '1 - 01','2 - 01' having (((<cache>(`test`.`t1`.`a1`) = '1 - 01') or isnull('1 - 01')) and ((<cache>(`test`.`t1`.`a2`) = '2 - 01') or isnull('2 - 01')) and <is_not_null_test>('1 - 01') and <is_not_null_test>('2 - 01')))))
|
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a1`,`test`.`t1`.`a2`>(<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),<exists>(select '1 - 01','2 - 01' having (((<cache>(`test`.`t1`.`a1`) = '1 - 01') or isnull(/*always not null*/ 1)) and ((<cache>(`test`.`t1`.`a2`) = '2 - 01') or isnull(/*always not null*/ 1)) and <is_not_null_test>('1 - 01') and <is_not_null_test>('2 - 01')))))
|
||||||
select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01' from dual);
|
select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01' from dual);
|
||||||
a1 a2
|
a1 a2
|
||||||
1 - 01 2 - 01
|
1 - 01 2 - 01
|
||||||
@@ -1925,7 +1925,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
|||||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
|
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
|
||||||
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00
|
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t2`.`c`) from `test`.`t2`) join `test`.`t1` where ((`test`.`t1`.`b` = 7) and (`test`.`t1`.`a` = `<subquery2>`.`MAX(c)`) and (<cache>(isnull(`<subquery2>`.`MAX(c)`)) or (`<subquery2>`.`MAX(c)` = 7)))
|
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t2`.`c`) from `test`.`t2`) join `test`.`t1` where ((`test`.`t1`.`b` = 7) and (`test`.`t1`.`a` = `<subquery2>`.`MAX(c)`) and (<cache>(isnull(/*always not null*/ 1)) or (`<subquery2>`.`MAX(c)` = 7)))
|
||||||
SELECT * FROM t1
|
SELECT * FROM t1
|
||||||
WHERE a IN (SELECT MAX(c) FROM t2) AND b=7 AND (a IS NULL OR a=b);
|
WHERE a IN (SELECT MAX(c) FROM t2) AND b=7 AND (a IS NULL OR a=b);
|
||||||
a b
|
a b
|
||||||
|
@@ -520,7 +520,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
|||||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a1`,`test`.`t1`.`a2`>(<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),<exists>(select '1 - 01','2 - 01' having (((<cache>(`test`.`t1`.`a1`) = '1 - 01') or isnull('1 - 01')) and ((<cache>(`test`.`t1`.`a2`) = '2 - 01') or isnull('2 - 01')) and <is_not_null_test>('1 - 01') and <is_not_null_test>('2 - 01')))))
|
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a1`,`test`.`t1`.`a2`>(<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),<exists>(select '1 - 01','2 - 01' having (((<cache>(`test`.`t1`.`a1`) = '1 - 01') or isnull(/*always not null*/ 1)) and ((<cache>(`test`.`t1`.`a2`) = '2 - 01') or isnull(/*always not null*/ 1)) and <is_not_null_test>('1 - 01') and <is_not_null_test>('2 - 01')))))
|
||||||
select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01');
|
select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01');
|
||||||
a1 a2
|
a1 a2
|
||||||
1 - 01 2 - 01
|
1 - 01 2 - 01
|
||||||
@@ -530,7 +530,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
|||||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
|
||||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a1`,`test`.`t1`.`a2`>(<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),<exists>(select '1 - 01','2 - 01' having (((<cache>(`test`.`t1`.`a1`) = '1 - 01') or isnull('1 - 01')) and ((<cache>(`test`.`t1`.`a2`) = '2 - 01') or isnull('2 - 01')) and <is_not_null_test>('1 - 01') and <is_not_null_test>('2 - 01')))))
|
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a1`,`test`.`t1`.`a2`>(<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),<exists>(select '1 - 01','2 - 01' having (((<cache>(`test`.`t1`.`a1`) = '1 - 01') or isnull(/*always not null*/ 1)) and ((<cache>(`test`.`t1`.`a2`) = '2 - 01') or isnull(/*always not null*/ 1)) and <is_not_null_test>('1 - 01') and <is_not_null_test>('2 - 01')))))
|
||||||
select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01' from dual);
|
select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01' from dual);
|
||||||
a1 a2
|
a1 a2
|
||||||
1 - 01 2 - 01
|
1 - 01 2 - 01
|
||||||
@@ -1963,7 +1963,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
|||||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
|
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
|
||||||
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00
|
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t2`.`c`) from `test`.`t2`) join `test`.`t1` where ((`test`.`t1`.`b` = 7) and (`test`.`t1`.`a` = `<subquery2>`.`MAX(c)`) and (<cache>(isnull(`<subquery2>`.`MAX(c)`)) or (`<subquery2>`.`MAX(c)` = 7)))
|
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t2`.`c`) from `test`.`t2`) join `test`.`t1` where ((`test`.`t1`.`b` = 7) and (`test`.`t1`.`a` = `<subquery2>`.`MAX(c)`) and (<cache>(isnull(/*always not null*/ 1)) or (`<subquery2>`.`MAX(c)` = 7)))
|
||||||
SELECT * FROM t1
|
SELECT * FROM t1
|
||||||
WHERE a IN (SELECT MAX(c) FROM t2) AND b=7 AND (a IS NULL OR a=b);
|
WHERE a IN (SELECT MAX(c) FROM t2) AND b=7 AND (a IS NULL OR a=b);
|
||||||
a b
|
a b
|
||||||
|
14
mysql-test/suite/rpl/r/rpl_row_spatial.result
Normal file
14
mysql-test/suite/rpl/r/rpl_row_spatial.result
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
include/master-slave.inc
|
||||||
|
[connection master]
|
||||||
|
CREATE TABLE t1 (g POINT NOT NULL, SPATIAL INDEX(g));
|
||||||
|
INSERT INTO t1 VALUES (ST_GEOMFROMTEXT('Point(1 1)'));
|
||||||
|
INSERT INTO t1 VALUES (ST_GEOMFROMTEXT('Point(2 1)'));
|
||||||
|
INSERT INTO t1 VALUES (ST_GEOMFROMTEXT('Point(1 2)'));
|
||||||
|
INSERT INTO t1 VALUES (ST_GEOMFROMTEXT('Point(2 2)'));
|
||||||
|
DELETE FROM t1 where MBREqual(g, ST_GEOMFROMTEXT('Point(1 2)'));
|
||||||
|
select count(*) from t1;
|
||||||
|
count(*)
|
||||||
|
3
|
||||||
|
DELETE FROM t1;
|
||||||
|
drop table t1;
|
||||||
|
include/rpl_end.inc
|
17
mysql-test/suite/rpl/t/rpl_row_spatial.test
Normal file
17
mysql-test/suite/rpl/t/rpl_row_spatial.test
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
--source include/have_binlog_format_row.inc
|
||||||
|
--source include/master-slave.inc
|
||||||
|
|
||||||
|
CREATE TABLE t1 (g POINT NOT NULL, SPATIAL INDEX(g));
|
||||||
|
INSERT INTO t1 VALUES (ST_GEOMFROMTEXT('Point(1 1)'));
|
||||||
|
INSERT INTO t1 VALUES (ST_GEOMFROMTEXT('Point(2 1)'));
|
||||||
|
INSERT INTO t1 VALUES (ST_GEOMFROMTEXT('Point(1 2)'));
|
||||||
|
INSERT INTO t1 VALUES (ST_GEOMFROMTEXT('Point(2 2)'));
|
||||||
|
DELETE FROM t1 where MBREqual(g, ST_GEOMFROMTEXT('Point(1 2)'));
|
||||||
|
|
||||||
|
--sync_slave_with_master
|
||||||
|
select count(*) from t1;
|
||||||
|
|
||||||
|
--connection master
|
||||||
|
DELETE FROM t1;
|
||||||
|
drop table t1;
|
||||||
|
--source include/rpl_end.inc
|
@@ -83,6 +83,22 @@ SELECT * FROM t2 LEFT JOIN v1 ON t2.d1=v1.d1 WHERE v1.d1 IS NULL;
|
|||||||
DROP VIEW v1;
|
DROP VIEW v1;
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
|
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-15475: Assertion `!table || (!table->read_set ||
|
||||||
|
--echo # bitmap_is_set(table->read_set, field_index))'
|
||||||
|
--echo # failed on EXPLAIN EXTENDED with constant table and view
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM;
|
||||||
|
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||||
|
INSERT INTO t1 VALUES (1);
|
||||||
|
EXPLAIN EXTENDED SELECT ISNULL(pk) FROM v1;
|
||||||
|
EXPLAIN EXTENDED SELECT IFNULL(pk,0) FROM v1;
|
||||||
|
# Cleanup
|
||||||
|
DROP VIEW v1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # End of 5.5 tests
|
--echo # End of 5.5 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
@@ -1701,6 +1701,10 @@ DO TO_DAYS(SEC_TO_TIME(TIME(CEILING(UUID()))));
|
|||||||
DO TO_DAYS(SEC_TO_TIME(MAKEDATE('',RAND(~('')))));
|
DO TO_DAYS(SEC_TO_TIME(MAKEDATE('',RAND(~('')))));
|
||||||
SELECT SEC_TO_TIME(MAKEDATE(0,RAND(~0)));
|
SELECT SEC_TO_TIME(MAKEDATE(0,RAND(~0)));
|
||||||
|
|
||||||
|
#
|
||||||
|
# MDEV-16810 AddressSanitizer: stack-buffer-overflow in int10_to_str
|
||||||
|
#
|
||||||
|
SELECT PERIOD_DIFF(2018, AES_ENCRYPT('Rae Bareli', 'Rae Bareli'));
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # End of 5.5 tests
|
--echo # End of 5.5 tests
|
||||||
|
@@ -7,3 +7,32 @@ set @optimizer_switch_for_subselect_extra_test='semijoin=off,firstmatch=off,loo
|
|||||||
set optimizer_switch= @subselect_extra_no_sj_tmp;
|
set optimizer_switch= @subselect_extra_no_sj_tmp;
|
||||||
|
|
||||||
set @optimizer_switch_for_subselect_extra_test=null;
|
set @optimizer_switch_for_subselect_extra_test=null;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-6439: Server crashes in Explain_union::print_explain with explain in slow log, tis620 charset
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
## Using a separate client connection is easier than restoring state
|
||||||
|
connect(con1,localhost,root,,);
|
||||||
|
|
||||||
|
SET NAMES tis620;
|
||||||
|
set @tmp= @@global.slow_query_log;
|
||||||
|
SET GLOBAL slow_query_log = 1;
|
||||||
|
SET long_query_time = 0.000001;
|
||||||
|
SET log_slow_verbosity = 'explain';
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a VARCHAR(3)) ENGINE=MyISAM;
|
||||||
|
SELECT * FROM t1 WHERE a >= ANY ( SELECT 'foo');
|
||||||
|
--error ER_CANT_AGGREGATE_2COLLATIONS
|
||||||
|
SELECT * FROM t1 WHERE a >= ANY ( SELECT 'foo' UNION SELECT 'bar' );
|
||||||
|
|
||||||
|
create table t2 (b int);
|
||||||
|
insert into t2 values (1),(2),(3);
|
||||||
|
|
||||||
|
--error ER_CANT_AGGREGATE_2COLLATIONS
|
||||||
|
SELECT * FROM t1 WHERE a >= ANY ( SELECT 'foo' FROM t2);
|
||||||
|
|
||||||
|
drop table t1,t2;
|
||||||
|
SET GLOBAL slow_query_log=@tmp;
|
||||||
|
disconnect con1;
|
||||||
|
connection default;
|
||||||
|
@@ -6813,7 +6813,7 @@ Item *Item_field::update_value_transformer(THD *thd, uchar *select_arg)
|
|||||||
void Item_field::print(String *str, enum_query_type query_type)
|
void Item_field::print(String *str, enum_query_type query_type)
|
||||||
{
|
{
|
||||||
if (field && field->table->const_table &&
|
if (field && field->table->const_table &&
|
||||||
!(query_type & QT_NO_DATA_EXPANSION))
|
!(query_type & (QT_NO_DATA_EXPANSION | QT_VIEW_INTERNAL)))
|
||||||
{
|
{
|
||||||
print_value(str);
|
print_value(str);
|
||||||
return;
|
return;
|
||||||
|
@@ -5120,6 +5120,19 @@ bool Item_func_null_predicate::count_sargable_conds(uchar *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Item_func_isnull::print(String *str, enum_query_type query_type)
|
||||||
|
{
|
||||||
|
str->append(func_name());
|
||||||
|
str->append('(');
|
||||||
|
if (const_item() && !args[0]->maybe_null &&
|
||||||
|
!(query_type & (QT_NO_DATA_EXPANSION | QT_VIEW_INTERNAL)))
|
||||||
|
str->append("/*always not null*/ 1");
|
||||||
|
else
|
||||||
|
args[0]->print(str, query_type);
|
||||||
|
str->append(')');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
longlong Item_func_isnull::val_int()
|
longlong Item_func_isnull::val_int()
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(fixed == 1);
|
DBUG_ASSERT(fixed == 1);
|
||||||
|
@@ -1720,6 +1720,7 @@ public:
|
|||||||
}
|
}
|
||||||
COND *remove_eq_conds(THD *thd, Item::cond_result *cond_value,
|
COND *remove_eq_conds(THD *thd, Item::cond_result *cond_value,
|
||||||
bool top_level);
|
bool top_level);
|
||||||
|
virtual void print(String *str, enum_query_type query_type);
|
||||||
table_map not_null_tables() const { return 0; }
|
table_map not_null_tables() const { return 0; }
|
||||||
Item *neg_transformer(THD *thd);
|
Item *neg_transformer(THD *thd);
|
||||||
};
|
};
|
||||||
|
@@ -148,7 +148,8 @@ void key_copy(uchar *to_key, uchar *from_record, KEY *key_info,
|
|||||||
{
|
{
|
||||||
key_length-= HA_KEY_BLOB_LENGTH;
|
key_length-= HA_KEY_BLOB_LENGTH;
|
||||||
length= min<uint>(key_length, key_part->length);
|
length= min<uint>(key_length, key_part->length);
|
||||||
uint bytes= key_part->field->get_key_image(to_key, length, Field::itRAW);
|
uint bytes= key_part->field->get_key_image(to_key, length,
|
||||||
|
key_info->flags & HA_SPATIAL ? Field::itMBR : Field::itRAW);
|
||||||
if (with_zerofill && bytes < length)
|
if (with_zerofill && bytes < length)
|
||||||
bzero((char*) to_key + bytes, length - bytes);
|
bzero((char*) to_key + bytes, length - bytes);
|
||||||
to_key+= HA_KEY_BLOB_LENGTH;
|
to_key+= HA_KEY_BLOB_LENGTH;
|
||||||
|
@@ -1413,9 +1413,9 @@ static NTService Service; ///< Service object for WinNT
|
|||||||
#endif /* __WIN__ */
|
#endif /* __WIN__ */
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#include <sddl.h> /* ConvertStringSecurityDescriptorToSecurityDescriptor */
|
||||||
static char pipe_name[512];
|
static char pipe_name[512];
|
||||||
static SECURITY_ATTRIBUTES saPipeSecurity;
|
static SECURITY_ATTRIBUTES saPipeSecurity;
|
||||||
static SECURITY_DESCRIPTOR sdPipeDescriptor;
|
|
||||||
static HANDLE hPipe = INVALID_HANDLE_VALUE;
|
static HANDLE hPipe = INVALID_HANDLE_VALUE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2612,21 +2612,20 @@ static void network_init(void)
|
|||||||
|
|
||||||
strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\.\\pipe\\",
|
strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\.\\pipe\\",
|
||||||
mysqld_unix_port, NullS);
|
mysqld_unix_port, NullS);
|
||||||
bzero((char*) &saPipeSecurity, sizeof(saPipeSecurity));
|
/*
|
||||||
bzero((char*) &sdPipeDescriptor, sizeof(sdPipeDescriptor));
|
Create a security descriptor for pipe.
|
||||||
if (!InitializeSecurityDescriptor(&sdPipeDescriptor,
|
- Use low integrity level, so that it is possible to connect
|
||||||
SECURITY_DESCRIPTOR_REVISION))
|
from any process.
|
||||||
|
- Give Everyone read/write access to pipe.
|
||||||
|
*/
|
||||||
|
if (!ConvertStringSecurityDescriptorToSecurityDescriptor(
|
||||||
|
"S:(ML;; NW;;; LW) D:(A;; FRFW;;; WD)",
|
||||||
|
SDDL_REVISION_1, &saPipeSecurity.lpSecurityDescriptor, NULL))
|
||||||
{
|
{
|
||||||
sql_perror("Can't start server : Initialize security descriptor");
|
sql_perror("Can't start server : Initialize security descriptor");
|
||||||
unireg_abort(1);
|
unireg_abort(1);
|
||||||
}
|
}
|
||||||
if (!SetSecurityDescriptorDacl(&sdPipeDescriptor, TRUE, NULL, FALSE))
|
|
||||||
{
|
|
||||||
sql_perror("Can't start server : Set security descriptor");
|
|
||||||
unireg_abort(1);
|
|
||||||
}
|
|
||||||
saPipeSecurity.nLength = sizeof(SECURITY_ATTRIBUTES);
|
saPipeSecurity.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||||
saPipeSecurity.lpSecurityDescriptor = &sdPipeDescriptor;
|
|
||||||
saPipeSecurity.bInheritHandle = FALSE;
|
saPipeSecurity.bInheritHandle = FALSE;
|
||||||
if ((hPipe= CreateNamedPipe(pipe_name,
|
if ((hPipe= CreateNamedPipe(pipe_name,
|
||||||
PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | FILE_FLAG_FIRST_PIPE_INSTANCE,
|
PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | FILE_FLAG_FIRST_PIPE_INSTANCE,
|
||||||
@@ -6826,6 +6825,7 @@ pthread_handler_t handle_connections_namedpipes(void *arg)
|
|||||||
create_new_thread(thd);
|
create_new_thread(thd);
|
||||||
set_current_thd(0);
|
set_current_thd(0);
|
||||||
}
|
}
|
||||||
|
LocalFree(saPipeSecurity.lpSecurityDescriptor);
|
||||||
CloseHandle(connectOverlapped.hEvent);
|
CloseHandle(connectOverlapped.hEvent);
|
||||||
DBUG_LEAVE;
|
DBUG_LEAVE;
|
||||||
decrement_handler_count();
|
decrement_handler_count();
|
||||||
|
@@ -654,7 +654,7 @@ uchar *net_store_data(uchar *to, const uchar *from, size_t length)
|
|||||||
|
|
||||||
uchar *net_store_data(uchar *to,int32 from)
|
uchar *net_store_data(uchar *to,int32 from)
|
||||||
{
|
{
|
||||||
char buff[20];
|
char buff[22];
|
||||||
uint length=(uint) (int10_to_str(from,buff,10)-buff);
|
uint length=(uint) (int10_to_str(from,buff,10)-buff);
|
||||||
to=net_store_length_fast(to,length);
|
to=net_store_length_fast(to,length);
|
||||||
memcpy(to,buff,length);
|
memcpy(to,buff,length);
|
||||||
@@ -1071,7 +1071,7 @@ bool Protocol_text::store_tiny(longlong from)
|
|||||||
DBUG_ASSERT(field_types == 0 || field_types[field_pos] == MYSQL_TYPE_TINY);
|
DBUG_ASSERT(field_types == 0 || field_types[field_pos] == MYSQL_TYPE_TINY);
|
||||||
field_pos++;
|
field_pos++;
|
||||||
#endif
|
#endif
|
||||||
char buff[20];
|
char buff[22];
|
||||||
return net_store_data((uchar*) buff,
|
return net_store_data((uchar*) buff,
|
||||||
(size_t) (int10_to_str((int) from, buff, -10) - buff));
|
(size_t) (int10_to_str((int) from, buff, -10) - buff));
|
||||||
}
|
}
|
||||||
@@ -1085,7 +1085,7 @@ bool Protocol_text::store_short(longlong from)
|
|||||||
field_types[field_pos] == MYSQL_TYPE_SHORT);
|
field_types[field_pos] == MYSQL_TYPE_SHORT);
|
||||||
field_pos++;
|
field_pos++;
|
||||||
#endif
|
#endif
|
||||||
char buff[20];
|
char buff[22];
|
||||||
return net_store_data((uchar*) buff,
|
return net_store_data((uchar*) buff,
|
||||||
(size_t) (int10_to_str((int) from, buff, -10) -
|
(size_t) (int10_to_str((int) from, buff, -10) -
|
||||||
buff));
|
buff));
|
||||||
@@ -1100,7 +1100,7 @@ bool Protocol_text::store_long(longlong from)
|
|||||||
field_types[field_pos] == MYSQL_TYPE_LONG);
|
field_types[field_pos] == MYSQL_TYPE_LONG);
|
||||||
field_pos++;
|
field_pos++;
|
||||||
#endif
|
#endif
|
||||||
char buff[20];
|
char buff[22];
|
||||||
return net_store_data((uchar*) buff,
|
return net_store_data((uchar*) buff,
|
||||||
(size_t) (int10_to_str((long int)from, buff,
|
(size_t) (int10_to_str((long int)from, buff,
|
||||||
(from <0)?-10:10)-buff));
|
(from <0)?-10:10)-buff));
|
||||||
|
@@ -309,10 +309,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
inline void swap(base_list &rhs)
|
inline void swap(base_list &rhs)
|
||||||
{
|
{
|
||||||
|
list_node **rhs_last=rhs.last;
|
||||||
swap_variables(list_node *, first, rhs.first);
|
swap_variables(list_node *, first, rhs.first);
|
||||||
swap_variables(list_node **, last, rhs.last);
|
|
||||||
swap_variables(uint, elements, rhs.elements);
|
swap_variables(uint, elements, rhs.elements);
|
||||||
|
rhs.last= last == &first ? &rhs.first : last;
|
||||||
|
last = rhs_last == &rhs.first ? &first : rhs_last;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline list_node* last_node() { return *last; }
|
inline list_node* last_node() { return *last; }
|
||||||
inline list_node* first_node() { return first;}
|
inline list_node* first_node() { return first;}
|
||||||
inline void *head() { return first->info; }
|
inline void *head() { return first->info; }
|
||||||
|
@@ -2389,7 +2389,7 @@ static int show_create_view(THD *thd, TABLE_LIST *table, String *buff)
|
|||||||
We can't just use table->query, because our SQL_MODE may trigger
|
We can't just use table->query, because our SQL_MODE may trigger
|
||||||
a different syntax, like when ANSI_QUOTES is defined.
|
a different syntax, like when ANSI_QUOTES is defined.
|
||||||
*/
|
*/
|
||||||
table->view->unit.print(buff, enum_query_type(QT_ORDINARY |
|
table->view->unit.print(buff, enum_query_type(QT_VIEW_INTERNAL |
|
||||||
QT_ITEM_ORIGINAL_FUNC_NULLIF));
|
QT_ITEM_ORIGINAL_FUNC_NULLIF));
|
||||||
|
|
||||||
if (table->with_check != VIEW_CHECK_NONE)
|
if (table->with_check != VIEW_CHECK_NONE)
|
||||||
|
@@ -190,7 +190,7 @@ bool get_date_from_daynr(long daynr,uint *ret_year,uint *ret_month,
|
|||||||
ulong convert_period_to_month(ulong period)
|
ulong convert_period_to_month(ulong period)
|
||||||
{
|
{
|
||||||
ulong a,b;
|
ulong a,b;
|
||||||
if (period == 0)
|
if (period == 0 || period > 999912)
|
||||||
return 0L;
|
return 0L;
|
||||||
if ((a=period/100) < YY_PART_YEAR)
|
if ((a=period/100) < YY_PART_YEAR)
|
||||||
a+=2000;
|
a+=2000;
|
||||||
|
Reference in New Issue
Block a user