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

merge 5.0-bugteam -> bug 38693-5.0-bugteam

This commit is contained in:
Georgi Kodinov
2008-10-20 16:26:07 +03:00
15 changed files with 230 additions and 13 deletions

View File

@ -111,3 +111,6 @@ set @a=-14632475938453979136;
execute s using @a, @a;
ERROR HY000: Incorrect arguments to EXECUTE
End of 5.0 tests
select 1 as a limit 4294967296,10;
a
End of 5.1 tests

View File

@ -1076,3 +1076,19 @@ set session max_sort_length= 2180;
select * from t1 order by b;
ERROR HY001: Out of sort memory; increase server sort buffer size
drop table t1;
#
# Bug #39844: Query Crash Mysql Server 5.0.67
#
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT PRIMARY KEY, b INT);
CREATE TABLE t3 (c INT);
INSERT INTO t1 (a) VALUES (1), (2);
INSERT INTO t2 (a,b) VALUES (1,2), (2,3);
INSERT INTO t3 (c) VALUES (1), (2);
SELECT
(SELECT t1.a FROM t1, t2 WHERE t1.a = t2.b AND t2.a = t3.c ORDER BY t1.a)
FROM t3;
(SELECT t1.a FROM t1, t2 WHERE t1.a = t2.b AND t2.a = t3.c ORDER BY t1.a)
2
NULL
DROP TABLE t1, t2, t3;

View File

@ -0,0 +1,64 @@
#
# Bug#24289 Status Variable "Questions" gets wrong values with Stored Routines
#
FLUSH STATUS;
DROP TABLE IF EXISTS t1,t2;
DROP PROCEDURE IF EXISTS p1;
DROP FUNCTION IF EXISTS f1;
CREATE FUNCTION f1() RETURNS INTEGER
BEGIN
DECLARE foo INTEGER;
DECLARE bar INTEGER;
SET foo=1;
SET bar=2;
RETURN foo;
END $$
CREATE PROCEDURE p1()
BEGIN
SELECT 1;
END $$
CREATE TABLE t1 (c1 INT);
CREATE TABLE t2 (c1 INT);
INSERT INTO t1 VALUES (1);
Assert Questions == 9
SHOW STATUS LIKE 'Questions';
Variable_name Value
Questions 9
SELECT f1();
f1()
1
Assert Questions == 11
SHOW STATUS LIKE 'Questions';
Variable_name Value
Questions 11
CALL p1();
1
1
Assert Questions == 13
SHOW STATUS LIKE 'Questions';
Variable_name Value
Questions 13
SELECT 1;
1
1
Assert Questions == 15
SHOW STATUS LIKE 'Questions';
Variable_name Value
Questions 15
FLUSH STATUS;
SELECT 1;
1
1
Assert Questions == 16
SHOW STATUS LIKE 'Questions';
Variable_name Value
Questions 16
Global status updated; Assert diff == 5
FLUSH STATUS;
SELECT 5;
5
5
DROP TABLE t1,t2;
DROP PROCEDURE p1;
DROP FUNCTION f1;
End of 6.0 tests

View File

@ -18,4 +18,5 @@ EXPLAIN SELECT * FROM t1 WHERE b = (SELECT max(2));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
DROP TABLE t1;
End of 5.0 tests.

View File

@ -95,3 +95,11 @@ set @a=-14632475938453979136;
execute s using @a, @a;
--echo End of 5.0 tests
#
# Bug#37075: offset of limit clause might be truncated to 0 on 32-bits server w/o big tables
#
select 1 as a limit 4294967296,10;
--echo End of 5.1 tests

View File

@ -738,3 +738,21 @@ set session max_sort_length= 2180;
select * from t1 order by b;
drop table t1;
--echo #
--echo # Bug #39844: Query Crash Mysql Server 5.0.67
--echo #
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT PRIMARY KEY, b INT);
CREATE TABLE t3 (c INT);
INSERT INTO t1 (a) VALUES (1), (2);
INSERT INTO t2 (a,b) VALUES (1,2), (2,3);
INSERT INTO t3 (c) VALUES (1), (2);
SELECT
(SELECT t1.a FROM t1, t2 WHERE t1.a = t2.b AND t2.a = t3.c ORDER BY t1.a)
FROM t3;
DROP TABLE t1, t2, t3;

64
mysql-test/t/status2.test Normal file
View File

@ -0,0 +1,64 @@
--echo #
--echo # Bug#24289 Status Variable "Questions" gets wrong values with Stored Routines
--echo #
# The bogus connection below is needed to make the gobal statement count
# deterministic when the test is run for the first time.
connect (con1,localhost,root,,);
connection con1;
connection default;
disconnect con1;
FLUSH STATUS;
--disable_warnings
DROP TABLE IF EXISTS t1,t2;
DROP PROCEDURE IF EXISTS p1;
DROP FUNCTION IF EXISTS f1;
--enable_warnings
DELIMITER $$;
CREATE FUNCTION f1() RETURNS INTEGER
BEGIN
DECLARE foo INTEGER;
DECLARE bar INTEGER;
SET foo=1;
SET bar=2;
RETURN foo;
END $$
CREATE PROCEDURE p1()
BEGIN
SELECT 1;
END $$
DELIMITER ;$$
CREATE TABLE t1 (c1 INT);
CREATE TABLE t2 (c1 INT);
INSERT INTO t1 VALUES (1);
--echo Assert Questions == 9
SHOW STATUS LIKE 'Questions';
SELECT f1();
--echo Assert Questions == 11
SHOW STATUS LIKE 'Questions';
CALL p1();
--echo Assert Questions == 13
SHOW STATUS LIKE 'Questions';
SELECT 1;
--echo Assert Questions == 15
SHOW STATUS LIKE 'Questions';
connect (con1,localhost,root,,);
connection con1;
FLUSH STATUS;
let $org_questions= `SHOW GLOBAL STATUS LIKE 'questions'`;
SELECT 1;
connection default;
disconnect con1;
--echo Assert Questions == 16
SHOW STATUS LIKE 'Questions';
--echo Global status updated; Assert diff == 5
FLUSH STATUS;
let $new_questions= `SHOW GLOBAL STATUS LIKE 'questions'`;
--disable_log
let $diff= `SELECT SUBSTRING('$new_questions',10)-SUBSTRING('$org_questions',10)`;
--enable_log
eval SELECT $diff;
DROP TABLE t1,t2;
DROP PROCEDURE p1;
DROP FUNCTION f1;
--echo End of 6.0 tests

1
mysql-test/t/windows.test Normal file → Executable file
View File

@ -33,5 +33,6 @@ drop table t1;
#
CREATE TABLE t1 (a int, b int); INSERT INTO t1 VALUES (1,1);
EXPLAIN SELECT * FROM t1 WHERE b = (SELECT max(2));
DROP TABLE t1;
--echo End of 5.0 tests.