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
d5bb6606
Commit
d5bb6606
authored
Oct 28, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/psergey/mysql-4.1-bug14139
parents
61e2ed9c
115bf436
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
2 deletions
+41
-2
mysql-test/r/create.result
mysql-test/r/create.result
+11
-0
mysql-test/t/create.test
mysql-test/t/create.test
+8
-0
sql/field.cc
sql/field.cc
+12
-0
sql/field.h
sql/field.h
+8
-0
sql/sql_table.cc
sql/sql_table.cc
+2
-2
No files found.
mysql-test/r/create.result
View file @
d5bb6606
...
@@ -621,3 +621,14 @@ create table if not exists t1 (a int);
...
@@ -621,3 +621,14 @@ create table if not exists t1 (a int);
Warnings:
Warnings:
Note 1050 Table 't1' already exists
Note 1050 Table 't1' already exists
drop table t1;
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;
mysql-test/t/create.test
View file @
d5bb6606
...
@@ -526,4 +526,12 @@ create table t1 (a int);
...
@@ -526,4 +526,12 @@ create table t1 (a int);
create
table
if
not
exists
t1
(
a
int
);
create
table
if
not
exists
t1
(
a
int
);
drop
table
t1
;
drop
table
t1
;
# BUG#14139
create
table
t1
(
a
varchar
(
112
)
charset
utf8
collate
utf8_bin
not
null
,
primary
key
(
a
)
)
select
'test'
as
a
;
show
create
table
t1
;
drop
table
t1
;
# End of 4.1 tests
# End of 4.1 tests
sql/field.cc
View file @
d5bb6606
...
@@ -6511,8 +6511,20 @@ bool Field_num::eq_def(Field *field)
...
@@ -6511,8 +6511,20 @@ bool Field_num::eq_def(Field *field)
** Handling of field and create_field
** Handling of field and create_field
*****************************************************************************/
*****************************************************************************/
/*
Convert create_field::length from number of characters to number of bytes
SYNOPSIS
create_field::create_length_to_internal_length()
DESCRIPTION
Convert create_field::length from number of characters to number of bytes,
save original value in chars_length.
*/
void
create_field
::
create_length_to_internal_length
(
void
)
void
create_field
::
create_length_to_internal_length
(
void
)
{
{
chars_length
=
length
;
switch
(
sql_type
)
{
switch
(
sql_type
)
{
case
MYSQL_TYPE_TINY_BLOB
:
case
MYSQL_TYPE_TINY_BLOB
:
case
MYSQL_TYPE_MEDIUM_BLOB
:
case
MYSQL_TYPE_MEDIUM_BLOB
:
...
...
sql/field.h
View file @
d5bb6606
...
@@ -1180,7 +1180,15 @@ public:
...
@@ -1180,7 +1180,15 @@ public:
LEX_STRING
comment
;
// Comment for field
LEX_STRING
comment
;
// Comment for field
Item
*
def
;
// Default value
Item
*
def
;
// Default value
enum
enum_field_types
sql_type
;
enum
enum_field_types
sql_type
;
/*
At various stages in execution this can be length of field in bytes or
max number of characters.
*/
uint32
length
;
uint32
length
;
/*
The value of 'length' before a call to create_length_to_internal_length
*/
uint32
chars_length
;
uint
decimals
,
flags
,
pack_length
;
uint
decimals
,
flags
,
pack_length
;
Field
::
utype
unireg_check
;
Field
::
utype
unireg_check
;
TYPELIB
*
interval
;
// Which interval to use
TYPELIB
*
interval
;
// Which interval to use
...
...
sql/sql_table.cc
View file @
d5bb6606
...
@@ -643,7 +643,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
...
@@ -643,7 +643,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
sql_field
->
charset
=
(
dup_field
->
charset
?
sql_field
->
charset
=
(
dup_field
->
charset
?
dup_field
->
charset
:
dup_field
->
charset
:
create_info
->
default_table_charset
);
create_info
->
default_table_charset
);
sql_field
->
length
=
dup_field
->
length
;
sql_field
->
length
=
dup_field
->
chars_
length
;
sql_field
->
pack_length
=
dup_field
->
pack_length
;
sql_field
->
pack_length
=
dup_field
->
pack_length
;
sql_field
->
create_length_to_internal_length
();
sql_field
->
create_length_to_internal_length
();
sql_field
->
decimals
=
dup_field
->
decimals
;
sql_field
->
decimals
=
dup_field
->
decimals
;
...
...
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