Commit 21bb08e8 authored by unknown's avatar unknown
Browse files

Merge mysql.com:/home/jimw/my/mysql-4.1-12327

into  mysql.com:/home/jimw/my/mysql-4.1-clean

parents bea4fbb0 1c847f79
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -575,8 +575,13 @@ static void print_result()

    if (status)
    {
      /*
        if there was an error with the table, we have --auto-repair set,
        and this isn't a repair op, then add the table to the tables4repair
        list
      */
      if (found_error && opt_auto_repair && what_to_do != DO_REPAIR &&
	  (!opt_fast || strcmp(row[3],"OK")))
	  strcmp(row[3],"OK"))
	insert_dynamic(&tables4repair, prev);
      found_error=0;
      if (opt_silent)
@@ -595,8 +600,8 @@ static void print_result()
    strmov(prev, row[0]);
    putchar('\n');
  }
  if (found_error && opt_auto_repair && what_to_do != DO_REPAIR &&
      !opt_fast)
  /* add the last table to be repaired to the list */
  if (found_error && opt_auto_repair && what_to_do != DO_REPAIR)
    insert_dynamic(&tables4repair, prev);
  mysql_free_result(res);
}
+15 −0
Original line number Diff line number Diff line
@@ -68,6 +68,21 @@ drop table t1;
select TRUE,FALSE,NULL;
TRUE	FALSE	NULL
1	0	NULL
create table t1 (c1 char(5)) character set=latin1;
insert into t1 values('row 1');
insert into t1 values('row 2');
insert into t1 values('row 3');
select concat(user(), '--', c1) from t1;
concat(user(), '--', c1)
root@localhost--row 1
root@localhost--row 2
root@localhost--row 3
select concat(database(), '--', c1) from t1;
concat(database(), '--', c1)
test--row 1
test--row 2
test--row 3
drop table t1;
create table t1 (a char(10)) character set latin1;
select * from t1 where a=version();
a
+14 −0
Original line number Diff line number Diff line
@@ -80,4 +80,18 @@ show status like "Qcache_free_blocks";
Variable_name	Value
Qcache_free_blocks	1
drop table t1, t2, t3, t11, t21;
CREATE TABLE t1 ( a INT NOT NULL PRIMARY KEY AUTO_INCREMENT ) ENGINE =
MyISAM;
LOCK TABLE t1 READ LOCAL;
INSERT INTO t1 VALUES (), (), ();
SELECT * FROM t1;
a
SELECT * FROM t1;
a
1
2
3
SELECT * FROM t1;
a
drop table t1;
set GLOBAL query_cache_size=0;
+57 −3
Original line number Diff line number Diff line
@@ -2742,13 +2742,26 @@ one two flag
5	6	N
7	8	N
insert into t2 values (null,null,'N');
insert into t2 values (null,3,'0');
insert into t2 values (null,5,'0');
insert into t2 values (10,null,'0');
insert into t1 values (10,3,'0');
insert into t1 values (10,5,'0');
insert into t1 values (10,10,'0');
SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N') as 'test' from t1;
one	two	test
1	2	0
2	3	0
3	4	0
1	2	NULL
2	3	NULL
3	4	NULL
5	6	1
7	8	1
10	3	NULL
10	5	NULL
10	10	NULL
SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N');
one	two
5	6
7	8
SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N' group by one,two) as 'test' from t1;
one	two	test
1	2	NULL
@@ -2756,6 +2769,47 @@ one two test
3	4	NULL
5	6	1
7	8	1
10	3	NULL
10	5	NULL
10	10	NULL
SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0') as 'test' from t1;
one	two	test
1	2	0
2	3	NULL
3	4	0
5	6	0
7	8	0
10	3	NULL
10	5	NULL
10	10	NULL
SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1;
one	two	test
1	2	0
2	3	NULL
3	4	0
5	6	0
7	8	0
10	3	NULL
10	5	NULL
10	10	NULL
explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0') as 'test' from t1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	8	
2	DEPENDENT SUBQUERY	t2	ALL	NULL	NULL	NULL	NULL	9	Using where
Warnings:
Note	1003	select test.t1.one AS `one`,test.t1.two AS `two`,<in_optimizer>((test.t1.one,test.t1.two),<exists>(select test.t2.one AS `one`,test.t2.two AS `two` from test.t2 where ((test.t2.flag = _latin1'0') and ((<cache>(test.t1.one) = test.t2.one) or isnull(test.t2.one)) and ((<cache>(test.t1.two) = test.t2.two) or isnull(test.t2.two))) having (<is_not_null_test>(test.t2.one) and <is_not_null_test>(test.t2.two)))) AS `test` from test.t1
explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N');
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	8	Using where
2	DEPENDENT SUBQUERY	t2	ALL	NULL	NULL	NULL	NULL	9	Using where
Warnings:
Note	1003	select test.t1.one AS `one`,test.t1.two AS `two` from test.t1 where <in_optimizer>((test.t1.one,test.t1.two),<exists>(select test.t2.one AS `one`,test.t2.two AS `two` from test.t2 where ((test.t2.flag = _latin1'N') and (<cache>(test.t1.one) = test.t2.one) and (<cache>(test.t1.two) = test.t2.two))))
explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	8	
2	DEPENDENT SUBQUERY	t2	ALL	NULL	NULL	NULL	NULL	9	Using where; Using temporary; Using filesort
Warnings:
Note	1003	select test.t1.one AS `one`,test.t1.two AS `two`,<in_optimizer>((test.t1.one,test.t1.two),<exists>(select test.t2.one AS `one`,test.t2.two AS `two` from test.t2 where (test.t2.flag = _latin1'0') group by test.t2.one,test.t2.two having (((<cache>(test.t1.one) = test.t2.one) or isnull(test.t2.one)) and ((<cache>(test.t1.two) = test.t2.two) or isnull(test.t2.two)) and <is_not_null_test>(test.t2.one) and <is_not_null_test>(test.t2.two)))) AS `test` from test.t1
DROP TABLE t1,t2;
CREATE TABLE t1 (a char(5), b char(5));
INSERT INTO t1 VALUES (NULL,'aaa'), ('aaa','aaa');
+12 −0
Original line number Diff line number Diff line
@@ -31,6 +31,18 @@ drop table t1;

select TRUE,FALSE,NULL;

#
# Bug#12351: CONCAT with USER()/DATEBASE() and
# a constant and a column gets strange results
#
create table t1 (c1 char(5)) character set=latin1;
insert into t1 values('row 1');
insert into t1 values('row 2');
insert into t1 values('row 3');
select concat(user(), '--', c1) from t1;
select concat(database(), '--', c1) from t1;
drop table t1;

#
# Bug#8291 Illegal collation mix with USER() function
#
Loading