Commit 9d66be72 authored by unknown's avatar unknown
Browse files

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

into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint


sql/mysql_priv.h:
  Auto merged
parents 035062b2 c039eed8
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -193,6 +193,16 @@ a b c d e f g h i x
two	large	00:00:05	0007-01-01	11	13	17	0019-01-01 00:00:00	23	1
	small	00:00:00	0000-00-00	0			0000-00-00 00:00:00	0	2
two	large	00:00:05	0007-01-01	11	13	17	0019-01-01 00:00:00	23	3
	small	00:00:00	0000-00-00	0			0000-00-00 00:00:00	0	4
		00:00:00	0000-00-00	0			0000-00-00 00:00:00	0	4
drop table bug20691;
create table t1 (id int not null);
insert into t1 values(default);
Warnings:
Warning	1364	Field 'id' doesn't have a default value
create view v1 (c) as select id from t1;
insert into t1 values(default);
Warnings:
Warning	1364	Field 'id' doesn't have a default value
drop view v1;
drop table t1;
End of 5.0 tests.
+4 −0
Original line number Diff line number Diff line
@@ -717,3 +717,7 @@ desc t1;
Field	Type	Null	Key	Default	Extra
GeomFromText('point(1 1)')	geometry	NO			
drop table t1;
create table t1 (g geometry not null);
insert into t1 values(default);
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
+38 −2
Original line number Diff line number Diff line
@@ -1262,8 +1262,7 @@ from information_schema.tables
order by object_schema;
explain select * from v1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
2	DERIVED	tables	ALL	NULL	NULL	NULL	NULL	2	Using filesort
1	SIMPLE	tables	ALL	NULL	NULL	NULL	NULL	2	Using filesort
explain select * from (select table_name from information_schema.tables) as a;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
@@ -1279,3 +1278,40 @@ table_name
t1
t2
drop table t1,t2;
select 1 as f1 from information_schema.tables  where "CHARACTER_SETS"=
(select cast(table_name as char)  from information_schema.tables
order by table_name limit 1) limit 1;
f1
1
select t.table_name, group_concat(t.table_schema, '.', t.table_name),
count(*) as num1
from information_schema.tables t
inner join information_schema.columns c1
on t.table_schema = c1.table_schema AND t.table_name = c1.table_name
where t.table_schema = 'information_schema' and
c1.ordinal_position =
(select isnull(c2.column_type) -
isnull(group_concat(c2.table_schema, '.', c2.table_name)) +
count(*) as num
from information_schema.columns c2 where
c2.table_schema='information_schema' and
(c2.column_type = 'varchar(7)' or c2.column_type = 'varchar(20)')
group by c2.column_type order by num limit 1)
group by t.table_name order by num1, t.table_name;
table_name	group_concat(t.table_schema, '.', t.table_name)	num1
CHARACTER_SETS	information_schema.CHARACTER_SETS	1
COLLATIONS	information_schema.COLLATIONS	1
COLLATION_CHARACTER_SET_APPLICABILITY	information_schema.COLLATION_CHARACTER_SET_APPLICABILITY	1
COLUMNS	information_schema.COLUMNS	1
COLUMN_PRIVILEGES	information_schema.COLUMN_PRIVILEGES	1
KEY_COLUMN_USAGE	information_schema.KEY_COLUMN_USAGE	1
ROUTINES	information_schema.ROUTINES	1
SCHEMATA	information_schema.SCHEMATA	1
SCHEMA_PRIVILEGES	information_schema.SCHEMA_PRIVILEGES	1
STATISTICS	information_schema.STATISTICS	1
TABLES	information_schema.TABLES	1
TABLE_CONSTRAINTS	information_schema.TABLE_CONSTRAINTS	1
TABLE_PRIVILEGES	information_schema.TABLE_PRIVILEGES	1
TRIGGERS	information_schema.TRIGGERS	1
USER_PRIVILEGES	information_schema.USER_PRIVILEGES	1
VIEWS	information_schema.VIEWS	1
+27 −0
Original line number Diff line number Diff line
@@ -383,6 +383,33 @@ EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	128	Using filesort
DROP TABLE t1;
CREATE TABLE t1 (
id int NOT NULL,
name varchar(20) NOT NULL,
dept varchar(20) NOT NULL,
age tinyint(3) unsigned NOT NULL,
PRIMARY KEY (id),
INDEX (name,dept)
) ENGINE=InnoDB;
INSERT INTO t1(id, dept, age, name) VALUES
(3987, 'cs1', 10, 'rs1'), (3988, 'cs2', 20, 'rs1'), (3995, 'cs3', 10, 'rs2'),
(3996, 'cs4', 20, 'rs2'), (4003, 'cs5', 10, 'rs3'), (4004, 'cs6', 20, 'rs3'),
(4011, 'cs7', 10, 'rs4'), (4012, 'cs8', 20, 'rs4'), (4019, 'cs9', 10, 'rs5'),
(4020, 'cs10', 20, 'rs5'),(4027, 'cs11', 10, 'rs6'),(4028, 'cs12', 20, 'rs6');
EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	range	name	name	44	NULL	2	Using where; Using index for group-by
SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
name	dept
rs5	cs10
rs5	cs9
DELETE FROM t1;
EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	range	name	name	44	NULL	2	Using where; Using index for group-by
SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
name	dept
DROP TABLE t1;
show variables like 'innodb_rollback_on_timeout';
Variable_name	Value
innodb_rollback_on_timeout	OFF
+26 −0
Original line number Diff line number Diff line
@@ -705,3 +705,29 @@ use bug21774_1;
INSERT INTO bug21774_2.t1 SELECT t1.* FROM t1;
DROP DATABASE bug21774_1;
DROP DATABASE bug21774_2;
USE test;
create table t1(f1 int primary key, f2 int);
insert into t1 values (1,1);
affected rows: 1
insert into t1 values (1,1) on duplicate key update f2=1;
affected rows: 0
insert into t1 values (1,1) on duplicate key update f2=2;
affected rows: 2
select * from t1;
f1	f2
1	2
drop table t1;
create table t1(f1 int primary key auto_increment, f2 int unique);
insert into t1(f2) values(1);
select @@identity;
@@identity
1
insert ignore t1(f2) values(1);
select @@identity;
@@identity
0
insert ignore t1(f2) select 1;
select @@identity;
@@identity
0
drop table t1;
Loading