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
e0b4e228
Commit
e0b4e228
authored
Feb 24, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/opt/local/work/mysql-5.0-runtime
parents
ef1316fa
9519987c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
15 deletions
+38
-15
mysql-test/t/ps.test
mysql-test/t/ps.test
+21
-0
sql/field.cc
sql/field.cc
+2
-3
sql/field.h
sql/field.h
+3
-2
sql/sql_base.cc
sql/sql_base.cc
+1
-2
sql/sql_parse.cc
sql/sql_parse.cc
+1
-0
sql/sql_select.h
sql/sql_select.h
+3
-7
sql/sql_table.cc
sql/sql_table.cc
+7
-1
No files found.
mysql-test/t/ps.test
View file @
e0b4e228
...
...
@@ -900,6 +900,27 @@ execute stmt using @like;
deallocate
prepare
stmt
;
drop
table
t1
;
#
# Bug#13134 "Length of VARCHAR() utf8 column is increasing when table is
# recreated with PS/SP"
#
prepare
stmt
from
'create table t1 (a varchar(10) character set utf8)'
;
execute
stmt
;
--
disable_warnings
insert
into
t1
(
a
)
values
(
repeat
(
'a'
,
20
));
--
enable_warnings
select
length
(
a
)
from
t1
;
drop
table
t1
;
execute
stmt
;
--
disable_warnings
insert
into
t1
(
a
)
values
(
repeat
(
'a'
,
20
));
--
enable_warnings
# Check that the data is truncated to the same length
select
length
(
a
)
from
t1
;
drop
table
t1
;
deallocate
prepare
stmt
;
# End of 4.1 tests
#
...
...
sql/field.cc
View file @
e0b4e228
...
...
@@ -8213,13 +8213,11 @@ void Field_bit_as_char::sql_type(String &res) const
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.
Convert create_field::length from number of characters to number of bytes.
*/
void
create_field
::
create_length_to_internal_length
(
void
)
{
chars_length
=
length
;
switch
(
sql_type
)
{
case
MYSQL_TYPE_TINY_BLOB
:
case
MYSQL_TYPE_MEDIUM_BLOB
:
...
...
@@ -8937,6 +8935,7 @@ create_field::create_field(Field *old_field,Field *orig_field)
else
interval
=
0
;
def
=
0
;
char_length
=
length
;
if
(
!
(
flags
&
(
NO_DEFAULT_VALUE_FLAG
|
BLOB_FLAG
))
&&
old_field
->
ptr
&&
orig_field
&&
...
...
sql/field.h
View file @
e0b4e228
...
...
@@ -1386,9 +1386,10 @@ public:
*/
ulong
length
;
/*
The value of 'length' before a call to create_length_to_internal_length
The value of `length' as set by parser: is the number of characters
for most of the types, or of bytes for BLOBs or numeric types.
*/
uint32
char
s
_length
;
uint32
char_length
;
uint
decimals
,
flags
,
pack_length
,
key_length
;
Field
::
utype
unireg_check
;
TYPELIB
*
interval
;
// Which interval to use
...
...
sql/sql_base.cc
View file @
e0b4e228
...
...
@@ -3594,7 +3594,6 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2,
{
Field_iterator_table_ref
it_1
,
it_2
;
Natural_join_column
*
nj_col_1
,
*
nj_col_2
;
const
char
*
field_name_1
;
Query_arena
*
arena
,
backup
;
bool
add_columns
=
TRUE
;
bool
result
=
TRUE
;
...
...
@@ -3627,6 +3626,7 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2,
{
bool
is_created_1
;
bool
found
=
FALSE
;
const
char
*
field_name_1
;
if
(
!
(
nj_col_1
=
it_1
.
get_or_create_column_ref
(
&
is_created_1
)))
goto
err
;
field_name_1
=
nj_col_1
->
name
();
...
...
@@ -3823,7 +3823,6 @@ store_natural_using_join_columns(THD *thd, TABLE_LIST *natural_using_join,
{
Field_iterator_table_ref
it_1
,
it_2
;
Natural_join_column
*
nj_col_1
,
*
nj_col_2
;
bool
is_created
;
Query_arena
*
arena
,
backup
;
bool
result
=
TRUE
;
List
<
Natural_join_column
>
*
non_join_columns
;
...
...
sql/sql_parse.cc
View file @
e0b4e228
...
...
@@ -5791,6 +5791,7 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
interval_list
,
cs
,
uint_geom_type
))
DBUG_RETURN
(
1
);
new_field
->
char_length
=
new_field
->
length
;
lex
->
create_list
.
push_back
(
new_field
);
lex
->
last_field
=
new_field
;
DBUG_RETURN
(
0
);
...
...
sql/sql_select.h
View file @
e0b4e228
...
...
@@ -174,7 +174,9 @@ typedef struct st_rollup
class
JOIN
:
public
Sql_alloc
{
public:
JOIN
(
const
JOIN
&
rhs
);
/* not implemented */
JOIN
&
operator
=
(
const
JOIN
&
rhs
);
/* not implemented */
public:
JOIN_TAB
*
join_tab
,
**
best_ref
;
JOIN_TAB
**
map2table
;
// mapping between table indexes and JOIN_TABs
JOIN_TAB
*
join_tab_save
;
// saved join_tab for subquery reexecution
...
...
@@ -286,12 +288,6 @@ class JOIN :public Sql_alloc
init
(
thd_arg
,
fields_arg
,
select_options_arg
,
result_arg
);
}
JOIN
(
JOIN
&
join
)
:
fields_list
(
join
.
fields_list
)
{
init
(
join
.
thd
,
join
.
fields_list
,
join
.
select_options
,
join
.
result
);
}
void
init
(
THD
*
thd_arg
,
List
<
Item
>
&
fields_arg
,
ulonglong
select_options_arg
,
select_result
*
result_arg
)
...
...
sql/sql_table.cc
View file @
e0b4e228
...
...
@@ -688,6 +688,12 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
{
CHARSET_INFO
*
save_cs
;
/*
Initialize length from its original value (number of characters),
which was set in the parser. This is necessary if we're
executing a prepared statement for the second time.
*/
sql_field
->
length
=
sql_field
->
char_length
;
if
(
!
sql_field
->
charset
)
sql_field
->
charset
=
create_info
->
default_table_charset
;
/*
...
...
@@ -872,7 +878,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
sql_field
->
charset
=
(
dup_field
->
charset
?
dup_field
->
charset
:
create_info
->
default_table_charset
);
sql_field
->
length
=
dup_field
->
char
s
_length
;
sql_field
->
length
=
dup_field
->
char_length
;
sql_field
->
pack_length
=
dup_field
->
pack_length
;
sql_field
->
key_length
=
dup_field
->
key_length
;
sql_field
->
create_length_to_internal_length
();
...
...
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