Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
b5c01d79
Commit
b5c01d79
authored
Aug 30, 2005
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-4.1
into mysql.com:/home/jimw/my/mysql-4.1-clean
parents
513e24be
6ed72554
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
3 deletions
+23
-3
mysql-test/r/create.result
mysql-test/r/create.result
+7
-0
mysql-test/t/create.test
mysql-test/t/create.test
+9
-0
sql/item.cc
sql/item.cc
+4
-2
sql/sql_select.cc
sql/sql_select.cc
+3
-1
No files found.
mysql-test/r/create.result
View file @
b5c01d79
...
@@ -580,6 +580,13 @@ ERROR 42000: Incorrect database name 'xyz'
...
@@ -580,6 +580,13 @@ ERROR 42000: Incorrect database name 'xyz'
create table t1(t1.name int);
create table t1(t1.name int);
create table t2(test.t2.name int);
create table t2(test.t2.name int);
drop table t1,t2;
drop table t1,t2;
CREATE TABLE t1 (f1 VARCHAR(255) CHARACTER SET utf8);
CREATE TABLE t2 AS SELECT LEFT(f1,86) AS f2 FROM t1 UNION SELECT LEFT(f1,86)
AS f2 FROM t1;
DESC t2;
Field Type Null Key Default Extra
f2 varchar(86) YES NULL
DROP TABLE t1,t2;
create database mysqltest;
create database mysqltest;
use mysqltest;
use mysqltest;
drop database mysqltest;
drop database mysqltest;
...
...
mysql-test/t/create.test
View file @
b5c01d79
...
@@ -492,6 +492,15 @@ create table t1(t1.name int);
...
@@ -492,6 +492,15 @@ create table t1(t1.name int);
create
table
t2
(
test
.
t2
.
name
int
);
create
table
t2
(
test
.
t2
.
name
int
);
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# Bug #12537: UNION produces longtext instead of varchar
#
CREATE
TABLE
t1
(
f1
VARCHAR
(
255
)
CHARACTER
SET
utf8
);
CREATE
TABLE
t2
AS
SELECT
LEFT
(
f1
,
86
)
AS
f2
FROM
t1
UNION
SELECT
LEFT
(
f1
,
86
)
AS
f2
FROM
t1
;
DESC
t2
;
DROP
TABLE
t1
,
t2
;
#
#
# Bug#11028: Crash on create table like
# Bug#11028: Crash on create table like
#
#
...
...
sql/item.cc
View file @
b5c01d79
...
@@ -2047,12 +2047,14 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table)
...
@@ -2047,12 +2047,14 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table)
case
MYSQL_TYPE_ENUM
:
case
MYSQL_TYPE_ENUM
:
case
MYSQL_TYPE_SET
:
case
MYSQL_TYPE_SET
:
case
MYSQL_TYPE_VAR_STRING
:
case
MYSQL_TYPE_VAR_STRING
:
if
(
max_length
>
255
)
DBUG_ASSERT
(
collation
.
collation
);
if
(
max_length
/
collation
.
collation
->
mbmaxlen
>
255
)
break
;
// If blob
break
;
// If blob
return
new
Field_varstring
(
max_length
,
maybe_null
,
name
,
table
,
return
new
Field_varstring
(
max_length
,
maybe_null
,
name
,
table
,
collation
.
collation
);
collation
.
collation
);
case
MYSQL_TYPE_STRING
:
case
MYSQL_TYPE_STRING
:
if
(
max_length
>
255
)
// If blob
DBUG_ASSERT
(
collation
.
collation
);
if
(
max_length
/
collation
.
collation
->
mbmaxlen
>
255
)
// If blob
break
;
break
;
return
new
Field_string
(
max_length
,
maybe_null
,
name
,
table
,
return
new
Field_string
(
max_length
,
maybe_null
,
name
,
table
,
collation
.
collation
);
collation
.
collation
);
...
...
sql/sql_select.cc
View file @
b5c01d79
...
@@ -4899,6 +4899,8 @@ static Field* create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
...
@@ -4899,6 +4899,8 @@ static Field* create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
item
->
name
,
table
,
item
->
unsigned_flag
);
item
->
name
,
table
,
item
->
unsigned_flag
);
break
;
break
;
case
STRING_RESULT
:
case
STRING_RESULT
:
DBUG_ASSERT
(
item
->
collation
.
collation
);
enum
enum_field_types
type
;
enum
enum_field_types
type
;
/*
/*
DATE/TIME fields have STRING_RESULT result type. To preserve
DATE/TIME fields have STRING_RESULT result type. To preserve
...
@@ -4907,7 +4909,7 @@ static Field* create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
...
@@ -4907,7 +4909,7 @@ static Field* create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
if
((
type
=
item
->
field_type
())
==
MYSQL_TYPE_DATETIME
||
if
((
type
=
item
->
field_type
())
==
MYSQL_TYPE_DATETIME
||
type
==
MYSQL_TYPE_TIME
||
type
==
MYSQL_TYPE_DATE
)
type
==
MYSQL_TYPE_TIME
||
type
==
MYSQL_TYPE_DATE
)
new_field
=
item
->
tmp_table_field_from_field_type
(
table
);
new_field
=
item
->
tmp_table_field_from_field_type
(
table
);
else
if
(
item
->
max_length
>
255
)
else
if
(
item
->
max_length
/
item
->
collation
.
collation
->
mbmaxlen
>
255
)
{
{
if
(
convert_blob_length
)
if
(
convert_blob_length
)
new_field
=
new
Field_varstring
(
convert_blob_length
,
maybe_null
,
new_field
=
new
Field_varstring
(
convert_blob_length
,
maybe_null
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment