summaryrefslogtreecommitdiff
path: root/mysql-test/t/insert.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/insert.test')
-rw-r--r--mysql-test/t/insert.test13
1 files changed, 12 insertions, 1 deletions
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index 9cc0bf8c46c..ae0a87895e1 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -3,7 +3,7 @@
#
--disable_warnings
-drop table if exists t1;
+drop table if exists t1,t2;
--enable_warnings
create table t1 (a int not null);
@@ -65,6 +65,17 @@ select * from t1;
drop table t1;
#
+# Test if insert ... select distinct
+#
+
+create table t1 (email varchar(50));
+insert into t1 values ('sasha@mysql.com'),('monty@mysql.com'),('foo@hotmail.com'),('foo@aol.com'),('bar@aol.com');
+create table t2(id int not null auto_increment primary key, t2 varchar(50), unique(t2));
+insert into t2 (t2) select distinct substring(email, locate('@', email)+1) from t1;
+select * from t2;
+drop table t1,t2;
+
+#
# Test of mysqld crash with fully qualified column names
#