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
4f347492
Commit
4f347492
authored
Sep 10, 2003
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge abarkov@build.mysql.com:/home/bk/mysql-4.1
into bar.mysql.r18.ru:/usr/home/bar/mysql-4.1
parents
b2a1bf2e
6fa45cec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
21 deletions
+25
-21
sql/field.cc
sql/field.cc
+21
-0
sql/sql_parse.cc
sql/sql_parse.cc
+0
-8
sql/sql_table.cc
sql/sql_table.cc
+4
-13
No files found.
sql/field.cc
View file @
4f347492
...
...
@@ -5480,6 +5480,27 @@ create_field::create_field(Field *old_field,Field *orig_field)
if
(
flags
&
BLOB_FLAG
)
pack_length
=
(
pack_length
-
old_field
->
table
->
blob_ptr_size
+
portable_sizeof_char_ptr
);
switch
(
sql_type
)
{
case
FIELD_TYPE_BLOB
:
switch
(
pack_length
-
portable_sizeof_char_ptr
)
{
case
1
:
sql_type
=
FIELD_TYPE_TINY_BLOB
;
break
;
case
2
:
sql_type
=
FIELD_TYPE_BLOB
;
break
;
case
3
:
sql_type
=
FIELD_TYPE_MEDIUM_BLOB
;
break
;
default:
sql_type
=
FIELD_TYPE_LONG_BLOB
;
break
;
}
length
/=
charset
->
mbmaxlen
;
break
;
case
FIELD_TYPE_STRING
:
case
FIELD_TYPE_VAR_STRING
:
length
/=
charset
->
mbmaxlen
;
break
;
default:
break
;
}
decimals
=
old_field
->
decimals
();
if
(
sql_type
==
FIELD_TYPE_STRING
)
{
...
...
sql/sql_parse.cc
View file @
4f347492
...
...
@@ -2050,14 +2050,6 @@ mysql_execute_command(THD *thd)
(
Table_ident
*
)
lex
->
name
);
else
{
List_iterator
<
create_field
>
fields
(
lex
->
create_list
);
create_field
*
field
;
while
((
field
=
fields
++
))
{
if
(
!
field
->
charset
)
field
->
charset
=
lex
->
create_info
.
table_charset
;
field
->
create_length_to_internal_length
();
}
res
=
mysql_create_table
(
thd
,
tables
->
db
?
tables
->
db
:
thd
->
db
,
tables
->
real_name
,
&
lex
->
create_info
,
lex
->
create_list
,
...
...
sql/sql_table.cc
View file @
4f347492
...
...
@@ -422,6 +422,10 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
for
(
field_no
=
0
;
(
sql_field
=
it
++
)
;
field_no
++
)
{
if
(
!
sql_field
->
charset
)
sql_field
->
charset
=
create_info
->
table_charset
;
sql_field
->
create_length_to_internal_length
();
/* Don't pack keys in old tables if the user has requested this */
if
((
sql_field
->
flags
&
BLOB_FLAG
)
||
sql_field
->
sql_type
==
FIELD_TYPE_VAR_STRING
&&
...
...
@@ -1916,19 +1920,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
List
<
Key
>
key_list
;
// Add new keys here
create_field
*
def
;
/*
For each column set charset to the table
default if the column charset hasn't been specified
explicitely. Change CREATE length into internal length
*/
def_it
.
rewind
();
while
((
def
=
def_it
++
))
{
if
(
!
def
->
charset
)
def
->
charset
=
create_info
->
table_charset
;
def
->
create_length_to_internal_length
();
}
/*
First collect all fields from table which isn't in drop_list
*/
...
...
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