3318 Evgeny Potemkin 2010-07-27 [merge]
Auto-merge.
removed:
include/config-win.h
include/my_trie.h
include/my_vle.h
libmysql/dll.c
mysql-test/r/raid.result
mysys/default_modify.c
mysys/make-conf.c
mysys/mf_wfile.c
mysys/my_append.c
mysys/my_clock.c
mysys/my_dup.c
mysys/my_net.c
mysys/my_vle.c
mysys/test_fn.c
mysys/trie.c
sql/sql_map.cc
sql/sql_map.h
sql/sql_olap.cc
strings/bmove512.c
strings/bmove_upp-sparc.s
strings/r_strinstr.c
strings/strappend-sparc.s
strings/strend-sparc.s
strings/strings-not-used.h
strings/strinstr-sparc.s
strings/strinstr.c
strings/strmake-sparc.s
strings/strmov-sparc.s
strings/strnmov-sparc.s
strings/strstr-sparc.s
strings/strxmov-sparc.s
added:
mysql-test/include/ctype_unicode520.inc
mysql-test/suite/innodb/r/innodb_bug54044.result
mysql-test/suite/innodb/t/innodb_bug54044.test
mysql-test/suite/perfschema/include/upgrade_check.inc
mysql-test/suite/perfschema/t/selects-master.opt
packaging/Makefile.am
packaging/WiX/custom_ui.wxs
unittest/gunit/my_regex-t.cc
modified:
BUILD/SETUP.sh
Makefile.am
client/mysql.cc
client/mysqlbinlog.cc
client/mysqldump.c
client/mysqltest.cc
cmake/cpack_source_ignore_files.cmake
cmake/make_dist.cmake.in
cmake/os/WindowsCache.cmake
config.h.cmake
config/ac-macros/character_sets.m4
configure.cmake
configure.in
extra/replace.c
extra/resolve_stack_dump.c
extra/yassl/CMakeLists.txt
extra/yassl/taocrypt/CMakeLists.txt
include/Makefile.am
include/atomic/gcc_builtins.h
include/atomic/nolock.h
include/atomic/x86-gcc.h
include/m_ctype.h
include/m_string.h
include/my_atomic.h
include/my_attribute.h
include/my_bit.h
include/my_bitmap.h
include/my_global.h
include/my_net.h
include/my_nosys.h
include/my_sys.h
include/myisam.h
include/mysql_embed.h
libmysql/Makefile.am
libmysql/Makefile.shared
libmysql/errmsg.c
libmysql/libmysql.c
libmysql_r/Makefile.am
libmysqld/CMakeLists.txt
libmysqld/Makefile.am
mysql-test/collections/default.experimental
mysql-test/r/ctype_ldml.result
mysql-test/r/ctype_uca.result
mysql-test/r/ctype_ucs.result
mysql-test/r/ctype_utf16_uca.result
mysql-test/r/ctype_utf32_uca.result
mysql-test/r/func_regexp.result
mysql-test/r/update.result
mysql-test/std_data/Index.xml
mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result
mysql-test/suite/engines/funcs/t/db_alter_collate_utf8.test
mysql-test/suite/innodb/r/innodb_mysql.result
mysql-test/suite/innodb/t/innodb_mysql.test
mysql-test/suite/perfschema/r/query_cache.result
mysql-test/suite/perfschema/r/selects.result
mysql-test/suite/perfschema/r/server_init.result
mysql-test/suite/perfschema/t/bad_option_1.test
mysql-test/suite/perfschema/t/bad_option_2.test
mysql-test/suite/perfschema/t/global_read_lock.test
mysql-test/suite/perfschema/t/pfs_upgrade.test
mysql-test/suite/perfschema/t/privilege.test
mysql-test/suite/perfschema/t/query_cache.test
mysql-test/suite/perfschema/t/read_only.test
mysql-test/suite/perfschema/t/selects.test
mysql-test/suite/perfschema/t/server_init.test
mysql-test/suite/rpl/r/rpl_do_grant.result
mysql-test/suite/rpl/r/rpl_grant.result
mysql-test/suite/rpl/t/rpl_grant.test
mysql-test/suite/sys_vars/inc/collation_basic.inc
mysql-test/suite/sys_vars/r/collation_connection_basic.result
mysql-test/suite/sys_vars/r/collation_database_basic.result
mysql-test/suite/sys_vars/r/collation_server_basic.result
mysql-test/t/ctype_ldml.test
mysql-test/t/ctype_uca.test
mysql-test/t/ctype_ucs.test
mysql-test/t/ctype_utf16_uca.test
mysql-test/t/ctype_utf32_uca.test
mysql-test/t/func_regexp.test
mysql-test/t/show_check.test
mysql-test/t/update.test
mysys/CMakeLists.txt
mysys/Makefile.am
mysys/charset-def.c
mysys/charset.c
mysys/checksum.c
mysys/default.c
mysys/mf_iocache.c
mysys/mf_iocache2.c
mysys/mf_keycache.c
mysys/my_atomic.c
mysys/my_bit.c
mysys/my_bitmap.c
mysys/my_handler.c
mysys/my_init.c
mysys/my_pthread.c
mysys/my_static.c
mysys/my_static.h
mysys/rijndael.c
mysys/test_charset.c
mysys/thr_alarm.c
packaging/WiX/CMakeLists.txt
packaging/WiX/CPackWixConfig.cmake
packaging/WiX/create_msi.cmake.in
packaging/WiX/extra.wxs.in
packaging/WiX/mysql_server.wxs.in
regex/CMakeLists.txt
regex/engine.c
regex/main.c
regex/my_regex.h
regex/regcomp.c
regex/regcomp.ih
regex/regerror.c
regex/regex2.h
regex/regexec.c
regex/tests
scripts/make_win_bin_dist
sql/CMakeLists.txt
sql/Makefile.am
sql/binlog.cc
sql/field.cc
sql/field.h
sql/field_conv.cc
sql/filesort.cc
sql/gen_lex_hash.cc
sql/ha_partition.cc
sql/ha_partition.h
sql/handler.cc
sql/handler.h
sql/hostname.cc
sql/item_cmpfunc.cc
sql/item_cmpfunc.h
sql/item_geofunc.cc
sql/item_subselect.h
sql/log.h
sql/mysqld.cc
sql/mysqld.h
sql/nt_servc.cc
sql/opt_range.h
sql/protocol.cc
sql/rpl_record.cc
sql/rpl_slave.cc
sql/sql_acl.cc
sql/sql_binlog.cc
sql/sql_class.cc
sql/sql_delete.cc
sql/sql_error.cc
sql/sql_lex.cc
sql/sql_lex.h
sql/sql_parse.cc
sql/sql_plugin.cc
sql/sql_priv.h
sql/sql_select.cc
sql/sql_show.cc
sql/sql_table.cc
sql/sql_update.cc
sql/sys_vars.cc
sql/table.cc
sql/udf_example.c
storage/csv/ha_tina.cc
storage/federated/ha_federated.cc
storage/heap/ha_heap.cc
storage/heap/hp_test2.c
storage/innobase/dict/dict0crea.c
storage/innobase/handler/ha_innodb.cc
storage/innobase/os/os0file.c
storage/myisam/ft_boolean_search.c
storage/myisam/ft_nlq_search.c
storage/myisam/ft_parser.c
storage/myisam/ft_update.c
storage/myisam/mi_check.c
storage/myisam/mi_create.c
storage/myisam/mi_delete_table.c
storage/myisam/mi_dynrec.c
storage/myisam/mi_key.c
storage/myisam/mi_log.c
storage/myisam/mi_open.c
storage/myisam/mi_packrec.c
storage/myisam/mi_rename.c
storage/myisam/mi_static.c
storage/myisam/mi_test1.c
storage/myisam/mi_test2.c
storage/myisam/mi_test3.c
storage/myisam/mi_unique.c
storage/myisam/mi_write.c
storage/myisam/myisam_ftdump.c
storage/myisam/myisamchk.c
storage/myisam/myisamdef.h
storage/myisam/myisamlog.c
storage/myisam/myisampack.c
storage/myisam/rt_test.c
storage/myisam/sp_key.c
storage/myisam/sp_test.c
storage/myisammrg/ha_myisammrg.cc
storage/ndb/include/kernel/signaldata/FsOpenReq.hpp
storage/ndb/include/util/ndb_opts.h
storage/ndb/src/cw/cpcd/main.cpp
storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
storage/ndb/src/kernel/vm/Configuration.cpp
storage/ndb/src/mgmclient/main.cpp
storage/ndb/src/mgmsrv/main.cpp
storage/ndb/src/ndbapi/TransporterFacade.hpp
storage/ndb/test/ndbapi/testIndexStat.cpp
storage/ndb/test/ndbapi/test_event_merge.cpp
storage/ndb/test/ndbapi/test_event_multi_table.cpp
storage/ndb/test/run-test/main.cpp
storage/ndb/test/src/NDBT_Test.cpp
storage/ndb/test/tools/connect.cpp
storage/ndb/tools/delete_all.cpp
storage/ndb/tools/desc.cpp
storage/ndb/tools/drop_index.cpp
storage/ndb/tools/drop_tab.cpp
storage/ndb/tools/listTables.cpp
storage/ndb/tools/ndb_config.cpp
storage/ndb/tools/restore/restore_main.cpp
storage/ndb/tools/select_all.cpp
storage/ndb/tools/select_count.cpp
storage/ndb/tools/waiter.cpp
storage/perfschema/pfs_events_waits.cc
strings/CMakeLists.txt
strings/Makefile.am
strings/bfill.c
strings/bmove.c
strings/bmove_upp.c
strings/conf_to_src.c
strings/ctype-big5.c
strings/ctype-bin.c
strings/ctype-cp932.c
strings/ctype-czech.c
strings/ctype-euc_kr.c
strings/ctype-eucjpms.c
strings/ctype-extra.c
strings/ctype-gb2312.c
strings/ctype-gbk.c
strings/ctype-latin1.c
strings/ctype-mb.c
strings/ctype-simple.c
strings/ctype-sjis.c
strings/ctype-tis620.c
strings/ctype-uca.c
strings/ctype-ucs2.c
strings/ctype-ujis.c
strings/ctype-utf8.c
strings/ctype-win1250ch.c
strings/ctype.c
strings/do_ctype.c
strings/str_test.c
strings/strcend.c
strings/strend.c
strings/string.doc
strings/strings-x86.s
strings/strmov.c
strings/uca-dump.c
tests/mysql_client_test.c
tests/thread_test.c
unittest/gunit/CMakeLists.txt
unittest/gunit/gunit_test_main.cc
unittest/gunit/thread_utils.cc
unittest/gunit/thread_utils.h
unittest/mysys/my_atomic-t.c
unittest/mytap/tap.c
=== modified file 'mysql-test/suite/ndb/t/disabled.def'
--- a/mysql-test/suite/ndb/t/disabled.def 2010-07-02 06:23:00 +0000
+++ b/mysql-test/suite/ndb/t/disabled.def 2010-07-27 08:29:26 +0000
@@ -11,7 +11,6 @@
##############################################################################
ndb_binlog_discover : Bug#54851 2010-07-02 alik ndb.ndb_binlog_discover crashes the server
-ndb_condition_pushdown : Bug#49746 2010-02-08 alik ndb_condition_pushdown fails in mysql-next-mr
ndb_partition_error2 : Bug#40989 ndb_partition_error2 needs maintenance
=== modified file 'sql/ha_ndbcluster_cond.cc'
--- a/sql/ha_ndbcluster_cond.cc 2010-07-02 18:15:21 +0000
+++ b/sql/ha_ndbcluster_cond.cc 2010-07-27 08:29:26 +0000
@@ -34,6 +34,110 @@
typedef NdbDictionary::Column NDBCOL;
typedef NdbDictionary::Table NDBTAB;
+
+/**
+ Serialize a constant item into a Ndb_cond node.
+
+ @param const_type item's result type
+ @param item item to be serialized
+ @param curr_cond Ndb_cond node the item to be serialized into
+ @param context Traverse context
+*/
+
+static void ndb_serialize_const(Item_result const_type, const Item *item,
+ Ndb_cond *curr_cond,
+ Ndb_cond_traverse_context *context)
+{
+ DBUG_ASSERT(item->const_item());
+ switch (const_type) {
+ case STRING_RESULT:
+ {
+ NDB_ITEM_QUALIFICATION q;
+ q.value_type= Item::STRING_ITEM;
+ curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
+ if (! context->expecting_no_field_result())
+ {
+ // We have not seen the field argument yet
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect_only_field_result(STRING_RESULT);
+ context->expect_collation(item->collation.collation);
+ }
+ else
+ {
+ // Expect another logical expression
+ context->expect_only(Item::FUNC_ITEM);
+ context->expect(Item::COND_ITEM);
+ // Check that string result have correct collation
+ if (!context->expecting_collation(item->collation.collation))
+ {
+ DBUG_PRINT("info", ("Found non-matching collation %s",
+ item->collation.collation->name));
+ context->supported= FALSE;
+ }
+ }
+ break;
+ }
+ case REAL_RESULT:
+ {
+ NDB_ITEM_QUALIFICATION q;
+ q.value_type= Item::REAL_ITEM;
+ curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
+ if (! context->expecting_no_field_result())
+ {
+ // We have not seen the field argument yet
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect_only_field_result(REAL_RESULT);
+ }
+ else
+ {
+ // Expect another logical expression
+ context->expect_only(Item::FUNC_ITEM);
+ context->expect(Item::COND_ITEM);
+ }
+ break;
+ }
+ case INT_RESULT:
+ {
+ NDB_ITEM_QUALIFICATION q;
+ q.value_type= Item::INT_ITEM;
+ curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
+ if (! context->expecting_no_field_result())
+ {
+ // We have not seen the field argument yet
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect_only_field_result(INT_RESULT);
+ }
+ else
+ {
+ // Expect another logical expression
+ context->expect_only(Item::FUNC_ITEM);
+ context->expect(Item::COND_ITEM);
+ }
+ break;
+ }
+ case DECIMAL_RESULT:
+ {
+ NDB_ITEM_QUALIFICATION q;
+ q.value_type= Item::DECIMAL_ITEM;
+ curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
+ if (! context->expecting_no_field_result())
+ {
+ // We have not seen the field argument yet
+ context->expect_only(Item::FIELD_ITEM);
+ context->expect_only_field_result(DECIMAL_RESULT);
+ }
+ else
+ {
+ // Expect another logical expression
+ context->expect_only(Item::FUNC_ITEM);
+ context->expect(Item::COND_ITEM);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+}
/*
Serialize the item tree into a linked list represented by Ndb_cond
for fast generation of NbdScanFilter. Adds information such as
@@ -112,7 +216,7 @@ void ndb_serialize_cond(const Item *item
to ndb_serialize_cond and end of rewrite statement
is wrapped in end of ndb_serialize_cond
*/
- if (context->expecting(item->type()))
+ if (context->expecting(item->type()) || item->const_item())
{
// This is the <field>|<const> item, save it in the rewrite context
rewrite_context2->left_hand_item= item;
@@ -596,108 +700,12 @@ void ndb_serialize_cond(const Item *item
DBUG_PRINT("info", ("result type %d", func_item->result_type()));
if (func_item->const_item())
{
- switch (func_item->result_type()) {
- case STRING_RESULT:
- {
- NDB_ITEM_QUALIFICATION q;
- q.value_type= Item::STRING_ITEM;
- curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
- if (! context->expecting_no_field_result())
- {
- // We have not seen the field argument yet
- context->expect_only(Item::FIELD_ITEM);
- context->expect_only_field_result(STRING_RESULT);
- context->expect_collation(func_item->collation.collation);
- }
- else
- {
- // Expect another logical expression
- context->expect_only(Item::FUNC_ITEM);
- context->expect(Item::COND_ITEM);
- // Check that string result have correct collation
- if (!context->expecting_collation(item->collation.collation))
- {
- DBUG_PRINT("info", ("Found non-matching collation %s",
- item->collation.collation->name));
- context->supported= FALSE;
- }
- }
- // Skip any arguments since we will evaluate function instead
- DBUG_PRINT("info", ("Skip until end of arguments marker"));
- context->skip= func_item->argument_count();
- break;
- }
- case REAL_RESULT:
- {
- NDB_ITEM_QUALIFICATION q;
- q.value_type= Item::REAL_ITEM;
- curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
- if (! context->expecting_no_field_result())
- {
- // We have not seen the field argument yet
- context->expect_only(Item::FIELD_ITEM);
- context->expect_only_field_result(REAL_RESULT);
- }
- else
- {
- // Expect another logical expression
- context->expect_only(Item::FUNC_ITEM);
- context->expect(Item::COND_ITEM);
- }
-
- // Skip any arguments since we will evaluate function instead
- DBUG_PRINT("info", ("Skip until end of arguments marker"));
- context->skip= func_item->argument_count();
- break;
- }
- case INT_RESULT:
- {
- NDB_ITEM_QUALIFICATION q;
- q.value_type= Item::INT_ITEM;
- curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
- if (! context->expecting_no_field_result())
- {
- // We have not seen the field argument yet
- context->expect_only(Item::FIELD_ITEM);
- context->expect_only_field_result(INT_RESULT);
- }
- else
- {
- // Expect another logical expression
- context->expect_only(Item::FUNC_ITEM);
- context->expect(Item::COND_ITEM);
- }
-
- // Skip any arguments since we will evaluate function instead
- DBUG_PRINT("info", ("Skip until end of arguments marker"));
- context->skip= func_item->argument_count();
- break;
- }
- case DECIMAL_RESULT:
- {
- NDB_ITEM_QUALIFICATION q;
- q.value_type= Item::DECIMAL_ITEM;
- curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
- if (! context->expecting_no_field_result())
- {
- // We have not seen the field argument yet
- context->expect_only(Item::FIELD_ITEM);
- context->expect_only_field_result(DECIMAL_RESULT);
- }
- else
- {
- // Expect another logical expression
- context->expect_only(Item::FUNC_ITEM);
- context->expect(Item::COND_ITEM);
- }
- // Skip any arguments since we will evaluate function instead
- DBUG_PRINT("info", ("Skip until end of arguments marker"));
- context->skip= func_item->argument_count();
- break;
- }
- default:
- break;
- }
+ ndb_serialize_const(func_item->result_type(), item, curr_cond,
+ context);
+
+ // Skip any arguments since we will evaluate function instead
+ DBUG_PRINT("info", ("Skip until end of arguments marker"));
+ context->skip= func_item->argument_count();
}
else
// Function does not return constant expression
@@ -882,6 +890,19 @@ void ndb_serialize_cond(const Item *item
}
break;
}
+ case Item::CACHE_ITEM:
+ {
+ DBUG_PRINT("info", ("CACHE_ITEM"));
+ if (item->const_item())
+ {
+ ndb_serialize_const(((Item_cache*)item)->result_type(), item,
+ curr_cond, context);
+ }
+ else
+ context->supported= FALSE;
+
+ break;
+ }
default:
{
DBUG_PRINT("info", ("Found item of type %d", item->type()));
=== modified file 'sql/item.cc'
--- a/sql/item.cc 2010-07-20 04:22:14 +0000
+++ b/sql/item.cc 2010-07-27 08:29:26 +0000
@@ -5932,7 +5932,8 @@ bool Item::cache_const_expr_analyzer(uch
a subselect (they use their own cache).
*/
if (const_item() &&
- !(item->basic_const_item() || item->type() == Item::FIELD_ITEM ||
+ !(basic_const_item() || item->basic_const_item() ||
+ item->type() == Item::FIELD_ITEM ||
item->type() == SUBSELECT_ITEM ||
/*
Do not cache GET_USER_VAR() function as its const_item() may
=== modified file 'sql/item.h'
--- a/sql/item.h 2010-07-20 04:22:14 +0000
+++ b/sql/item.h 2010-07-27 08:29:26 +0000
@@ -3266,6 +3266,12 @@ public:
bool basic_const_item() const
{ return test(example && example->basic_const_item());}
virtual void clear() { null_value= TRUE; value_cached= FALSE; }
+ Item_result result_type()
+ {
+ if (!example)
+ return INT_RESULT;
+ return Field::result_merge_type(example->field_type());
+ }
};
@@ -3335,7 +3341,9 @@ public:
is_varbinary(item->type() == FIELD_ITEM &&
cached_field_type == MYSQL_TYPE_VARCHAR &&
!((const Item_field *) item)->field->has_charset())
- {}
+ {
+ collation.set(const_cast<DTCollation&>(item->collation));
+ }
double val_real();
longlong val_int();
String* val_str(String *);
Attachment: [text/bzr-bundle] bzr/epotemkin@mysql.com-20100727083632-3y00a5fqjhlilo07.bundle
| Thread |
|---|
| • bzr push into mysql-next-mr-bugfixing branch (epotemkin:3318) | Evgeny Potemkin | 27 Jul |