[Commits] bzr commit into Mariadb 5.2, with Maria 2.0:maria/5.2 branch (igor:2831)

Igor Babaev igor at askmonty.org
Wed Jul 21 21:10:31 EEST 2010


#At lp:maria/5.2 based on revid:igor at askmonty.org-20100721163734-sdilfwr4dyvip13a

 2831 Igor Babaev	2010-07-21 [merge]
      Merge
      modified:
        mysql-test/suite/vcol/r/vcol_misc.result
        mysql-test/suite/vcol/t/vcol_misc.test
        sql/sql_select.cc

=== modified file 'mysql-test/suite/vcol/r/vcol_misc.result'
--- a/mysql-test/suite/vcol/r/vcol_misc.result	2010-07-20 05:41:24 +0000
+++ b/mysql-test/suite/vcol/r/vcol_misc.result	2010-07-21 18:10:12 +0000
@@ -97,3 +97,11 @@ v
 yz
 YZ
 DROP TABLE t1;
+CREATE TABLE t1 (f1 INTEGER, v1 INTEGER AS (f1) VIRTUAL);
+CREATE TABLE t2 AS SELECT v1 FROM t1;
+SHOW CREATE TABLE t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `v1` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1,t2;

=== modified file 'mysql-test/suite/vcol/t/vcol_misc.test'
--- a/mysql-test/suite/vcol/t/vcol_misc.test	2010-07-20 05:41:24 +0000
+++ b/mysql-test/suite/vcol/t/vcol_misc.test	2010-07-21 18:10:12 +0000
@@ -102,3 +102,13 @@ INSERT INTO t1(a,b,c,d) VALUES ('w','x',
 SELECT v FROM t1 ORDER BY CONCAT(a,b);
 
 DROP TABLE t1;
+
+#
+# Bug#607168: CREATE TABLE AS SELECT that returns virtual columns
+#
+
+CREATE TABLE t1 (f1 INTEGER, v1 INTEGER AS (f1) VIRTUAL);
+CREATE TABLE t2 AS SELECT v1 FROM t1;
+SHOW CREATE TABLE t2;
+
+DROP TABLE t1,t2;

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2010-07-20 05:41:24 +0000
+++ b/sql/sql_select.cc	2010-07-21 18:10:12 +0000
@@ -9564,6 +9564,8 @@ Field *create_tmp_field_from_field(THD *
       table->s->db_create_options|= HA_OPTION_PACK_RECORD;
     else if (org_field->type() == FIELD_TYPE_DOUBLE)
       ((Field_double *) new_field)->not_fixed= TRUE;
+    new_field->vcol_info= 0;
+    new_field->stored_in_db= TRUE;
   }
   return new_field;
 }



More information about the commits mailing list