Below is the list of changes that have just been committed into a local
5.1 repository of kgeorge. When kgeorge 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, 2007-09-26 19:06:54+03:00, gkodinov@stripped +6 -0
merge of the fix for bug 27802 & 27216 to 5.1-opt
mysql-test/r/view.result@stripped, 2007-09-26 19:06:51+03:00, gkodinov@stripped +6 -6
merge of the fix for bug 27802 to 5.1
sql/item_cmpfunc.h@stripped, 2007-09-26 19:06:51+03:00, gkodinov@stripped +2 -0
merge of the fix for bug 27216 to 5.1
sql/sql_insert.cc@stripped, 2007-09-26 19:06:51+03:00, gkodinov@stripped +1 -1
merge of the fix for bug 27216 to 5.1
sql/sql_lex.h@stripped, 2007-09-26 19:06:51+03:00, gkodinov@stripped +2 -0
merge of the fix for bug 27802 to 5.1
sql/sql_select.cc@stripped, 2007-09-26 19:06:51+03:00, gkodinov@stripped +24 -27
merge of the fix for bug 27802 to 5.1
sql/table.h@stripped, 2007-09-26 19:06:51+03:00, gkodinov@stripped +0 -2
merge of the fix for bug 27802 to 5.1
diff -Nrup a/mysql-test/r/view.result b/mysql-test/r/view.result
--- a/mysql-test/r/view.result 2007-09-26 14:20:11 +03:00
+++ b/mysql-test/r/view.result 2007-09-26 19:06:51 +03:00
@@ -3575,22 +3575,22 @@ PRIMARY KEY(a), KEY (b));
INSERT INTO t1 VALUES (),(),(),(),(),(),(),(),(),(),(),(),(),(),();
CREATE VIEW v1 AS SELECT * FROM t1 FORCE KEY (PRIMARY,b) ORDER BY a;
SHOW CREATE VIEW v1;
-View Create View
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` FORCE INDEX (PRIMARY,`b`) order by `t1`.`a`
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` FORCE INDEX (PRIMARY) FORCE INDEX (`b`) order by `t1`.`a` latin1 latin1_swedish_ci
EXPLAIN SELECT * FROM v1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 15
CREATE VIEW v2 AS SELECT * FROM t1 USE KEY () ORDER BY a;
SHOW CREATE VIEW v2;
-View Create View
-v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` USE INDEX () order by `t1`.`a`
+View Create View character_set_client collation_connection
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` USE INDEX () order by `t1`.`a` latin1 latin1_swedish_ci
EXPLAIN SELECT * FROM v2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 15 Using filesort
CREATE VIEW v3 AS SELECT * FROM t1 IGNORE KEY (b) ORDER BY a;
SHOW CREATE VIEW v3;
-View Create View
-v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` IGNORE INDEX (`b`) order by `t1`.`a`
+View Create View character_set_client collation_connection
+v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` IGNORE INDEX (`b`) order by `t1`.`a` latin1 latin1_swedish_ci
EXPLAIN SELECT * FROM v3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 15 Using filesort
diff -Nrup a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
--- a/sql/item_cmpfunc.h 2007-09-24 16:23:37 +03:00
+++ b/sql/item_cmpfunc.h 2007-09-26 19:06:51 +03:00
@@ -1108,6 +1108,7 @@ class Item_func_case :public Item_func
uint ncases;
Item_result cmp_type;
DTCollation cmp_collation;
+ enum_field_types cached_field_type;
cmp_item *cmp_items[5]; /* For all result types */
cmp_item *case_item;
public:
@@ -1138,6 +1139,7 @@ public:
uint decimal_precision() const;
table_map not_null_tables() const { return 0; }
enum Item_result result_type () const { return cached_result_type; }
+ enum_field_types field_type() const { return cached_field_type; }
const char *func_name() const { return "case"; }
void print(String *str);
Item *find_item(String *str);
diff -Nrup a/sql/sql_insert.cc b/sql/sql_insert.cc
--- a/sql/sql_insert.cc 2007-09-24 16:23:37 +03:00
+++ b/sql/sql_insert.cc 2007-09-26 19:06:51 +03:00
@@ -3315,7 +3315,7 @@ static TABLE *create_table_from_items(TH
if (item->result_type() != STRING_RESULT)
field= item->tmp_table_field(&tmp_table);
else
- field= item->tmp_table_field_from_field_type(&tmp_table);
+ field= item->tmp_table_field_from_field_type(&tmp_table, 0);
else
field= create_tmp_field(thd, &tmp_table, item, item->type(),
(Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0,
diff -Nrup a/sql/sql_lex.h b/sql/sql_lex.h
--- a/sql/sql_lex.h 2007-09-12 22:44:47 +03:00
+++ b/sql/sql_lex.h 2007-09-26 19:06:51 +03:00
@@ -259,6 +259,8 @@ public:
key_name.str= str;
key_name.length= length;
}
+
+ void print(THD *thd, String *str);
};
/*
diff -Nrup a/sql/sql_select.cc b/sql/sql_select.cc
--- a/sql/sql_select.cc 2007-09-26 14:20:12 +03:00
+++ b/sql/sql_select.cc 2007-09-26 19:06:51 +03:00
@@ -16044,9 +16044,9 @@ static void print_join(THD *thd, String
/**
- @brief Print an index hint for a table
+ @brief Print an index hint
- @details Prints out the USE|FORCE|IGNORE index hints for a table.
+ @details Prints out the USE|FORCE|IGNORE index hint.
@param thd the current thread
@param[out] str appends the index hint here
@@ -16057,28 +16057,24 @@ static void print_join(THD *thd, String
*/
void
-TABLE_LIST::print_index_hint(THD *thd, String *str,
- const char *hint, uint32 hint_length,
- List<String> indexes)
+Index_hint::print(THD *thd, String *str)
{
- List_iterator_fast<String> li(indexes);
- String *idx;
- bool first= 1;
-
- str->append (' ');
- str->append (hint, hint_length);
+ switch (type)
+ {
+ case INDEX_HINT_IGNORE: str->append(STRING_WITH_LEN("IGNORE INDEX")); break;
+ case INDEX_HINT_USE: str->append(STRING_WITH_LEN("USE INDEX")); break;
+ case INDEX_HINT_FORCE: str->append(STRING_WITH_LEN("FORCE INDEX")); break;
+ }
str->append (STRING_WITH_LEN(" ("));
- while ((idx = li++))
+ if (key_name.length)
{
- if (first)
- first= 0;
- else
- str->append(',');
- if (!my_strcasecmp (system_charset_info, idx->c_ptr_safe(),
- primary_key_name))
+ if (thd && !my_strnncoll(system_charset_info,
+ (const uchar *)key_name.str, key_name.length,
+ (const uchar *)primary_key_name,
+ strlen(primary_key_name)))
str->append(primary_key_name);
else
- append_identifier (thd, str, idx->ptr(), idx->length());
+ append_identifier(thd, str, key_name.str, key_name.length);
}
str->append(')');
}
@@ -16152,16 +16148,17 @@ void TABLE_LIST::print(THD *thd, String
append_identifier(thd, str, alias, strlen(alias));
}
- if (use_index)
+ if (index_hints)
{
- if (force_index)
- print_index_hint(thd, str, STRING_WITH_LEN("FORCE INDEX"), *use_index);
- else
- print_index_hint(thd, str, STRING_WITH_LEN("USE INDEX"), *use_index);
- }
- if (ignore_index)
- print_index_hint (thd, str, STRING_WITH_LEN("IGNORE INDEX"), *ignore_index);
+ List_iterator<Index_hint> it(*index_hints);
+ Index_hint *hint;
+ while ((hint= it++))
+ {
+ str->append (STRING_WITH_LEN(" "));
+ hint->print (thd, str);
+ }
+ }
}
}
diff -Nrup a/sql/table.h b/sql/table.h
--- a/sql/table.h 2007-09-26 14:20:12 +03:00
+++ b/sql/table.h 2007-09-26 19:06:51 +03:00
@@ -1161,8 +1161,6 @@ struct TABLE_LIST
private:
bool prep_check_option(THD *thd, uint8 check_opt_type);
bool prep_where(THD *thd, Item **conds, bool no_where_clause);
- void print_index_hint(THD *thd, String *str, const char *hint,
- uint32 hint_length, List<String>);
/*
Cleanup for re-execution in a prepared statement or a stored
procedure.
| Thread |
|---|
| • bk commit into 5.1 tree (gkodinov:1.2566) | kgeorge | 26 Sep |