mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge bk@192.168.21.1:mysql-5.0
into mysql.com:/home/hf/work/mrg/mysql-5.0-opt mysql-test/r/order_by.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/t/order_by.test: Auto merged mysql-test/t/sp.test: Auto merged sql/item.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_func.cc: Auto merged sql/mysql_priv.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_update.cc: Auto merged mysql-test/r/func_str.result: merging mysql-test/r/sp.result: merging mysql-test/r/view.result: merging mysql-test/t/func_str.test: merging mysql-test/t/view.test: merging
This commit is contained in:
@ -51,4 +51,19 @@ set names latin1;
|
||||
select 3 into @v1;
|
||||
explain select 3 into @v1;
|
||||
|
||||
#
|
||||
# Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were
|
||||
# optimized away.
|
||||
#
|
||||
create table t1(f1 int, f2 int);
|
||||
insert into t1 values (1,1);
|
||||
create view v1 as select * from t1 where f1=1;
|
||||
explain extended select * from v1 where f2=1;
|
||||
explain extended select * from t1 where 0;
|
||||
explain extended select * from t1 where 1;
|
||||
explain extended select * from t1 having 0;
|
||||
explain extended select * from t1 having 1;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
# End of 5.0 tests.
|
||||
|
@ -298,4 +298,66 @@ SELECT STRAIGHT_JOIN
|
||||
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
|
||||
#
|
||||
# BUG#19342: IN works incorrectly for BIGINT UNSIGNED values
|
||||
#
|
||||
CREATE TABLE t1(a BIGINT UNSIGNED);
|
||||
INSERT INTO t1 VALUES (0xFFFFFFFFFFFFFFFF);
|
||||
|
||||
SELECT * FROM t1 WHERE a=-1 OR a=-2 ;
|
||||
SELECT * FROM t1 WHERE a IN (-1, -2);
|
||||
|
||||
CREATE TABLE t2 (a BIGINT UNSIGNED);
|
||||
insert into t2 values(13491727406643098568),
|
||||
(0x7fffffefffffffff),
|
||||
(0x7ffffffeffffffff),
|
||||
(0x7fffffffefffffff),
|
||||
(0x7ffffffffeffffff),
|
||||
(0x7fffffffffefffff),
|
||||
(0x7ffffffffffeffff),
|
||||
(0x7fffffffffffefff),
|
||||
(0x7ffffffffffffeff),
|
||||
(0x7fffffffffffffef),
|
||||
(0x7ffffffffffffffe),
|
||||
(0x7fffffffffffffff),
|
||||
(0x8000000000000000),
|
||||
(0x8000000000000001),
|
||||
(0x8000000000000002),
|
||||
(0x8000000000000300),
|
||||
(0x8000000000000400),
|
||||
(0x8000000000000401),
|
||||
(0x8000000000004001),
|
||||
(0x8000000000040001),
|
||||
(0x8000000000400001),
|
||||
(0x8000000004000001),
|
||||
(0x8000000040000001),
|
||||
(0x8000000400000001),
|
||||
(0x8000004000000001),
|
||||
(0x8000040000000001);
|
||||
|
||||
SELECT HEX(a) FROM t2 WHERE a IN (0xBB3C3E98175D33C8, 42);
|
||||
|
||||
SELECT HEX(a) FROM t2 WHERE a IN
|
||||
(0xBB3C3E98175D33C8,
|
||||
0x7fffffffffffffff,
|
||||
0x8000000000000000,
|
||||
0x8000000000000400,
|
||||
0x8000000000000401,
|
||||
42);
|
||||
|
||||
SELECT HEX(a) FROM t2 WHERE a IN (0x7fffffffffffffff,0x8000000000000001);
|
||||
SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff);
|
||||
SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff,'abc');
|
||||
|
||||
CREATE TABLE t3 (a BIGINT UNSIGNED);
|
||||
INSERT INTO t3 VALUES (9223372036854775551);
|
||||
|
||||
SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42);
|
||||
|
||||
CREATE TABLE t4 (a DATE);
|
||||
INSERT INTO t4 VALUES ('1972-02-06'), ('1972-07-29');
|
||||
SELECT * FROM t4 WHERE a IN ('1972-02-06','19772-07-29');
|
||||
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -1030,4 +1030,10 @@ SELECT REPEAT( '#', tire ) AS A,
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #26537: UNHEX() IS NULL comparison fails
|
||||
#
|
||||
SELECT UNHEX('G');
|
||||
SELECT UNHEX('G') IS NULL;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -669,3 +669,11 @@ SELECT t2.b FROM t1 LEFT JOIN (t2, t3 LEFT JOIN t4 ON t3.a=t4.a)
|
||||
ON (t1.a=t2.a AND t1.b=t3.b) order by t2.b;
|
||||
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
|
||||
#
|
||||
# Bug#25376: Incomplete setup of ORDER BY clause results in a wrong result.
|
||||
#
|
||||
create table t1 (a int, b int, c int);
|
||||
insert into t1 values (1,2,3), (9,8,3), (19,4,3), (1,4,9);
|
||||
select a,(sum(b)/sum(c)) as ratio from t1 group by a order by sum(b)/sum(c) asc;
|
||||
drop table t1;
|
||||
|
@ -6738,6 +6738,21 @@ select func_8407_b()|
|
||||
drop function func_8407_a|
|
||||
drop function func_8407_b|
|
||||
|
||||
#
|
||||
# Bug#25373: Stored functions wasn't compared correctly which leads to a wrong
|
||||
# result.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP FUNCTION IF EXISTS bug25373|
|
||||
--disable_warnings
|
||||
CREATE FUNCTION bug25373(p1 INTEGER) RETURNS INTEGER
|
||||
LANGUAGE SQL DETERMINISTIC
|
||||
RETURN p1;|
|
||||
CREATE TABLE t3 (f1 INT, f2 FLOAT)|
|
||||
INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)|
|
||||
SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP|
|
||||
DROP FUNCTION bug25373|
|
||||
DROP TABLE t3|
|
||||
#
|
||||
# NOTE: The delimiter is `|`, and not `;`. It is changed to `;`
|
||||
# at the end of the file!
|
||||
|
@ -306,6 +306,14 @@ create table t1(f1 int, `*f2` int);
|
||||
insert into t1 values (1,1);
|
||||
update t1 set `*f2`=1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug#25126: Wrongly resolved field leads to a crash
|
||||
#
|
||||
create table t1(f1 int);
|
||||
--error 1054
|
||||
update t1 set f2=1 order by f2;
|
||||
drop table t1;
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
|
@ -3163,4 +3163,44 @@ drop view view_24532_a;
|
||||
drop view view_24532_b;
|
||||
drop table table_24532;
|
||||
|
||||
#
|
||||
# Bug#26560: view using subquery with a reference to an outer alias
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
lid int NOT NULL PRIMARY KEY,
|
||||
name char(10) NOT NULL
|
||||
);
|
||||
INSERT INTO t1 (lid, name) VALUES
|
||||
(1, 'YES'), (2, 'NO');
|
||||
|
||||
CREATE TABLE t2 (
|
||||
id int NOT NULL PRIMARY KEY,
|
||||
gid int NOT NULL,
|
||||
lid int NOT NULL,
|
||||
dt date
|
||||
);
|
||||
INSERT INTO t2 (id, gid, lid, dt) VALUES
|
||||
(1, 1, 1, '2007-01-01'),(2, 1, 2, '2007-01-02'),
|
||||
(3, 2, 2, '2007-02-01'),(4, 2, 1, '2007-02-02');
|
||||
|
||||
SELECT DISTINCT t2.gid AS lgid,
|
||||
(SELECT t1.name FROM t1, t2
|
||||
WHERE t1.lid = t2.lid AND t2.gid = lgid
|
||||
ORDER BY t2.dt DESC LIMIT 1
|
||||
) as clid
|
||||
FROM t2;
|
||||
|
||||
CREATE VIEW v1 AS
|
||||
SELECT DISTINCT t2.gid AS lgid,
|
||||
(SELECT t1.name FROM t1, t2
|
||||
WHERE t1.lid = t2.lid AND t2.gid = lgid
|
||||
ORDER BY t2.dt DESC LIMIT 1
|
||||
) as clid
|
||||
FROM t2;
|
||||
SELECT * FROM v1;
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP table t1,t2;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
Reference in New Issue
Block a user