1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge tag '11.4' into 11.6

MariaDB 11.4.4 release
This commit is contained in:
Oleksandr Byelkin
2024-11-08 07:17:00 +01:00
743 changed files with 10281 additions and 4508 deletions

View File

@ -727,31 +727,31 @@ b c a c b y
1 10 2 3 1 2
1 3 2 3 1 2
select * from t1 natural join (t3 cross join t4);
ERROR 23000: Column 'c' in from clause is ambiguous
ERROR 23000: Column 'c' in FROM is ambiguous
select * from (t3 cross join t4) natural join t1;
ERROR 23000: Column 'c' in from clause is ambiguous
ERROR 23000: Column 'c' in FROM is ambiguous
select * from t1 join (t2, t3) using (b);
ERROR 23000: Column 'b' in from clause is ambiguous
ERROR 23000: Column 'b' in FROM is ambiguous
select * from ((t1 natural join t2), (t3 natural join t4)) natural join t6;
ERROR 23000: Column 'c' in from clause is ambiguous
ERROR 23000: Column 'c' in FROM is ambiguous
select * from ((t1 natural join t2), (t3 natural join t4)) natural join t6;
ERROR 23000: Column 'c' in from clause is ambiguous
ERROR 23000: Column 'c' in FROM is ambiguous
select * from t6 natural join ((t1 natural join t2), (t3 natural join t4));
ERROR 23000: Column 'c' in from clause is ambiguous
ERROR 23000: Column 'c' in FROM is ambiguous
select * from (t1 join t2 on t1.b=t2.b) natural join (t3 natural join t4);
ERROR 23000: Column 'b' in from clause is ambiguous
ERROR 23000: Column 'b' in FROM is ambiguous
select * from (t3 natural join t4) natural join (t1 join t2 on t1.b=t2.b);
ERROR 23000: Column 'b' in from clause is ambiguous
ERROR 23000: Column 'b' in FROM is ambiguous
select * from (t3 join (t4 natural join t5) on (b < z))
natural join
(t1 natural join t2);
ERROR 23000: Column 'c' in from clause is ambiguous
ERROR 23000: Column 'c' in FROM is ambiguous
select * from (t1 natural join t2) natural join (t3 join (t4 natural join t5) on (b < z));
ERROR 23000: Column 'c' in from clause is ambiguous
ERROR 23000: Column 'c' in FROM is ambiguous
select t1.b from v1a;
ERROR 42S22: Unknown column 't1.b' in 'field list'
ERROR 42S22: Unknown column 't1.b' in 'SELECT'
select * from v1a join v1b on t1.b = t2.b;
ERROR 42S22: Unknown column 't1.b' in 'on clause'
ERROR 42S22: Unknown column 't1.b' in 'ON'
select
statistics.TABLE_NAME, statistics.COLUMN_NAME, statistics.TABLE_CATALOG, statistics.TABLE_SCHEMA, statistics.NON_UNIQUE, statistics.INDEX_SCHEMA, statistics.INDEX_NAME, statistics.SEQ_IN_INDEX, statistics.COLLATION, statistics.SUB_PART, statistics.PACKED, statistics.NULLABLE, statistics.INDEX_TYPE, statistics.COMMENT,
columns.TABLE_CATALOG, columns.TABLE_SCHEMA, columns.COLUMN_DEFAULT, columns.IS_NULLABLE, columns.DATA_TYPE, columns.CHARACTER_MAXIMUM_LENGTH, columns.CHARACTER_OCTET_LENGTH, columns.NUMERIC_PRECISION, columns.NUMERIC_SCALE, columns.CHARACTER_SET_NAME, columns.COLLATION_NAME, columns.COLUMN_TYPE, columns.COLUMN_KEY, columns.EXTRA, columns.COLUMN_COMMENT
@ -1531,12 +1531,12 @@ SET optimizer_switch=@save_optimizer_switch;
CREATE TABLE t (i INT);
CREATE PROCEDURE p() SELECT t1.f FROM t AS t1 JOIN t AS t2 USING (f);
CALL p;
ERROR 42S22: Unknown column 'f' in 'from clause'
ERROR 42S22: Unknown column 'f' in 'FROM'
CALL p;
ERROR 42S22: Unknown column 'f' in 'from clause'
ERROR 42S22: Unknown column 'f' in 'FROM'
FLUSH TABLES;
CALL p;
ERROR 42S22: Unknown column 'f' in 'from clause'
ERROR 42S22: Unknown column 'f' in 'FROM'
DROP TABLE t;
CREATE TABLE t (f INT);
CALL p;
@ -1544,9 +1544,9 @@ f
DROP TABLE t;
CREATE TABLE t (i INT);
CALL p;
ERROR 42S22: Unknown column 'f' in 'from clause'
ERROR 42S22: Unknown column 'f' in 'FROM'
CALL p;
ERROR 42S22: Unknown column 'f' in 'from clause'
ERROR 42S22: Unknown column 'f' in 'FROM'
DROP PROCEDURE p;
DROP TABLE t;
CREATE TABLE t1 (a INT, b INT);
@ -1557,9 +1557,9 @@ CREATE TABLE t5 (a INT, c INT);
CREATE PROCEDURE p1() SELECT c FROM t1 JOIN (t2 LEFT JOIN t3 USING (a) LEFT JOIN t4 USING (a)
LEFT JOIN t5 USING (a)) USING (a);
CALL p1;
ERROR 23000: Column 'c' in field list is ambiguous
ERROR 23000: Column 'c' in SELECT is ambiguous
CALL p1;
ERROR 23000: Column 'c' in field list is ambiguous
ERROR 23000: Column 'c' in SELECT is ambiguous
DROP PROCEDURE p1;
DROP TABLE t1,t2,t3,t4,t5;
#
@ -3576,6 +3576,38 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE seq ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
drop table t1,t2;
#
# MDEV-35180: ref_to_range rewrite causes poor query plan
#
create table t1 (a int);
insert into t1 select seq from seq_1_to_100;
create table t2 (
kp1 int,
kp2 int,
filler char(100),
key(kp1, kp2)
);
insert into t2
select
seq, seq,
'filler-data'
from seq_1_to_10000;
analyze table t1,t2;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status Table is already up to date
# For t2, this must use type=ref, key_len=5 (not type=range, key_len=10)
explain
select *
from t1, t2
where
t2.kp1=t1.a and t2.kp1<=100 and t2.kp2<=20;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where
1 SIMPLE t2 ref kp1 kp1 5 test.t1.a 1 Using index condition
drop table t1,t2;
#
# MDEV-30256 Wrong result (missing rows) upon join with empty table
#
CREATE TABLE t1 (a INT);