summaryrefslogtreecommitdiff
path: root/mysql-test/t/create.test
diff options
context:
space:
mode:
authorunknown <venu@myvenu.com>2002-12-28 01:38:29 -0800
committerunknown <venu@myvenu.com>2002-12-28 01:38:29 -0800
commita110156d96c8ecf90ae6ca2b5f5cfde82c91bc37 (patch)
tree7b9d7c7562b4d17c80980b907fdcb327e524b210 /mysql-test/t/create.test
parent6827968b2e4f8df470f63b03e912628f6345fd94 (diff)
downloadmariadb-git-a110156d96c8ecf90ae6ca2b5f5cfde82c91bc37.tar.gz
sql_table.cc:
Fix CREATE LIKE TABLE .. temporary case sql/sql_table.cc: Fix CREATE LIKE TABLE .. temporary case
Diffstat (limited to 'mysql-test/t/create.test')
-rw-r--r--mysql-test/t/create.test37
1 files changed, 37 insertions, 0 deletions
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 3bad053875c..f5f5116b429 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -113,3 +113,40 @@ drop table if exists t1;
create table t1 (a int, key(a));
create table t2 (b int, foreign key(b) references t1(a), key(b));
drop table if exists t1,t2;
+
+#
+# Test for CREATE TABLE .. LIKE ..
+#
+
+drop table if exists t1, t2, t3;
+create table t1(id int not null, name char(20));
+insert into t1 values(10,'mysql'),(20,'monty- the creator');
+create table t2(id int not null);
+insert into t2 values(10),(20);
+create table t3 like t1;
+show create table t3;
+select * from t3;
+create table if not exists t3 like t1;
+select @@warning_count;
+create temporary table t3 like t2;
+show create table t3;
+select * from t3;
+drop table t3;
+show create table t3;
+select * from t3;
+drop table t3;
+create database test_$1;
+drop table if exists test_$1.t3;
+create table test_$1.t3 like t1;
+create temporary table t3 like test_$1.t3;
+show create table t3;
+create table t3 like t1;
+!$1050 create table t3 like test_$1.t3;
+--error 1044,1
+create table non_existing_database.t1 like t1;
+!$1051 create table t3 like non_existing_table;
+!$1050 create temporary table t3 like t1;
+drop table t1, t2, t3;
+drop table t3;
+drop database test_$1;
+