Below is the list of changes that have just been committed into a local
5.1 repository of kostja. When kostja does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2167 06/02/24 00:28:42 konstantin@stripped +9 -0
Merge mysql.com:/opt/local/work/mysql-5.0-runtime
into mysql.com:/opt/local/work/mysql-5.1-new
sql/sql_table.cc
1.309 06/02/24 00:28:25 konstantin@stripped +0 -0
Auto merged
sql/sql_select.h
1.105 06/02/24 00:28:24 konstantin@stripped +0 -0
Auto merged
sql/sql_parse.cc
1.523 06/02/24 00:28:24 konstantin@stripped +0 -0
Auto merged
sql/sql_base.cc
1.305 06/02/24 00:28:23 konstantin@stripped +0 -0
Auto merged
sql/field.h
1.177 06/02/24 00:28:23 konstantin@stripped +0 -0
Auto merged
sql/field.cc
1.302 06/02/24 00:28:21 konstantin@stripped +0 -0
Auto merged
mysql-test/t/ps.test
1.60 06/02/24 00:28:21 konstantin@stripped +0 -0
Auto merged
mysql-test/r/ps.result
1.62 06/02/24 00:28:21 konstantin@stripped +0 -0
Auto merged
mysql-test/r/heap.result
1.45 06/02/24 00:28:21 konstantin@stripped +0 -0
Auto merged
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: konstantin
# Host: dragonfly.local
# Root: /opt/local/work/mysql-5.1-new/RESYNC
--- 1.301/sql/field.cc 2006-02-08 00:02:49 +03:00
+++ 1.302/sql/field.cc 2006-02-24 00:28:21 +03:00
@@ -8297,13 +8297,11 @@
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:
@@ -8355,7 +8353,7 @@
{
field_name= "";
sql_type= sql_type_arg;
- length= length_arg;;
+ char_length= length= length_arg;;
unireg_check= Field::NONE;
interval= 0;
charset= &my_charset_bin;
@@ -8683,6 +8681,8 @@
case FIELD_TYPE_DECIMAL:
DBUG_ASSERT(0); /* Was obsolete */
}
+ /* Remember the value of length */
+ char_length= length;
if (!(flags & BLOB_FLAG) &&
((length > max_field_charlength && fld_type != FIELD_TYPE_SET &&
@@ -9023,6 +9023,7 @@
else
interval=0;
def=0;
+ char_length= length;
if (!(flags & (NO_DEFAULT_VALUE_FLAG | BLOB_FLAG)) &&
old_field->ptr && orig_field &&
--- 1.176/sql/field.h 2006-02-02 16:48:04 +03:00
+++ 1.177/sql/field.h 2006-02-24 00:28:23 +03:00
@@ -1410,9 +1410,10 @@
*/
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 chars_length;
+ uint32 char_length;
uint decimals, flags, pack_length, key_length;
Field::utype unireg_check;
TYPELIB *interval; // Which interval to use
--- 1.304/sql/sql_base.cc 2006-02-22 14:04:17 +03:00
+++ 1.305/sql/sql_base.cc 2006-02-24 00:28:23 +03:00
@@ -4407,7 +4407,6 @@
{
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;
@@ -4440,6 +4439,7 @@
{
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();
@@ -4640,7 +4640,6 @@
{
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;
--- 1.104/sql/sql_select.h 2006-02-08 23:52:05 +03:00
+++ 1.105/sql/sql_select.h 2006-02-24 00:28:24 +03:00
@@ -175,7 +175,9 @@
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
@@ -287,12 +289,6 @@
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)
--- 1.308/sql/sql_table.cc 2006-02-17 21:55:38 +03:00
+++ 1.309/sql/sql_table.cc 2006-02-24 00:28:25 +03:00
@@ -1127,6 +1127,12 @@
{
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;
/*
@@ -1311,7 +1317,7 @@
sql_field->charset= (dup_field->charset ?
dup_field->charset :
create_info->default_table_charset);
- sql_field->length= dup_field->chars_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();
--- 1.59/mysql-test/t/ps.test 2006-02-02 11:59:18 +03:00
+++ 1.60/mysql-test/t/ps.test 2006-02-24 00:28:21 +03:00
@@ -900,6 +900,27 @@
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
#
| Thread |
|---|
| • bk commit into 5.1 tree (konstantin:1.2167) | konstantin | 23 Feb |