Commit 8278d425 authored by davi@endora.local's avatar davi@endora.local
Browse files

Merge mysql.com:/Users/davi/mysql/bugs/21801-5.1

into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime
parents 15408307 6efa4897
Loading
Loading
Loading
Loading
+46 −0
Original line number Diff line number Diff line
@@ -1743,4 +1743,50 @@ t1 CREATE TABLE `t1` (
  `MAXLEN` bigint(3) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
drop table t1;

# --
# -- Bug#21380: DEFAULT definition not always transfered by CREATE
# -- TABLE/SELECT to the new table.
# --

DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;

CREATE TABLE t1(
c1 INT DEFAULT 12 COMMENT 'column1',
c2 INT NULL COMMENT 'column2',
c3 INT NOT NULL COMMENT 'column3',
c4 VARCHAR(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
c5 VARCHAR(255) COLLATE utf8_unicode_ci NULL DEFAULT 'b',
c6 VARCHAR(255))
COLLATE ucs2_unicode_ci;

SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `c1` int(11) DEFAULT '12' COMMENT 'column1',
  `c2` int(11) DEFAULT NULL COMMENT 'column2',
  `c3` int(11) NOT NULL COMMENT 'column3',
  `c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
  `c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
  `c6` varchar(255) COLLATE ucs2_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=ucs2 COLLATE=ucs2_unicode_ci

CREATE TABLE t2 AS SELECT * FROM t1;

SHOW CREATE TABLE t2;
Table	Create Table
t2	CREATE TABLE `t2` (
  `c1` int(11) DEFAULT '12' COMMENT 'column1',
  `c2` int(11) DEFAULT NULL COMMENT 'column2',
  `c3` int(11) NOT NULL COMMENT 'column3',
  `c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
  `c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
  `c6` varchar(255) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1

DROP TABLE t2;

# -- End of test case for Bug#21380.

End of 5.1 tests
+3 −2
Original line number Diff line number Diff line
@@ -1235,8 +1235,8 @@ select col1 from test limit 1 into tmp;
return '1';
end|
create view v1 as select test.* from test where test.col1=test_function();
grant update (col1) on v1 to 'greg';
revoke all privileges on v1 from 'greg';
grant update (col1) on v1 to 'greg'@'localhost';
drop user 'greg'@'localhost';
drop view v1;
drop table test;
drop function test_function;
@@ -1304,5 +1304,6 @@ CALL mysqltest1.test();
1
DROP DATABASE mysqltest1;
RENAME TABLE mysql.procs_gone TO mysql.procs_priv;
DROP USER mysqltest_1@localhost;
FLUSH PRIVILEGES;
End of 5.1 tests
+5 −0
Original line number Diff line number Diff line
@@ -1427,4 +1427,9 @@ DROP FUNCTION f1;
DROP TABLE t1;
DROP EVENT ev1;
SHOW TABLE TYPES;
CREATE USER test_u@localhost;
GRANT PROCESS ON *.* TO test_u@localhost;
SHOW ENGINE MYISAM MUTEX;
SHOW ENGINE MYISAM STATUS;
DROP USER test_u@localhost;
End of 5.1 tests
+44 −0
Original line number Diff line number Diff line
@@ -1341,4 +1341,48 @@ create table t1 like information_schema.character_sets;
show create table t1;
drop table t1;

--echo
--echo # --
--echo # -- Bug#21380: DEFAULT definition not always transfered by CREATE
--echo # -- TABLE/SELECT to the new table.
--echo # --
--echo


--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
--enable_warnings

--echo

CREATE TABLE t1(
  c1 INT DEFAULT 12 COMMENT 'column1',
  c2 INT NULL COMMENT 'column2',
  c3 INT NOT NULL COMMENT 'column3',
  c4 VARCHAR(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
  c5 VARCHAR(255) COLLATE utf8_unicode_ci NULL DEFAULT 'b',
  c6 VARCHAR(255))
  COLLATE ucs2_unicode_ci;

--echo

SHOW CREATE TABLE t1;

--echo

CREATE TABLE t2 AS SELECT * FROM t1;

--echo

SHOW CREATE TABLE t2;

--echo

DROP TABLE t2;

--echo
--echo # -- End of test case for Bug#21380.
--echo

--echo End of 5.1 tests
+3 −2
Original line number Diff line number Diff line
@@ -1282,8 +1282,8 @@ begin
end|
delimiter ;|
create view v1 as select test.* from test where test.col1=test_function();
grant update (col1) on v1 to 'greg';
revoke all privileges on v1 from 'greg';
grant update (col1) on v1 to 'greg'@'localhost';
drop user 'greg'@'localhost';
drop view v1;
drop table test;
drop function test_function;
@@ -1396,6 +1396,7 @@ GRANT ALL PRIVILEGES ON test.* TO mysqltest_1@localhost;
CALL mysqltest1.test();
DROP DATABASE mysqltest1;
RENAME TABLE mysql.procs_gone TO mysql.procs_priv;
DROP USER mysqltest_1@localhost;
FLUSH PRIVILEGES;


Loading