summaryrefslogtreecommitdiff
path: root/mysql-test/r/create.result
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2005-10-26 00:56:17 +0400
committerunknown <sergefp@mysql.com>2005-10-26 00:56:17 +0400
commit115bf43602424f2bba326efab6d7ec51c66ac4e5 (patch)
tree574ae35505c263717f483ef3e77b930a931f5de5 /mysql-test/r/create.result
parent1c9783e854965376844a021ab1312b373852f287 (diff)
downloadmariadb-git-115bf43602424f2bba326efab6d7ec51c66ac4e5.tar.gz
BUG#14139: When handling "CREATE TABLE(field_X type_spec,...) SELECT smth AS field_X, ...."
avoid multiplying length of field_X by charset->mbmaxlen twice when calculating space required for field_X in the new table. mysql-test/r/create.result: Testcase for BUG#14139 mysql-test/t/create.test: Testcase for BUG#14139 sql/field.cc: BUG#14139: Make create_length_to_internal_length() save length-in-characters in create_field::chars_length. sql/field.h: BUG#14139: Add create_length::chars_length where we save length-in-characters, added comments. sql/sql_table.cc: BUG#14139: When handling "CREATE TABLE(field_X type_spec,...) SELECT smth AS field_X, ...." we get two instances of create_field: (1) is occurence of field_X in create list, and (2) is in select list. If we figure they both refer to the same field, we "join" them according to some rule that is not explicitly specified anywhere. When we do this "join", create_field::length already contains length-in-bytes for both, so when we transfer field length (in characters) from (1) to (2), use length-in-characters that we have saved in create_length::chars_length.
Diffstat (limited to 'mysql-test/r/create.result')
-rw-r--r--mysql-test/r/create.result11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 6edd4cbc48f..55ad6e3304a 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -621,3 +621,14 @@ create table if not exists t1 (a int);
Warnings:
Note 1050 Table 't1' already exists
drop table t1;
+create table t1 (
+a varchar(112) charset utf8 collate utf8_bin not null,
+primary key (a)
+) select 'test' as a ;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(112) character set utf8 collate utf8_bin NOT NULL default '',
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;