Commit 14959270 authored by unknown's avatar unknown
Browse files

Merge pgalbraith@bk-internal.mysql.com:/home/bk/mysql-5.0

into  radha.local:/Users/patg/mysql-build/mysql-5.0.bug9056

parents c4577707 d3837c79
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
drop table if exists t1,t2;
show tables;
Tables_in_mysql
columns_priv
@@ -71,3 +72,8 @@ show tables;
Tables_in_test
delete from mysql.user where user=_binary"test";
flush privileges;
create table t1 (id integer not null auto_increment primary key);
create temporary table t2(id integer not null auto_increment primary key);
set @id := 1;
delete from t1 where id like @id;
drop table t1;
+9 −0
Original line number Diff line number Diff line
@@ -766,6 +766,15 @@ n
Warnings:
Warning	1052	Column 'n' in group statement is ambiguous
DROP TABLE t1;
create table t1(f1 varchar(5) key);
insert into t1 values (1),(2);
select sql_buffer_result max(f1) is null from t1;
max(f1) is null
0
select sql_buffer_result max(f1)+1 from t1;
max(f1)+1
3
drop table t1;
create table t1 (c1 char(3), c2 char(3));
create table t2 (c3 char(3), c4 char(3));
insert into t1 values ('aaa', 'bb1'), ('aaa', 'bb2');
+40 −11
Original line number Diff line number Diff line
@@ -555,6 +555,31 @@ IFNULL(a, 'TEST') COALESCE(b, 'TEST')
4	TEST
TEST	TEST
DROP TABLE t1,t2;
CREATE TABLE t1 (a INT(10) NOT NULL, b INT(10) NOT NULL);
INSERT INTO t1 VALUES (1, 1);
INSERT INTO t1 VALUES (1, 2);
SELECT a, b, a AS c, COUNT(*) AS count FROM t1 GROUP BY a, b, c WITH ROLLUP;
a	b	c	count
1	1	1	1
1	1	NULL	1
1	2	1	1
1	2	NULL	1
1	NULL	NULL	2
NULL	NULL	NULL	2
DROP TABLE t1;
CREATE TABLE t1 (a int(11) NOT NULL);
INSERT INTO t1 VALUES (1),(2);
SELECT * FROM (SELECT a, a + 1, COUNT(*) FROM t1 GROUP BY a WITH ROLLUP) t;
a	a + 1	COUNT(*)
1	2	1
2	3	1
NULL	NULL	2
SELECT * FROM (SELECT a, LENGTH(a), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP) t;
a	LENGTH(a)	COUNT(*)
1	1	1
2	1	1
NULL	NULL	2
DROP TABLE t1;
CREATE TABLE t1(id int, type char(1));
INSERT INTO t1 VALUES
(1,"A"),(2,"C"),(3,"A"),(4,"A"),(5,"B"),
@@ -577,15 +602,19 @@ id select_type table type possible_keys key key_len ref rows Extra
1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	10	Using filesort
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT(10) NOT NULL, b INT(10) NOT NULL);
INSERT INTO t1 VALUES (1, 1);
INSERT INTO t1 VALUES (1, 2);
SELECT a, b, a AS c, COUNT(*) AS count FROM t1 GROUP BY a, b, c WITH ROLLUP;
a	b	c	count
1	1	1	1
1	1	NULL	1
1	2	1	1
1	2	NULL	1
1	NULL	NULL	2
NULL	NULL	NULL	2
CREATE TABLE t1 (a int(11) NOT NULL);
INSERT INTO t1 VALUES (1),(2);
CREATE VIEW v1 AS
SELECT a, LENGTH(a), COUNT(*) FROM t1 GROUP BY a WITH ROLLUP;
DESC v1;
Field	Type	Null	Key	Default	Extra
a	bigint(11)	YES		NULL	
LENGTH(a)	bigint(10)	YES		NULL	
COUNT(*)	bigint(21)	NO		0	
SELECT * FROM v1;
a	LENGTH(a)	COUNT(*)
1	1	1
2	1	1
NULL	NULL	2
DROP VIEW v1;
DROP TABLE t1;
+8 −0
Original line number Diff line number Diff line
@@ -773,6 +773,14 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
select ? from t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t1' at line 1
drop table t1;
CREATE TABLE b12651_T1(a int) ENGINE=MYISAM;
CREATE TABLE b12651_T2(b int) ENGINE=MYISAM;
CREATE VIEW  b12651_V1 as SELECT b FROM b12651_T2;
PREPARE b12651 FROM 'SELECT 1 FROM b12651_T1 WHERE a IN (SELECT b FROM b12651_V1)';
EXECUTE b12651;
1
DROP VIEW b12651_V1;
DROP TABLE b12651_T1, b12651_T2;
prepare stmt from "select @@time_zone";
execute stmt;
@@time_zone
+57 −0
Original line number Diff line number Diff line
@@ -156,3 +156,60 @@ slave: 6
drop procedure p1;
drop function f1;
drop table t1,t2;
create table t1 (a int);
create procedure p1()
begin
insert into t1 values(@x);
set @x=@x+1;
insert into t1 values(@x);
if (f2()) then
insert into t1 values(1243);
end if;
end//
create function f2() returns int
begin
insert into t1 values(@z);
set @z=@z+1;
insert into t1 values(@z);
return 0;
end//
create function f1() returns int
begin
insert into t1 values(@y);
call p1();
return 0;
end//
set @x=10;
set @y=20;
set @z=100;
select f1();
f1()
0
set @x=30;
call p1();
select 'master', a from t1;
master	a
master	20
master	10
master	11
master	100
master	101
master	30
master	31
master	101
master	102
select 'slave', a from t1;
slave	a
slave	20
slave	10
slave	11
slave	100
slave	101
slave	30
slave	31
slave	101
slave	102
drop table t1;
drop function f1;
drop function f2;
drop procedure p1;
Loading