summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <vva@eagle.mysql.r18.ru>2003-10-31 16:24:55 -0400
committerunknown <vva@eagle.mysql.r18.ru>2003-10-31 16:24:55 -0400
commit0119932a33da02b92497a36321529e8d658dfd4b (patch)
tree06a2de17f3967fc73e6fb7b2b28c0044e67c6c58 /mysql-test
parentd5cf9da4f389c30ecd29fbba1543ccee8c9d48e0 (diff)
downloadmariadb-git-0119932a33da02b92497a36321529e8d658dfd4b.tar.gz
fixed bug #1688 "CREATE TABLE ... SELECT with default()"
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/create.result16
-rw-r--r--mysql-test/t/create.test7
2 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index d61614180b3..4e83f195ed2 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -411,6 +411,22 @@ a b c d e f g h dd
1 -7 7 2000-01-01 b 2000-01-01 00:00:00 05:04:03 yet another binary data 02:00:00
2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02 binary data 02:00:00
drop table t1, t2;
+create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14');
+insert into t1 values ('','',0,0.0);
+describe t1;
+Field Type Null Key Default Extra
+str varchar(10) YES def
+strnull varchar(10) YES NULL
+intg int(11) YES 10
+rel double YES 3.14
+create table t2 select default(str) as str, default(strnull) as strnull, default(intg) as intg, default(rel) as rel from t1;
+describe t2;
+Field Type Null Key Default Extra
+str varchar(10) YES NULL
+strnull varchar(10) YES NULL
+intg int(11) YES NULL
+rel double YES NULL
+drop table t1, t2;
drop database if exists test_$1;
create database test_$1;
use test_$1;
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 059808161a3..826027b977d 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -318,6 +318,13 @@ select * from t2;
drop table t1, t2;
+create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14');
+insert into t1 values ('','',0,0.0);
+describe t1;
+create table t2 select default(str) as str, default(strnull) as strnull, default(intg) as intg, default(rel) as rel from t1;
+describe t2;
+drop table t1, t2;
+
#
# Bug #1209
#