Below is the list of changes that have just been committed into a local
5.0 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@stripped, 2006-07-20 03:02:42+04:00, kostja@stripped +1 -0
A fix for Bug#14897 "ResultSet.getString("table.column") sometimes
doesn't find the column"
When a user was using 4.1 tables with VARCHAR column and 5.0 server
and a query that used a temporary table to resolve itself, the
table metadata for the varchar column sent to client was incorrect:
MYSQL_FIELD::table member was empty.
The bug was caused by implicit "upgrade" from old VARCHAR to new
VARCHAR hard-coded in Field::new_field, which did not preserve
the information about the original table. Thus, the field metadata
of the "upgraded" field pointed to an auxiliary temporary table
created for query execution.
The fix is to copy the pointer to the original table to the new field.
QQQ: Why if 'convert_blob_length' is TRUE create_tmp_field_from_field
does not preserve the original table? Is this a similar problem?
No test case as thisi s an upgrade-downgrade issue, 4.1 table is
needed to reproduce.
sql/field.cc@stripped, 2006-07-20 03:02:38+04:00, kostja@stripped +13 -8
Preserve the original table name when converting fields from
old VARCHAR to new VARCHAR.
# 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: kostja
# Host: bodhi.local
# Root: /opt/local/work/mysql-5.0-14897
--- 1.314/sql/field.cc 2006-07-20 03:02:51 +04:00
+++ 1.315/sql/field.cc 2006-07-20 03:02:51 +04:00
@@ -6234,15 +6234,20 @@ Field *Field_string::new_field(MEM_ROOT
Field *new_field;
if (type() != MYSQL_TYPE_VAR_STRING || keep_type)
- return Field::new_field(root, new_table, keep_type);
+ new_field= Field::new_field(root, new_table, keep_type);
+ else
+ {
- /*
- Old VARCHAR field which should be modified to a VARCHAR on copy
- This is done to ensure that ALTER TABLE will convert old VARCHAR fields
- to now VARCHAR fields.
- */
- return new Field_varstring(field_length, maybe_null(),
- field_name, new_table, charset());
+ /*
+ Old VARCHAR field which should be modified to a VARCHAR on copy
+ This is done to ensure that ALTER TABLE will convert old VARCHAR fields
+ to now VARCHAR fields.
+ */
+ new_field= new Field_varstring(field_length, maybe_null(),
+ field_name, new_table, charset());
+ new_field->orig_table= orig_table;
+ }
+ return new_field;
}
/****************************************************************************
| Thread |
|---|
| • bk commit into 5.0 tree (kostja:1.2237) BUG#14897 | konstantin | 20 Jul |