From 1fbf8458f8fdabf25e42e0d9c2c3eb0b345b152c Mon Sep 17 00:00:00 2001
From: Sergei Golubchik <sergii@pisem.net>
Date: Wed, 24 Mar 2010 23:12:39 +0100
Subject: [PATCH 1/5] two crashes in the TC_LOG_MMAP: 1. don't forget to
 initialize page->ptr 2. don't signal active->cond, if active is NULL

---
 mysql-test/suite/pbxt/r/pbxt_xa.result | 18 ++++++++++++++++++
 mysql-test/suite/pbxt/t/pbxt_xa.test   | 23 +++++++++++++++++++++++
 sql/log.cc                             | 12 ++++++++++--
 3 files changed, 51 insertions(+), 2 deletions(-)
 create mode 100644 mysql-test/suite/pbxt/r/pbxt_xa.result
 create mode 100644 mysql-test/suite/pbxt/t/pbxt_xa.test

diff --git a/mysql-test/suite/pbxt/r/pbxt_xa.result b/mysql-test/suite/pbxt/r/pbxt_xa.result
new file mode 100644
index 00000000000..8bcab926998
--- /dev/null
+++ b/mysql-test/suite/pbxt/r/pbxt_xa.result
@@ -0,0 +1,18 @@
+drop table if exists t1, t2;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
+CREATE TABLE t2 (b INT PRIMARY KEY) ENGINE=pbxt;
+BEGIN;
+SELECT @@log_bin;
+@@log_bin
+0
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2);
+COMMIT;
+select * from t1;
+a
+1
+select * from t2;
+b
+2
+drop table t1, t2;
+drop database pbxt;
diff --git a/mysql-test/suite/pbxt/t/pbxt_xa.test b/mysql-test/suite/pbxt/t/pbxt_xa.test
new file mode 100644
index 00000000000..a9d1c5c38e8
--- /dev/null
+++ b/mysql-test/suite/pbxt/t/pbxt_xa.test
@@ -0,0 +1,23 @@
+-- source include/have_innodb.inc
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+
+#
+# bug lp:544173, xa crash with two 2pc-capable storage engines without binlog
+#
+
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
+CREATE TABLE t2 (b INT PRIMARY KEY) ENGINE=pbxt;
+BEGIN;
+# verify that binlog is off
+SELECT @@log_bin;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2);
+COMMIT;
+select * from t1;
+select * from t2;
+drop table t1, t2;
+drop database pbxt;
+
diff --git a/sql/log.cc b/sql/log.cc
index 95b38f7ccd7..6d0314b1d19 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -5387,7 +5387,7 @@ int TC_LOG_MMAP::open(const char *opt_name)
     pg->state=POOL;
     pthread_mutex_init(&pg->lock, MY_MUTEX_INIT_FAST);
     pthread_cond_init (&pg->cond, 0);
-    pg->start=(my_xid *)(data + i*tc_log_page_size);
+    pg->ptr= pg->start=(my_xid *)(data + i*tc_log_page_size);
     pg->size=pg->free=tc_log_page_size/sizeof(my_xid);
     pg->end=pg->start + pg->size;
   }
@@ -5622,7 +5622,15 @@ int TC_LOG_MMAP::sync()
   /* marking 'syncing' slot free */
   pthread_mutex_lock(&LOCK_sync);
   syncing=0;
-  pthread_cond_signal(&active->cond);        // wake up a new syncer
+  /*
+    we check the "active" pointer without LOCK_active. Still, it's safe -
+    "active" can change from NULL to not NULL any time, but it
+    will take LOCK_sync before waiting on active->cond. That is, it can never
+    miss a signal.
+    And "active" can change to NULL only after LOCK_sync, so this is safe too.
+  */
+  if (active)
+    pthread_cond_signal(&active->cond);      // wake up a new syncer
   pthread_mutex_unlock(&LOCK_sync);
   return err;
 }

From 1fec5af772809d4d67ebc3c84286bc4956b80773 Mon Sep 17 00:00:00 2001
From: Michael Widenius <monty@askmonty.org>
Date: Sun, 28 Mar 2010 21:10:00 +0300
Subject: [PATCH 2/5] Fixed compiler warnings and sporadic failures in test
 cases

mysql-test/extra/rpl_tests/rpl_tmp_table_and_DDL.test:
  Added missing sync_slave_with_master; Fixes random failures
mysql-test/include/default_mysqld.cnf:
  default-character-set -> character-set-server (removes warning in error files for usage of deprecated options)
mysql-test/lib/My/SafeProcess/safe_process.cc:
  Fixed compiler warning
mysql-test/lib/v1/mysql-test-run.pl:
  default-character-set -> character-set-server (removes warning in error files for usage of deprecated options)
mysql-test/suite/rpl/r/rpl_do_grant.result:
  Updated test results
mysql-test/suite/rpl/t/rpl_do_grant.test:
  Added missing sync_slave_with_master; Fixes random failures
  Had to explictely do stop slave before DROP USER to avoid failure on slave as the user is already dropped on slave.
mysql-test/suite/rpl/t/rpl_name_const.test:
  Added missing sync_slave_with_master; Fixes random failures
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
  Added missing sync_slave_with_master; Fixes random failures
mysql-test/t/bug47671-master.opt:
  default-character-set -> character-set-server (removes warning in error files for usage of deprecated options)
mysql-test/t/ctype_latin1_de-master.opt:
  default-character-set -> character-set-server (removes warning in error files for usage of deprecated options)
mysql-test/t/ctype_ucs2_def-master.opt:
  default-character-set -> character-set-server (removes warning in error files for usage of deprecated options)
sql-common/client.c:
  Fixed compiler warning
sql/item.cc:
  Renamed function to remove compiler warnings (with gcc)
sql/item.h:
  Renamed function to remove compiler warnings (with gcc)
sql/item_cmpfunc.cc:
  Renamed function to remove compiler warnings (with gcc)
sql/item_create.cc:
  Renamed function to remove compiler warnings (with gcc)
sql/item_create.h:
  Renamed function to remove compiler warnings (with gcc)
sql/item_sum.cc:
  Renamed function to remove compiler warnings (with gcc)
sql/item_sum.h:
  Renamed function to remove compiler warnings (with gcc)
sql/set_var.cc:
  Don't use bit_do_set() / bot_is_set() / bit_do_clear() as this generates compiler warnings
  (They are also of no use as we know the value can hold the bits)
sql/sql_yacc.yy:
  Renamed function to remove compiler warnings (with gcc)
storage/example/ha_example.h:
  Fixed old read_time() prototype
storage/maria/ma_search.c:
  Added extra variables to remove compiler warnings
storage/maria/maria_def.h:
  Added extra variables to remove compiler warnings
storage/myisam/ft_stopwords.c:
  Added cast to get rid of compiler warning
storage/xtradb/fil/fil0fil.c:
  Added cast to get rid of compiler warning
storage/xtradb/include/page0page.h:
  Added const to get rid of compiler warning
storage/xtradb/include/page0page.ic:
  Added const to get rid of compiler warning
support-files/compiler_warnings.supp:
  Added suppression of strict-aliasing
---
 .../rpl_tests/rpl_tmp_table_and_DDL.test      |   1 +
 mysql-test/include/default_mysqld.cnf         |   2 +-
 mysql-test/lib/My/SafeProcess/safe_process.cc |   2 +-
 mysql-test/lib/v1/mysql-test-run.pl           |   2 +-
 mysql-test/suite/rpl/r/rpl_do_grant.result    |   5 +-
 mysql-test/suite/rpl/t/rpl_do_grant.test      |  12 +-
 mysql-test/suite/rpl/t/rpl_name_const.test    |   1 +
 .../suite/rpl/t/rpl_row_basic_11bugs.test     |   1 +
 mysql-test/t/bug47671-master.opt              |   2 +-
 mysql-test/t/ctype_latin1_de-master.opt       |   2 +-
 mysql-test/t/ctype_ucs2_def-master.opt        |   2 +-
 sql-common/client.c                           |   2 +-
 sql/item.cc                                   |   2 +-
 sql/item.h                                    |   2 +-
 sql/item_cmpfunc.cc                           |   8 +-
 sql/item_create.cc                            | 518 +++++++++---------
 sql/item_create.h                             |   5 +-
 sql/item_sum.cc                               |   8 +-
 sql/item_sum.h                                |   2 +-
 sql/set_var.cc                                |  19 +-
 sql/sql_yacc.yy                               |   2 +-
 storage/example/ha_example.h                  |   3 +-
 storage/maria/ma_search.c                     |   8 +-
 storage/maria/maria_def.h                     |   6 +-
 storage/myisam/ft_stopwords.c                 |   7 +-
 storage/xtradb/fil/fil0fil.c                  |   2 +-
 storage/xtradb/include/page0page.h            |   2 +-
 storage/xtradb/include/page0page.ic           |   2 +-
 support-files/compiler_warnings.supp          |   5 +
 29 files changed, 327 insertions(+), 308 deletions(-)

diff --git a/mysql-test/extra/rpl_tests/rpl_tmp_table_and_DDL.test b/mysql-test/extra/rpl_tests/rpl_tmp_table_and_DDL.test
index 9cf287281a0..cb1639a04ac 100644
--- a/mysql-test/extra/rpl_tests/rpl_tmp_table_and_DDL.test
+++ b/mysql-test/extra/rpl_tests/rpl_tmp_table_and_DDL.test
@@ -157,3 +157,4 @@ INSERT INTO t1 VALUES (1);
 
 DROP TEMPORARY TABLE t1;
 
+--sync_slave_with_master
diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf
index ad0090aaf36..c93762f6c25 100644
--- a/mysql-test/include/default_mysqld.cnf
+++ b/mysql-test/include/default_mysqld.cnf
@@ -2,7 +2,7 @@
 [mysqld]
 open-files-limit=           1024
 local-infile
-default-character-set=      latin1
+character-set-server=      latin1
 
 # Increase default connect_timeout to avoid intermittent
 # disconnects when test servers are put under load see BUG#28359
diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc
index 50c433b9b39..f9da9560693 100644
--- a/mysql-test/lib/My/SafeProcess/safe_process.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_process.cc
@@ -159,7 +159,7 @@ int main(int argc, char* const argv[] )
   signal(SIGCHLD, handle_signal);
   signal(SIGABRT, handle_abort);
 
-  sprintf(safe_process_name, "safe_process[%d]", own_pid);
+  sprintf(safe_process_name, "safe_process[%d]", (int) own_pid);
 
   message("Started");
 
diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl
index fe0e1321b8c..998555d76d1 100755
--- a/mysql-test/lib/v1/mysql-test-run.pl
+++ b/mysql-test/lib/v1/mysql-test-run.pl
@@ -3965,7 +3965,7 @@ sub mysqld_arguments ($$$$) {
     }
   }
 
-  mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
+  mtr_add_arg($args, "%s--character-set-server-set=latin1", $prefix);
   mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
   mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
 
diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result
index 65c60acc651..d26a81cb396 100644
--- a/mysql-test/suite/rpl/r/rpl_do_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_do_grant.result
@@ -165,10 +165,9 @@ USE bug42217_db;
 DROP FUNCTION upgrade_del_func;
 DROP FUNCTION upgrade_alter_func;
 DROP DATABASE bug42217_db;
+call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
+stop slave;
 DROP USER 'create_rout_db'@'localhost';
-call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
-USE mtr;
-call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
 ######## BUG#49119 #######
 ### i) test case from the 'how to repeat section'
 stop slave;
diff --git a/mysql-test/suite/rpl/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test
index 6ae15850cae..8403e108b19 100644
--- a/mysql-test/suite/rpl/t/rpl_do_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_do_grant.test
@@ -209,12 +209,18 @@ USE bug42217_db;
 DROP FUNCTION upgrade_del_func;
 DROP FUNCTION upgrade_alter_func;
 DROP DATABASE bug42217_db;
-DROP USER 'create_rout_db'@'localhost';
 
 call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
+
+sync_slave_with_master;
+
+# Drop the user that was already dropped on the slave
 connection slave;
-USE mtr;
-call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
+--disable_warnings
+stop slave;
+connection master;
+DROP USER 'create_rout_db'@'localhost';
+--enable_warnings
 
 # BUG#49119: Master crashes when executing 'REVOKE ... ON
 # {PROCEDURE|FUNCTION} FROM ...'
diff --git a/mysql-test/suite/rpl/t/rpl_name_const.test b/mysql-test/suite/rpl/t/rpl_name_const.test
index adb71d452ef..d3ef557ddc0 100644
--- a/mysql-test/suite/rpl/t/rpl_name_const.test
+++ b/mysql-test/suite/rpl/t/rpl_name_const.test
@@ -45,3 +45,4 @@ select * from t1 order by id;
 connection master;
 drop table t1;
 drop procedure test_procedure;
+--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
index 5904585a050..2ee7c62f282 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
@@ -53,6 +53,7 @@ UPDATE t1 SET a=99 WHERE a = 0;
 SHOW BINLOG EVENTS;
 
 DROP TABLE t1;
+--sync_slave_with_master
 
 # BUG#17620: Replicate (Row Based) Fails when Query Cache enabled on
 # slave
diff --git a/mysql-test/t/bug47671-master.opt b/mysql-test/t/bug47671-master.opt
index 0afdf49e022..ad54fbc3467 100644
--- a/mysql-test/t/bug47671-master.opt
+++ b/mysql-test/t/bug47671-master.opt
@@ -1 +1 @@
---default-character-set=utf8 --skip-character-set-client-handshake
+--character-set-server=utf8 --skip-character-set-client-handshake
diff --git a/mysql-test/t/ctype_latin1_de-master.opt b/mysql-test/t/ctype_latin1_de-master.opt
index 79fdb1c63dc..063fe5b7792 100644
--- a/mysql-test/t/ctype_latin1_de-master.opt
+++ b/mysql-test/t/ctype_latin1_de-master.opt
@@ -1 +1 @@
---default-character-set=latin1 --default-collation=latin1_german2_ci
+--character-set-server=latin1 --default-collation=latin1_german2_ci
diff --git a/mysql-test/t/ctype_ucs2_def-master.opt b/mysql-test/t/ctype_ucs2_def-master.opt
index 84d2a52b639..d42c50f3c7e 100644
--- a/mysql-test/t/ctype_ucs2_def-master.opt
+++ b/mysql-test/t/ctype_ucs2_def-master.opt
@@ -1 +1 @@
---default-collation=ucs2_unicode_ci --default-character-set=ucs2,latin1
+--default-collation=ucs2_unicode_ci --character-set-server=ucs2,latin1
diff --git a/sql-common/client.c b/sql-common/client.c
index e09d94b34be..d29f6647255 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1863,7 +1863,6 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
 		       uint port, const char *unix_socket,ulong client_flag)
 {
   char		buff[NAME_LEN+USERNAME_LENGTH+100];
-  char		error_string[1024];
   char		*end,*host_info= NULL;
   my_socket	sock;
   in_addr_t	ip_addr;
@@ -2304,6 +2303,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
     /* Do the SSL layering. */
     struct st_mysql_options *options= &mysql->options;
     struct st_VioSSLFd *ssl_fd;
+    char error_string[1024];
 
     /*
       Send client_flag, max_packet_size - unencrypted otherwise
diff --git a/sql/item.cc b/sql/item.cc
index 68a9b853af5..cf0d6615999 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -7010,7 +7010,7 @@ bool  Item_cache_int::cache_value()
 }
 
 
-void Item_cache_int::store(Item *item, longlong val_arg)
+void Item_cache_int::store_longlong(Item *item, longlong val_arg)
 {
   /* An explicit values is given, save it. */
   value_cached= TRUE;
diff --git a/sql/item.h b/sql/item.h
index b8e7bf9f65c..beed859a2c7 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -3045,7 +3045,7 @@ public:
   Item_cache_int(enum_field_types field_type_arg):
     Item_cache(field_type_arg), value(0) {}
 
-  void store(Item *item, longlong val_arg);
+  void store_longlong(Item *item, longlong val_arg);
   double val_real();
   longlong val_int();
   String* val_str(String *str);
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index fcd9ebdc938..3431c84b6d1 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -879,7 +879,7 @@ get_time_value(THD *thd, Item ***item_arg, Item **cache_arg,
     Item_cache_int *cache= new Item_cache_int();
     /* Mark the cache as non-const to prevent re-caching. */
     cache->set_used_tables(1);
-    cache->store(item, value);
+    cache->store_longlong(item, value);
     *cache_arg= cache;
     *item_arg= cache_arg;
   }
@@ -917,13 +917,13 @@ int Arg_comparator::set_cmp_func(Item_result_field *owner_arg,
       cache->set_used_tables(1);
       if (!(*a)->is_datetime())
       {
-        cache->store((*a), const_value);
+        cache->store_longlong((*a), const_value);
         a_cache= cache;
         a= (Item **)&a_cache;
       }
       else
       {
-        cache->store((*b), const_value);
+        cache->store_longlong((*b), const_value);
         b_cache= cache;
         b= (Item **)&b_cache;
       }
@@ -1145,7 +1145,7 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
     Item_cache_int *cache= new Item_cache_int(MYSQL_TYPE_DATETIME);
     /* Mark the cache as non-const to prevent re-caching. */
     cache->set_used_tables(1);
-    cache->store(item, value);
+    cache->store_longlong(item, value);
     *cache_arg= cache;
     *item_arg= cache_arg;
   }
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 89dbdd98262..9a6cde1957d 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -101,7 +101,7 @@ public:
     @param arg1 The first argument of the function
     @return An item representing the function call
   */
-  virtual Item *create(THD *thd, Item *arg1) = 0;
+  virtual Item *create_1_arg(THD *thd, Item *arg1) = 0;
 
 protected:
   /** Constructor. */
@@ -127,7 +127,7 @@ public:
     @param arg2 The second argument of the function
     @return An item representing the function call
   */
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2) = 0;
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) = 0;
 
 protected:
   /** Constructor. */
@@ -154,7 +154,7 @@ public:
     @param arg3 The third argument of the function
     @return An item representing the function call
   */
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3) = 0;
+  virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3) = 0;
 
 protected:
   /** Constructor. */
@@ -171,8 +171,8 @@ protected:
 class Create_sp_func : public Create_qfunc
 {
 public:
-  virtual Item *create(THD *thd, LEX_STRING db, LEX_STRING name,
-                       bool use_explicit_name, List<Item> *item_list);
+  virtual Item *create_with_db(THD *thd, LEX_STRING db, LEX_STRING name,
+                               bool use_explicit_name, List<Item> *item_list);
 
   static Create_sp_func s_singleton;
 
@@ -217,7 +217,7 @@ protected:
 class Create_func_abs : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_abs s_singleton;
 
@@ -230,7 +230,7 @@ protected:
 class Create_func_acos : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_acos s_singleton;
 
@@ -243,7 +243,7 @@ protected:
 class Create_func_addtime : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_addtime s_singleton;
 
@@ -256,7 +256,7 @@ protected:
 class Create_func_aes_encrypt : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_aes_encrypt s_singleton;
 
@@ -269,7 +269,7 @@ protected:
 class Create_func_aes_decrypt : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_aes_decrypt s_singleton;
 
@@ -283,7 +283,7 @@ protected:
 class Create_func_area : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_area s_singleton;
 
@@ -298,7 +298,7 @@ protected:
 class Create_func_as_wkb : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_as_wkb s_singleton;
 
@@ -313,7 +313,7 @@ protected:
 class Create_func_as_wkt : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_as_wkt s_singleton;
 
@@ -327,7 +327,7 @@ protected:
 class Create_func_asin : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_asin s_singleton;
 
@@ -353,7 +353,7 @@ protected:
 class Create_func_benchmark : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_benchmark s_singleton;
 
@@ -366,7 +366,7 @@ protected:
 class Create_func_bin : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_bin s_singleton;
 
@@ -379,7 +379,7 @@ protected:
 class Create_func_bit_count : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_bit_count s_singleton;
 
@@ -392,7 +392,7 @@ protected:
 class Create_func_bit_length : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_bit_length s_singleton;
 
@@ -405,7 +405,7 @@ protected:
 class Create_func_ceiling : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_ceiling s_singleton;
 
@@ -419,7 +419,7 @@ protected:
 class Create_func_centroid : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_centroid s_singleton;
 
@@ -433,7 +433,7 @@ protected:
 class Create_func_char_length : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_char_length s_singleton;
 
@@ -446,7 +446,7 @@ protected:
 class Create_func_coercibility : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_coercibility s_singleton;
 
@@ -459,7 +459,7 @@ protected:
 class Create_func_compress : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_compress s_singleton;
 
@@ -512,7 +512,7 @@ protected:
 class Create_func_contains : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_contains s_singleton;
 
@@ -526,7 +526,7 @@ protected:
 class Create_func_conv : public Create_func_arg3
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
+  virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3);
 
   static Create_func_conv s_singleton;
 
@@ -539,7 +539,7 @@ protected:
 class Create_func_convert_tz : public Create_func_arg3
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
+  virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3);
 
   static Create_func_convert_tz s_singleton;
 
@@ -552,7 +552,7 @@ protected:
 class Create_func_cos : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_cos s_singleton;
 
@@ -565,7 +565,7 @@ protected:
 class Create_func_cot : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_cot s_singleton;
 
@@ -578,7 +578,7 @@ protected:
 class Create_func_crc32 : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_crc32 s_singleton;
 
@@ -592,7 +592,7 @@ protected:
 class Create_func_crosses : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_crosses s_singleton;
 
@@ -606,7 +606,7 @@ protected:
 class Create_func_date_format : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_date_format s_singleton;
 
@@ -619,7 +619,7 @@ protected:
 class Create_func_datediff : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_datediff s_singleton;
 
@@ -632,7 +632,7 @@ protected:
 class Create_func_dayname : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_dayname s_singleton;
 
@@ -645,7 +645,7 @@ protected:
 class Create_func_dayofmonth : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_dayofmonth s_singleton;
 
@@ -658,7 +658,7 @@ protected:
 class Create_func_dayofweek : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_dayofweek s_singleton;
 
@@ -671,7 +671,7 @@ protected:
 class Create_func_dayofyear : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_dayofyear s_singleton;
 
@@ -684,7 +684,7 @@ protected:
 class Create_func_decode : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_decode s_singleton;
 
@@ -697,7 +697,7 @@ protected:
 class Create_func_degrees : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_degrees s_singleton;
 
@@ -737,7 +737,7 @@ protected:
 class Create_func_dimension : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_dimension s_singleton;
 
@@ -752,7 +752,7 @@ protected:
 class Create_func_disjoint : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_disjoint s_singleton;
 
@@ -779,7 +779,7 @@ protected:
 class Create_func_encode : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_encode s_singleton;
 
@@ -806,7 +806,7 @@ protected:
 class Create_func_endpoint : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_endpoint s_singleton;
 
@@ -821,7 +821,7 @@ protected:
 class Create_func_envelope : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_envelope s_singleton;
 
@@ -836,7 +836,7 @@ protected:
 class Create_func_equals : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_equals s_singleton;
 
@@ -850,7 +850,7 @@ protected:
 class Create_func_exp : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_exp s_singleton;
 
@@ -877,7 +877,7 @@ protected:
 class Create_func_exteriorring : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_exteriorring s_singleton;
 
@@ -904,7 +904,7 @@ protected:
 class Create_func_find_in_set : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_find_in_set s_singleton;
 
@@ -917,7 +917,7 @@ protected:
 class Create_func_floor : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_floor s_singleton;
 
@@ -930,7 +930,7 @@ protected:
 class Create_func_format : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_format s_singleton;
 
@@ -956,7 +956,7 @@ protected:
 class Create_func_from_days : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_from_days s_singleton;
 
@@ -1013,7 +1013,7 @@ protected:
 class Create_func_geometry_type : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_geometry_type s_singleton;
 
@@ -1028,7 +1028,7 @@ protected:
 class Create_func_geometryn : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_geometryn s_singleton;
 
@@ -1042,7 +1042,7 @@ protected:
 class Create_func_get_lock : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_get_lock s_singleton;
 
@@ -1056,7 +1056,7 @@ protected:
 class Create_func_glength : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_glength s_singleton;
 
@@ -1083,7 +1083,7 @@ protected:
 class Create_func_hex : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_hex s_singleton;
 
@@ -1096,7 +1096,7 @@ protected:
 class Create_func_ifnull : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_ifnull s_singleton;
 
@@ -1109,7 +1109,7 @@ protected:
 class Create_func_inet_ntoa : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_inet_ntoa s_singleton;
 
@@ -1122,7 +1122,7 @@ protected:
 class Create_func_inet_aton : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_inet_aton s_singleton;
 
@@ -1135,7 +1135,7 @@ protected:
 class Create_func_instr : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_instr s_singleton;
 
@@ -1149,7 +1149,7 @@ protected:
 class Create_func_interiorringn : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_interiorringn s_singleton;
 
@@ -1164,7 +1164,7 @@ protected:
 class Create_func_intersects : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_intersects s_singleton;
 
@@ -1178,7 +1178,7 @@ protected:
 class Create_func_is_free_lock : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_is_free_lock s_singleton;
 
@@ -1191,7 +1191,7 @@ protected:
 class Create_func_is_used_lock : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_is_used_lock s_singleton;
 
@@ -1205,7 +1205,7 @@ protected:
 class Create_func_isclosed : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_isclosed s_singleton;
 
@@ -1220,7 +1220,7 @@ protected:
 class Create_func_isempty : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_isempty s_singleton;
 
@@ -1234,7 +1234,7 @@ protected:
 class Create_func_isnull : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_isnull s_singleton;
 
@@ -1248,7 +1248,7 @@ protected:
 class Create_func_issimple : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_issimple s_singleton;
 
@@ -1262,7 +1262,7 @@ protected:
 class Create_func_last_day : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_last_day s_singleton;
 
@@ -1288,7 +1288,7 @@ protected:
 class Create_func_lcase : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_lcase s_singleton;
 
@@ -1314,7 +1314,7 @@ protected:
 class Create_func_length : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_length s_singleton;
 
@@ -1327,7 +1327,7 @@ protected:
 class Create_func_ln : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_ln s_singleton;
 
@@ -1340,7 +1340,7 @@ protected:
 class Create_func_load_file : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_load_file s_singleton;
 
@@ -1379,7 +1379,7 @@ protected:
 class Create_func_log10 : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_log10 s_singleton;
 
@@ -1392,7 +1392,7 @@ protected:
 class Create_func_log2 : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_log2 s_singleton;
 
@@ -1405,7 +1405,7 @@ protected:
 class Create_func_lpad : public Create_func_arg3
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
+  virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3);
 
   static Create_func_lpad s_singleton;
 
@@ -1418,7 +1418,7 @@ protected:
 class Create_func_ltrim : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_ltrim s_singleton;
 
@@ -1431,7 +1431,7 @@ protected:
 class Create_func_makedate : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_makedate s_singleton;
 
@@ -1444,7 +1444,7 @@ protected:
 class Create_func_maketime : public Create_func_arg3
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
+  virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3);
 
   static Create_func_maketime s_singleton;
 
@@ -1483,7 +1483,7 @@ protected:
 class Create_func_md5 : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_md5 s_singleton;
 
@@ -1496,7 +1496,7 @@ protected:
 class Create_func_monthname : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_monthname s_singleton;
 
@@ -1509,7 +1509,7 @@ protected:
 class Create_func_name_const : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_name_const s_singleton;
 
@@ -1522,7 +1522,7 @@ protected:
 class Create_func_nullif : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_nullif s_singleton;
 
@@ -1536,7 +1536,7 @@ protected:
 class Create_func_numgeometries : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_numgeometries s_singleton;
 
@@ -1551,7 +1551,7 @@ protected:
 class Create_func_numinteriorring : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_numinteriorring s_singleton;
 
@@ -1566,7 +1566,7 @@ protected:
 class Create_func_numpoints : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_numpoints s_singleton;
 
@@ -1580,7 +1580,7 @@ protected:
 class Create_func_oct : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_oct s_singleton;
 
@@ -1593,7 +1593,7 @@ protected:
 class Create_func_ord : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_ord s_singleton;
 
@@ -1607,7 +1607,7 @@ protected:
 class Create_func_overlaps : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_overlaps s_singleton;
 
@@ -1621,7 +1621,7 @@ protected:
 class Create_func_period_add : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_period_add s_singleton;
 
@@ -1634,7 +1634,7 @@ protected:
 class Create_func_period_diff : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_period_diff s_singleton;
 
@@ -1661,7 +1661,7 @@ protected:
 class Create_func_pointn : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_pointn s_singleton;
 
@@ -1675,7 +1675,7 @@ protected:
 class Create_func_pow : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_pow s_singleton;
 
@@ -1688,7 +1688,7 @@ protected:
 class Create_func_quote : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_quote s_singleton;
 
@@ -1701,7 +1701,7 @@ protected:
 class Create_func_radians : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_radians s_singleton;
 
@@ -1727,7 +1727,7 @@ protected:
 class Create_func_release_lock : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_release_lock s_singleton;
 
@@ -1740,7 +1740,7 @@ protected:
 class Create_func_reverse : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_reverse s_singleton;
 
@@ -1779,7 +1779,7 @@ protected:
 class Create_func_rpad : public Create_func_arg3
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
+  virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3);
 
   static Create_func_rpad s_singleton;
 
@@ -1792,7 +1792,7 @@ protected:
 class Create_func_rtrim : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_rtrim s_singleton;
 
@@ -1805,7 +1805,7 @@ protected:
 class Create_func_sec_to_time : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_sec_to_time s_singleton;
 
@@ -1818,7 +1818,7 @@ protected:
 class Create_func_sha : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_sha s_singleton;
 
@@ -1831,7 +1831,7 @@ protected:
 class Create_func_sign : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_sign s_singleton;
 
@@ -1844,7 +1844,7 @@ protected:
 class Create_func_sin : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_sin s_singleton;
 
@@ -1857,7 +1857,7 @@ protected:
 class Create_func_sleep : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_sleep s_singleton;
 
@@ -1870,7 +1870,7 @@ protected:
 class Create_func_soundex : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_soundex s_singleton;
 
@@ -1883,7 +1883,7 @@ protected:
 class Create_func_space : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_space s_singleton;
 
@@ -1896,7 +1896,7 @@ protected:
 class Create_func_sqrt : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_sqrt s_singleton;
 
@@ -1910,7 +1910,7 @@ protected:
 class Create_func_srid : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_srid s_singleton;
 
@@ -1925,7 +1925,7 @@ protected:
 class Create_func_startpoint : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_startpoint s_singleton;
 
@@ -1939,7 +1939,7 @@ protected:
 class Create_func_str_to_date : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_str_to_date s_singleton;
 
@@ -1952,7 +1952,7 @@ protected:
 class Create_func_strcmp : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_strcmp s_singleton;
 
@@ -1965,7 +1965,7 @@ protected:
 class Create_func_substr_index : public Create_func_arg3
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
+  virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3);
 
   static Create_func_substr_index s_singleton;
 
@@ -1978,7 +1978,7 @@ protected:
 class Create_func_subtime : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_subtime s_singleton;
 
@@ -1991,7 +1991,7 @@ protected:
 class Create_func_tan : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_tan s_singleton;
 
@@ -2004,7 +2004,7 @@ protected:
 class Create_func_time_format : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_time_format s_singleton;
 
@@ -2017,7 +2017,7 @@ protected:
 class Create_func_time_to_sec : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_time_to_sec s_singleton;
 
@@ -2030,7 +2030,7 @@ protected:
 class Create_func_timediff : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_timediff s_singleton;
 
@@ -2043,7 +2043,7 @@ protected:
 class Create_func_to_days : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_to_days s_singleton;
 
@@ -2057,7 +2057,7 @@ protected:
 class Create_func_touches : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_touches s_singleton;
 
@@ -2071,7 +2071,7 @@ protected:
 class Create_func_ucase : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_ucase s_singleton;
 
@@ -2084,7 +2084,7 @@ protected:
 class Create_func_uncompress : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_uncompress s_singleton;
 
@@ -2097,7 +2097,7 @@ protected:
 class Create_func_uncompressed_length : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_uncompressed_length s_singleton;
 
@@ -2110,7 +2110,7 @@ protected:
 class Create_func_unhex : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_unhex s_singleton;
 
@@ -2175,7 +2175,7 @@ protected:
 class Create_func_weekday : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_weekday s_singleton;
 
@@ -2188,7 +2188,7 @@ protected:
 class Create_func_weekofyear : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_weekofyear s_singleton;
 
@@ -2202,7 +2202,7 @@ protected:
 class Create_func_within : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_within s_singleton;
 
@@ -2217,7 +2217,7 @@ protected:
 class Create_func_x : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_x s_singleton;
 
@@ -2231,7 +2231,7 @@ protected:
 class Create_func_xml_extractvalue : public Create_func_arg2
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+  virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2);
 
   static Create_func_xml_extractvalue s_singleton;
 
@@ -2244,7 +2244,7 @@ protected:
 class Create_func_xml_update : public Create_func_arg3
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1, Item *arg2, Item *arg3);
+  virtual Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3);
 
   static Create_func_xml_update s_singleton;
 
@@ -2258,7 +2258,7 @@ protected:
 class Create_func_y : public Create_func_arg1
 {
 public:
-  virtual Item *create(THD *thd, Item *arg1);
+  virtual Item *create_1_arg(THD *thd, Item *arg1);
 
   static Create_func_y s_singleton;
 
@@ -2353,7 +2353,7 @@ Create_qfunc::create(THD *thd, LEX_STRING name, List<Item> *item_list)
   if (thd->lex->copy_db_to(&db.str, &db.length))
     return NULL;
 
-  return create(thd, db, name, false, item_list);
+  return create_with_db(thd, db, name, false, item_list);
 }
 
 
@@ -2470,8 +2470,8 @@ Create_udf_func::create(THD *thd, udf_func *udf, List<Item> *item_list)
 Create_sp_func Create_sp_func::s_singleton;
 
 Item*
-Create_sp_func::create(THD *thd, LEX_STRING db, LEX_STRING name,
-                       bool use_explicit_name, List<Item> *item_list)
+Create_sp_func::create_with_db(THD *thd, LEX_STRING db, LEX_STRING name,
+                               bool use_explicit_name, List<Item> *item_list)
 {
   int arg_count= 0;
   Item *func= NULL;
@@ -2564,7 +2564,7 @@ Create_func_arg1::create(THD *thd, LEX_STRING name, List<Item> *item_list)
     return NULL;
   }
 
-  return create(thd, param_1);
+  return create_1_arg(thd, param_1);
 }
 
 
@@ -2592,7 +2592,7 @@ Create_func_arg2::create(THD *thd, LEX_STRING name, List<Item> *item_list)
     return NULL;
   }
 
-  return create(thd, param_1, param_2);
+  return create_2_arg(thd, param_1, param_2);
 }
 
 
@@ -2622,14 +2622,14 @@ Create_func_arg3::create(THD *thd, LEX_STRING name, List<Item> *item_list)
     return NULL;
   }
 
-  return create(thd, param_1, param_2, param_3);
+  return create_3_arg(thd, param_1, param_2, param_3);
 }
 
 
 Create_func_abs Create_func_abs::s_singleton;
 
 Item*
-Create_func_abs::create(THD *thd, Item *arg1)
+Create_func_abs::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_abs(arg1);
 }
@@ -2638,7 +2638,7 @@ Create_func_abs::create(THD *thd, Item *arg1)
 Create_func_acos Create_func_acos::s_singleton;
 
 Item*
-Create_func_acos::create(THD *thd, Item *arg1)
+Create_func_acos::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_acos(arg1);
 }
@@ -2647,7 +2647,7 @@ Create_func_acos::create(THD *thd, Item *arg1)
 Create_func_addtime Create_func_addtime::s_singleton;
 
 Item*
-Create_func_addtime::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_addtime::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_add_time(arg1, arg2, 0, 0);
 }
@@ -2656,7 +2656,7 @@ Create_func_addtime::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_aes_encrypt Create_func_aes_encrypt::s_singleton;
 
 Item*
-Create_func_aes_encrypt::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_aes_encrypt::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_aes_encrypt(arg1, arg2);
 }
@@ -2665,7 +2665,7 @@ Create_func_aes_encrypt::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_aes_decrypt Create_func_aes_decrypt::s_singleton;
 
 Item*
-Create_func_aes_decrypt::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_aes_decrypt::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_aes_decrypt(arg1, arg2);
 }
@@ -2675,7 +2675,7 @@ Create_func_aes_decrypt::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_area Create_func_area::s_singleton;
 
 Item*
-Create_func_area::create(THD *thd, Item *arg1)
+Create_func_area::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_area(arg1);
 }
@@ -2686,7 +2686,7 @@ Create_func_area::create(THD *thd, Item *arg1)
 Create_func_as_wkb Create_func_as_wkb::s_singleton;
 
 Item*
-Create_func_as_wkb::create(THD *thd, Item *arg1)
+Create_func_as_wkb::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_as_wkb(arg1);
 }
@@ -2697,7 +2697,7 @@ Create_func_as_wkb::create(THD *thd, Item *arg1)
 Create_func_as_wkt Create_func_as_wkt::s_singleton;
 
 Item*
-Create_func_as_wkt::create(THD *thd, Item *arg1)
+Create_func_as_wkt::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_as_wkt(arg1);
 }
@@ -2707,7 +2707,7 @@ Create_func_as_wkt::create(THD *thd, Item *arg1)
 Create_func_asin Create_func_asin::s_singleton;
 
 Item*
-Create_func_asin::create(THD *thd, Item *arg1)
+Create_func_asin::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_asin(arg1);
 }
@@ -2753,7 +2753,7 @@ Create_func_atan::create_native(THD *thd, LEX_STRING name,
 Create_func_benchmark Create_func_benchmark::s_singleton;
 
 Item*
-Create_func_benchmark::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_benchmark::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
   return new (thd->mem_root) Item_func_benchmark(arg1, arg2);
@@ -2763,7 +2763,7 @@ Create_func_benchmark::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_bin Create_func_bin::s_singleton;
 
 Item*
-Create_func_bin::create(THD *thd, Item *arg1)
+Create_func_bin::create_1_arg(THD *thd, Item *arg1)
 {
   Item *i10= new (thd->mem_root) Item_int((int32) 10,2);
   Item *i2= new (thd->mem_root) Item_int((int32) 2,1);
@@ -2774,7 +2774,7 @@ Create_func_bin::create(THD *thd, Item *arg1)
 Create_func_bit_count Create_func_bit_count::s_singleton;
 
 Item*
-Create_func_bit_count::create(THD *thd, Item *arg1)
+Create_func_bit_count::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_bit_count(arg1);
 }
@@ -2783,7 +2783,7 @@ Create_func_bit_count::create(THD *thd, Item *arg1)
 Create_func_bit_length Create_func_bit_length::s_singleton;
 
 Item*
-Create_func_bit_length::create(THD *thd, Item *arg1)
+Create_func_bit_length::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_bit_length(arg1);
 }
@@ -2792,7 +2792,7 @@ Create_func_bit_length::create(THD *thd, Item *arg1)
 Create_func_ceiling Create_func_ceiling::s_singleton;
 
 Item*
-Create_func_ceiling::create(THD *thd, Item *arg1)
+Create_func_ceiling::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_ceiling(arg1);
 }
@@ -2802,7 +2802,7 @@ Create_func_ceiling::create(THD *thd, Item *arg1)
 Create_func_centroid Create_func_centroid::s_singleton;
 
 Item*
-Create_func_centroid::create(THD *thd, Item *arg1)
+Create_func_centroid::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_centroid(arg1);
 }
@@ -2812,7 +2812,7 @@ Create_func_centroid::create(THD *thd, Item *arg1)
 Create_func_char_length Create_func_char_length::s_singleton;
 
 Item*
-Create_func_char_length::create(THD *thd, Item *arg1)
+Create_func_char_length::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_char_length(arg1);
 }
@@ -2821,7 +2821,7 @@ Create_func_char_length::create(THD *thd, Item *arg1)
 Create_func_coercibility Create_func_coercibility::s_singleton;
 
 Item*
-Create_func_coercibility::create(THD *thd, Item *arg1)
+Create_func_coercibility::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_coercibility(arg1);
 }
@@ -2873,7 +2873,7 @@ Create_func_concat_ws::create_native(THD *thd, LEX_STRING name,
 Create_func_compress Create_func_compress::s_singleton;
 
 Item*
-Create_func_compress::create(THD *thd, Item *arg1)
+Create_func_compress::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_compress(arg1);
 }
@@ -2893,7 +2893,7 @@ Create_func_connection_id::create(THD *thd)
 Create_func_contains Create_func_contains::s_singleton;
 
 Item*
-Create_func_contains::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_contains::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_spatial_rel(arg1, arg2,
                                                    Item_func::SP_CONTAINS_FUNC);
@@ -2904,7 +2904,7 @@ Create_func_contains::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_conv Create_func_conv::s_singleton;
 
 Item*
-Create_func_conv::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
+Create_func_conv::create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 {
   return new (thd->mem_root) Item_func_conv(arg1, arg2, arg3);
 }
@@ -2913,7 +2913,7 @@ Create_func_conv::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 Create_func_convert_tz Create_func_convert_tz::s_singleton;
 
 Item*
-Create_func_convert_tz::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
+Create_func_convert_tz::create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 {
   return new (thd->mem_root) Item_func_convert_tz(arg1, arg2, arg3);
 }
@@ -2922,7 +2922,7 @@ Create_func_convert_tz::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 Create_func_cos Create_func_cos::s_singleton;
 
 Item*
-Create_func_cos::create(THD *thd, Item *arg1)
+Create_func_cos::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_cos(arg1);
 }
@@ -2931,7 +2931,7 @@ Create_func_cos::create(THD *thd, Item *arg1)
 Create_func_cot Create_func_cot::s_singleton;
 
 Item*
-Create_func_cot::create(THD *thd, Item *arg1)
+Create_func_cot::create_1_arg(THD *thd, Item *arg1)
 {
   Item *i1= new (thd->mem_root) Item_int((char*) "1", 1, 1);
   Item *i2= new (thd->mem_root) Item_func_tan(arg1);
@@ -2942,7 +2942,7 @@ Create_func_cot::create(THD *thd, Item *arg1)
 Create_func_crc32 Create_func_crc32::s_singleton;
 
 Item*
-Create_func_crc32::create(THD *thd, Item *arg1)
+Create_func_crc32::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_crc32(arg1);
 }
@@ -2952,7 +2952,7 @@ Create_func_crc32::create(THD *thd, Item *arg1)
 Create_func_crosses Create_func_crosses::s_singleton;
 
 Item*
-Create_func_crosses::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_crosses::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_spatial_rel(arg1, arg2,
                                                    Item_func::SP_CROSSES_FUNC);
@@ -2963,7 +2963,7 @@ Create_func_crosses::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_date_format Create_func_date_format::s_singleton;
 
 Item*
-Create_func_date_format::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_date_format::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_date_format(arg1, arg2, 0);
 }
@@ -2972,7 +2972,7 @@ Create_func_date_format::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_datediff Create_func_datediff::s_singleton;
 
 Item*
-Create_func_datediff::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_datediff::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   Item *i1= new (thd->mem_root) Item_func_to_days(arg1);
   Item *i2= new (thd->mem_root) Item_func_to_days(arg2);
@@ -2984,7 +2984,7 @@ Create_func_datediff::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_dayname Create_func_dayname::s_singleton;
 
 Item*
-Create_func_dayname::create(THD *thd, Item *arg1)
+Create_func_dayname::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_dayname(arg1);
 }
@@ -2993,7 +2993,7 @@ Create_func_dayname::create(THD *thd, Item *arg1)
 Create_func_dayofmonth Create_func_dayofmonth::s_singleton;
 
 Item*
-Create_func_dayofmonth::create(THD *thd, Item *arg1)
+Create_func_dayofmonth::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_dayofmonth(arg1);
 }
@@ -3002,7 +3002,7 @@ Create_func_dayofmonth::create(THD *thd, Item *arg1)
 Create_func_dayofweek Create_func_dayofweek::s_singleton;
 
 Item*
-Create_func_dayofweek::create(THD *thd, Item *arg1)
+Create_func_dayofweek::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_weekday(arg1, 1);
 }
@@ -3011,7 +3011,7 @@ Create_func_dayofweek::create(THD *thd, Item *arg1)
 Create_func_dayofyear Create_func_dayofyear::s_singleton;
 
 Item*
-Create_func_dayofyear::create(THD *thd, Item *arg1)
+Create_func_dayofyear::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_dayofyear(arg1);
 }
@@ -3020,7 +3020,7 @@ Create_func_dayofyear::create(THD *thd, Item *arg1)
 Create_func_decode Create_func_decode::s_singleton;
 
 Item*
-Create_func_decode::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_decode::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_decode(arg1, arg2);
 }
@@ -3029,7 +3029,7 @@ Create_func_decode::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_degrees Create_func_degrees::s_singleton;
 
 Item*
-Create_func_degrees::create(THD *thd, Item *arg1)
+Create_func_degrees::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_units((char*) "degrees", arg1,
                                              180/M_PI, 0.0);
@@ -3114,7 +3114,7 @@ Create_func_des_encrypt::create_native(THD *thd, LEX_STRING name,
 Create_func_dimension Create_func_dimension::s_singleton;
 
 Item*
-Create_func_dimension::create(THD *thd, Item *arg1)
+Create_func_dimension::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_dimension(arg1);
 }
@@ -3125,7 +3125,7 @@ Create_func_dimension::create(THD *thd, Item *arg1)
 Create_func_disjoint Create_func_disjoint::s_singleton;
 
 Item*
-Create_func_disjoint::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_disjoint::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_spatial_rel(arg1, arg2,
                                                    Item_func::SP_DISJOINT_FUNC);
@@ -3157,7 +3157,7 @@ Create_func_elt::create_native(THD *thd, LEX_STRING name,
 Create_func_encode Create_func_encode::s_singleton;
 
 Item*
-Create_func_encode::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_encode::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_encode(arg1, arg2);
 }
@@ -3205,7 +3205,7 @@ Create_func_encrypt::create_native(THD *thd, LEX_STRING name,
 Create_func_endpoint Create_func_endpoint::s_singleton;
 
 Item*
-Create_func_endpoint::create(THD *thd, Item *arg1)
+Create_func_endpoint::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_spatial_decomp(arg1,
                                                       Item_func::SP_ENDPOINT);
@@ -3217,7 +3217,7 @@ Create_func_endpoint::create(THD *thd, Item *arg1)
 Create_func_envelope Create_func_envelope::s_singleton;
 
 Item*
-Create_func_envelope::create(THD *thd, Item *arg1)
+Create_func_envelope::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_envelope(arg1);
 }
@@ -3228,7 +3228,7 @@ Create_func_envelope::create(THD *thd, Item *arg1)
 Create_func_equals Create_func_equals::s_singleton;
 
 Item*
-Create_func_equals::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_equals::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_spatial_rel(arg1, arg2,
                                                    Item_func::SP_EQUALS_FUNC);
@@ -3239,7 +3239,7 @@ Create_func_equals::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_exp Create_func_exp::s_singleton;
 
 Item*
-Create_func_exp::create(THD *thd, Item *arg1)
+Create_func_exp::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_exp(arg1);
 }
@@ -3302,7 +3302,7 @@ Create_func_export_set::create_native(THD *thd, LEX_STRING name,
 Create_func_exteriorring Create_func_exteriorring::s_singleton;
 
 Item*
-Create_func_exteriorring::create(THD *thd, Item *arg1)
+Create_func_exteriorring::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_spatial_decomp(arg1,
                                                       Item_func::SP_EXTERIORRING);
@@ -3334,7 +3334,7 @@ Create_func_field::create_native(THD *thd, LEX_STRING name,
 Create_func_find_in_set Create_func_find_in_set::s_singleton;
 
 Item*
-Create_func_find_in_set::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_find_in_set::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_find_in_set(arg1, arg2);
 }
@@ -3343,7 +3343,7 @@ Create_func_find_in_set::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_floor Create_func_floor::s_singleton;
 
 Item*
-Create_func_floor::create(THD *thd, Item *arg1)
+Create_func_floor::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_floor(arg1);
 }
@@ -3352,7 +3352,7 @@ Create_func_floor::create(THD *thd, Item *arg1)
 Create_func_format Create_func_format::s_singleton;
 
 Item*
-Create_func_format::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_format::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_format(arg1, arg2);
 }
@@ -3372,7 +3372,7 @@ Create_func_found_rows::create(THD *thd)
 Create_func_from_days Create_func_from_days::s_singleton;
 
 Item*
-Create_func_from_days::create(THD *thd, Item *arg1)
+Create_func_from_days::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_from_days(arg1);
 }
@@ -3500,7 +3500,7 @@ Create_func_geometry_from_wkb::create_native(THD *thd, LEX_STRING name,
 Create_func_geometry_type Create_func_geometry_type::s_singleton;
 
 Item*
-Create_func_geometry_type::create(THD *thd, Item *arg1)
+Create_func_geometry_type::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_geometry_type(arg1);
 }
@@ -3511,7 +3511,7 @@ Create_func_geometry_type::create(THD *thd, Item *arg1)
 Create_func_geometryn Create_func_geometryn::s_singleton;
 
 Item*
-Create_func_geometryn::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_geometryn::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_spatial_decomp_n(arg1, arg2,
                                                         Item_func::SP_GEOMETRYN);
@@ -3522,7 +3522,7 @@ Create_func_geometryn::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_get_lock Create_func_get_lock::s_singleton;
 
 Item*
-Create_func_get_lock::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_get_lock::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   thd->lex->set_stmt_unsafe();
   thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
@@ -3534,7 +3534,7 @@ Create_func_get_lock::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_glength Create_func_glength::s_singleton;
 
 Item*
-Create_func_glength::create(THD *thd, Item *arg1)
+Create_func_glength::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_glength(arg1);
 }
@@ -3565,7 +3565,7 @@ Create_func_greatest::create_native(THD *thd, LEX_STRING name,
 Create_func_hex Create_func_hex::s_singleton;
 
 Item*
-Create_func_hex::create(THD *thd, Item *arg1)
+Create_func_hex::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_hex(arg1);
 }
@@ -3574,7 +3574,7 @@ Create_func_hex::create(THD *thd, Item *arg1)
 Create_func_ifnull Create_func_ifnull::s_singleton;
 
 Item*
-Create_func_ifnull::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_ifnull::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_ifnull(arg1, arg2);
 }
@@ -3583,7 +3583,7 @@ Create_func_ifnull::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_inet_ntoa Create_func_inet_ntoa::s_singleton;
 
 Item*
-Create_func_inet_ntoa::create(THD *thd, Item *arg1)
+Create_func_inet_ntoa::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_inet_ntoa(arg1);
 }
@@ -3592,7 +3592,7 @@ Create_func_inet_ntoa::create(THD *thd, Item *arg1)
 Create_func_inet_aton Create_func_inet_aton::s_singleton;
 
 Item*
-Create_func_inet_aton::create(THD *thd, Item *arg1)
+Create_func_inet_aton::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_inet_aton(arg1);
 }
@@ -3601,7 +3601,7 @@ Create_func_inet_aton::create(THD *thd, Item *arg1)
 Create_func_instr Create_func_instr::s_singleton;
 
 Item*
-Create_func_instr::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_instr::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_locate(arg1, arg2);
 }
@@ -3611,7 +3611,7 @@ Create_func_instr::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_interiorringn Create_func_interiorringn::s_singleton;
 
 Item*
-Create_func_interiorringn::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_interiorringn::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_spatial_decomp_n(arg1, arg2,
                                                         Item_func::SP_INTERIORRINGN);
@@ -3623,7 +3623,7 @@ Create_func_interiorringn::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_intersects Create_func_intersects::s_singleton;
 
 Item*
-Create_func_intersects::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_intersects::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_spatial_rel(arg1, arg2,
                                                    Item_func::SP_INTERSECTS_FUNC);
@@ -3634,7 +3634,7 @@ Create_func_intersects::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_is_free_lock Create_func_is_free_lock::s_singleton;
 
 Item*
-Create_func_is_free_lock::create(THD *thd, Item *arg1)
+Create_func_is_free_lock::create_1_arg(THD *thd, Item *arg1)
 {
   thd->lex->set_stmt_unsafe();
   thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
@@ -3645,7 +3645,7 @@ Create_func_is_free_lock::create(THD *thd, Item *arg1)
 Create_func_is_used_lock Create_func_is_used_lock::s_singleton;
 
 Item*
-Create_func_is_used_lock::create(THD *thd, Item *arg1)
+Create_func_is_used_lock::create_1_arg(THD *thd, Item *arg1)
 {
   thd->lex->set_stmt_unsafe();
   thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
@@ -3657,7 +3657,7 @@ Create_func_is_used_lock::create(THD *thd, Item *arg1)
 Create_func_isclosed Create_func_isclosed::s_singleton;
 
 Item*
-Create_func_isclosed::create(THD *thd, Item *arg1)
+Create_func_isclosed::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_isclosed(arg1);
 }
@@ -3668,7 +3668,7 @@ Create_func_isclosed::create(THD *thd, Item *arg1)
 Create_func_isempty Create_func_isempty::s_singleton;
 
 Item*
-Create_func_isempty::create(THD *thd, Item *arg1)
+Create_func_isempty::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_isempty(arg1);
 }
@@ -3678,7 +3678,7 @@ Create_func_isempty::create(THD *thd, Item *arg1)
 Create_func_isnull Create_func_isnull::s_singleton;
 
 Item*
-Create_func_isnull::create(THD *thd, Item *arg1)
+Create_func_isnull::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_isnull(arg1);
 }
@@ -3688,7 +3688,7 @@ Create_func_isnull::create(THD *thd, Item *arg1)
 Create_func_issimple Create_func_issimple::s_singleton;
 
 Item*
-Create_func_issimple::create(THD *thd, Item *arg1)
+Create_func_issimple::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_issimple(arg1);
 }
@@ -3698,7 +3698,7 @@ Create_func_issimple::create(THD *thd, Item *arg1)
 Create_func_last_day Create_func_last_day::s_singleton;
 
 Item*
-Create_func_last_day::create(THD *thd, Item *arg1)
+Create_func_last_day::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_last_day(arg1);
 }
@@ -3744,7 +3744,7 @@ Create_func_last_insert_id::create_native(THD *thd, LEX_STRING name,
 Create_func_lcase Create_func_lcase::s_singleton;
 
 Item*
-Create_func_lcase::create(THD *thd, Item *arg1)
+Create_func_lcase::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_lcase(arg1);
 }
@@ -3774,7 +3774,7 @@ Create_func_least::create_native(THD *thd, LEX_STRING name,
 Create_func_length Create_func_length::s_singleton;
 
 Item*
-Create_func_length::create(THD *thd, Item *arg1)
+Create_func_length::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_length(arg1);
 }
@@ -3783,7 +3783,7 @@ Create_func_length::create(THD *thd, Item *arg1)
 Create_func_ln Create_func_ln::s_singleton;
 
 Item*
-Create_func_ln::create(THD *thd, Item *arg1)
+Create_func_ln::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_ln(arg1);
 }
@@ -3792,7 +3792,7 @@ Create_func_ln::create(THD *thd, Item *arg1)
 Create_func_load_file Create_func_load_file::s_singleton;
 
 Item*
-Create_func_load_file::create(THD *thd, Item *arg1)
+Create_func_load_file::create_1_arg(THD *thd, Item *arg1)
 {
   thd->lex->set_stmt_unsafe();
   thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
@@ -3881,7 +3881,7 @@ Create_func_log::create_native(THD *thd, LEX_STRING name,
 Create_func_log10 Create_func_log10::s_singleton;
 
 Item*
-Create_func_log10::create(THD *thd, Item *arg1)
+Create_func_log10::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_log10(arg1);
 }
@@ -3890,7 +3890,7 @@ Create_func_log10::create(THD *thd, Item *arg1)
 Create_func_log2 Create_func_log2::s_singleton;
 
 Item*
-Create_func_log2::create(THD *thd, Item *arg1)
+Create_func_log2::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_log2(arg1);
 }
@@ -3899,7 +3899,7 @@ Create_func_log2::create(THD *thd, Item *arg1)
 Create_func_lpad Create_func_lpad::s_singleton;
 
 Item*
-Create_func_lpad::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
+Create_func_lpad::create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 {
   return new (thd->mem_root) Item_func_lpad(arg1, arg2, arg3);
 }
@@ -3908,7 +3908,7 @@ Create_func_lpad::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 Create_func_ltrim Create_func_ltrim::s_singleton;
 
 Item*
-Create_func_ltrim::create(THD *thd, Item *arg1)
+Create_func_ltrim::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_ltrim(arg1);
 }
@@ -3917,7 +3917,7 @@ Create_func_ltrim::create(THD *thd, Item *arg1)
 Create_func_makedate Create_func_makedate::s_singleton;
 
 Item*
-Create_func_makedate::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_makedate::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_makedate(arg1, arg2);
 }
@@ -3926,7 +3926,7 @@ Create_func_makedate::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_maketime Create_func_maketime::s_singleton;
 
 Item*
-Create_func_maketime::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
+Create_func_maketime::create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 {
   return new (thd->mem_root) Item_func_maketime(arg1, arg2, arg3);
 }
@@ -4001,7 +4001,7 @@ Create_func_master_pos_wait::create_native(THD *thd, LEX_STRING name,
 Create_func_md5 Create_func_md5::s_singleton;
 
 Item*
-Create_func_md5::create(THD *thd, Item *arg1)
+Create_func_md5::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_md5(arg1);
 }
@@ -4010,7 +4010,7 @@ Create_func_md5::create(THD *thd, Item *arg1)
 Create_func_monthname Create_func_monthname::s_singleton;
 
 Item*
-Create_func_monthname::create(THD *thd, Item *arg1)
+Create_func_monthname::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_monthname(arg1);
 }
@@ -4019,7 +4019,7 @@ Create_func_monthname::create(THD *thd, Item *arg1)
 Create_func_name_const Create_func_name_const::s_singleton;
 
 Item*
-Create_func_name_const::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_name_const::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_name_const(arg1, arg2);
 }
@@ -4028,7 +4028,7 @@ Create_func_name_const::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_nullif Create_func_nullif::s_singleton;
 
 Item*
-Create_func_nullif::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_nullif::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_nullif(arg1, arg2);
 }
@@ -4038,7 +4038,7 @@ Create_func_nullif::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_numgeometries Create_func_numgeometries::s_singleton;
 
 Item*
-Create_func_numgeometries::create(THD *thd, Item *arg1)
+Create_func_numgeometries::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_numgeometries(arg1);
 }
@@ -4049,7 +4049,7 @@ Create_func_numgeometries::create(THD *thd, Item *arg1)
 Create_func_numinteriorring Create_func_numinteriorring::s_singleton;
 
 Item*
-Create_func_numinteriorring::create(THD *thd, Item *arg1)
+Create_func_numinteriorring::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_numinteriorring(arg1);
 }
@@ -4060,7 +4060,7 @@ Create_func_numinteriorring::create(THD *thd, Item *arg1)
 Create_func_numpoints Create_func_numpoints::s_singleton;
 
 Item*
-Create_func_numpoints::create(THD *thd, Item *arg1)
+Create_func_numpoints::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_numpoints(arg1);
 }
@@ -4070,7 +4070,7 @@ Create_func_numpoints::create(THD *thd, Item *arg1)
 Create_func_oct Create_func_oct::s_singleton;
 
 Item*
-Create_func_oct::create(THD *thd, Item *arg1)
+Create_func_oct::create_1_arg(THD *thd, Item *arg1)
 {
   Item *i10= new (thd->mem_root) Item_int((int32) 10,2);
   Item *i8= new (thd->mem_root) Item_int((int32) 8,1);
@@ -4081,7 +4081,7 @@ Create_func_oct::create(THD *thd, Item *arg1)
 Create_func_ord Create_func_ord::s_singleton;
 
 Item*
-Create_func_ord::create(THD *thd, Item *arg1)
+Create_func_ord::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_ord(arg1);
 }
@@ -4091,7 +4091,7 @@ Create_func_ord::create(THD *thd, Item *arg1)
 Create_func_overlaps Create_func_overlaps::s_singleton;
 
 Item*
-Create_func_overlaps::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_overlaps::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_spatial_rel(arg1, arg2,
                                                    Item_func::SP_OVERLAPS_FUNC);
@@ -4102,7 +4102,7 @@ Create_func_overlaps::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_period_add Create_func_period_add::s_singleton;
 
 Item*
-Create_func_period_add::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_period_add::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_period_add(arg1, arg2);
 }
@@ -4111,7 +4111,7 @@ Create_func_period_add::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_period_diff Create_func_period_diff::s_singleton;
 
 Item*
-Create_func_period_diff::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_period_diff::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_period_diff(arg1, arg2);
 }
@@ -4130,7 +4130,7 @@ Create_func_pi::create(THD *thd)
 Create_func_pointn Create_func_pointn::s_singleton;
 
 Item*
-Create_func_pointn::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_pointn::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_spatial_decomp_n(arg1, arg2,
                                                         Item_func::SP_POINTN);
@@ -4141,7 +4141,7 @@ Create_func_pointn::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_pow Create_func_pow::s_singleton;
 
 Item*
-Create_func_pow::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_pow::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_pow(arg1, arg2);
 }
@@ -4150,7 +4150,7 @@ Create_func_pow::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_quote Create_func_quote::s_singleton;
 
 Item*
-Create_func_quote::create(THD *thd, Item *arg1)
+Create_func_quote::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_quote(arg1);
 }
@@ -4159,7 +4159,7 @@ Create_func_quote::create(THD *thd, Item *arg1)
 Create_func_radians Create_func_radians::s_singleton;
 
 Item*
-Create_func_radians::create(THD *thd, Item *arg1)
+Create_func_radians::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_units((char*) "radians", arg1,
                                              M_PI/180, 0.0);
@@ -4216,7 +4216,7 @@ Create_func_rand::create_native(THD *thd, LEX_STRING name,
 Create_func_release_lock Create_func_release_lock::s_singleton;
 
 Item*
-Create_func_release_lock::create(THD *thd, Item *arg1)
+Create_func_release_lock::create_1_arg(THD *thd, Item *arg1)
 {
   thd->lex->set_stmt_unsafe();
   thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
@@ -4227,7 +4227,7 @@ Create_func_release_lock::create(THD *thd, Item *arg1)
 Create_func_reverse Create_func_reverse::s_singleton;
 
 Item*
-Create_func_reverse::create(THD *thd, Item *arg1)
+Create_func_reverse::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_reverse(arg1);
 }
@@ -4285,7 +4285,7 @@ Create_func_row_count::create(THD *thd)
 Create_func_rpad Create_func_rpad::s_singleton;
 
 Item*
-Create_func_rpad::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
+Create_func_rpad::create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 {
   return new (thd->mem_root) Item_func_rpad(arg1, arg2, arg3);
 }
@@ -4294,7 +4294,7 @@ Create_func_rpad::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 Create_func_rtrim Create_func_rtrim::s_singleton;
 
 Item*
-Create_func_rtrim::create(THD *thd, Item *arg1)
+Create_func_rtrim::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_rtrim(arg1);
 }
@@ -4303,7 +4303,7 @@ Create_func_rtrim::create(THD *thd, Item *arg1)
 Create_func_sec_to_time Create_func_sec_to_time::s_singleton;
 
 Item*
-Create_func_sec_to_time::create(THD *thd, Item *arg1)
+Create_func_sec_to_time::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_sec_to_time(arg1);
 }
@@ -4312,7 +4312,7 @@ Create_func_sec_to_time::create(THD *thd, Item *arg1)
 Create_func_sha Create_func_sha::s_singleton;
 
 Item*
-Create_func_sha::create(THD *thd, Item *arg1)
+Create_func_sha::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_sha(arg1);
 }
@@ -4321,7 +4321,7 @@ Create_func_sha::create(THD *thd, Item *arg1)
 Create_func_sign Create_func_sign::s_singleton;
 
 Item*
-Create_func_sign::create(THD *thd, Item *arg1)
+Create_func_sign::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_sign(arg1);
 }
@@ -4330,7 +4330,7 @@ Create_func_sign::create(THD *thd, Item *arg1)
 Create_func_sin Create_func_sin::s_singleton;
 
 Item*
-Create_func_sin::create(THD *thd, Item *arg1)
+Create_func_sin::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_sin(arg1);
 }
@@ -4339,7 +4339,7 @@ Create_func_sin::create(THD *thd, Item *arg1)
 Create_func_sleep Create_func_sleep::s_singleton;
 
 Item*
-Create_func_sleep::create(THD *thd, Item *arg1)
+Create_func_sleep::create_1_arg(THD *thd, Item *arg1)
 {
   thd->lex->set_stmt_unsafe();
   thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
@@ -4350,7 +4350,7 @@ Create_func_sleep::create(THD *thd, Item *arg1)
 Create_func_soundex Create_func_soundex::s_singleton;
 
 Item*
-Create_func_soundex::create(THD *thd, Item *arg1)
+Create_func_soundex::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_soundex(arg1);
 }
@@ -4359,7 +4359,7 @@ Create_func_soundex::create(THD *thd, Item *arg1)
 Create_func_space Create_func_space::s_singleton;
 
 Item*
-Create_func_space::create(THD *thd, Item *arg1)
+Create_func_space::create_1_arg(THD *thd, Item *arg1)
 {
   /**
     TODO: Fix Bug#23637
@@ -4387,7 +4387,7 @@ Create_func_space::create(THD *thd, Item *arg1)
 Create_func_sqrt Create_func_sqrt::s_singleton;
 
 Item*
-Create_func_sqrt::create(THD *thd, Item *arg1)
+Create_func_sqrt::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_sqrt(arg1);
 }
@@ -4397,7 +4397,7 @@ Create_func_sqrt::create(THD *thd, Item *arg1)
 Create_func_srid Create_func_srid::s_singleton;
 
 Item*
-Create_func_srid::create(THD *thd, Item *arg1)
+Create_func_srid::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_srid(arg1);
 }
@@ -4408,7 +4408,7 @@ Create_func_srid::create(THD *thd, Item *arg1)
 Create_func_startpoint Create_func_startpoint::s_singleton;
 
 Item*
-Create_func_startpoint::create(THD *thd, Item *arg1)
+Create_func_startpoint::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_spatial_decomp(arg1,
                                                       Item_func::SP_STARTPOINT);
@@ -4419,7 +4419,7 @@ Create_func_startpoint::create(THD *thd, Item *arg1)
 Create_func_str_to_date Create_func_str_to_date::s_singleton;
 
 Item*
-Create_func_str_to_date::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_str_to_date::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_str_to_date(arg1, arg2);
 }
@@ -4428,7 +4428,7 @@ Create_func_str_to_date::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_strcmp Create_func_strcmp::s_singleton;
 
 Item*
-Create_func_strcmp::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_strcmp::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_strcmp(arg1, arg2);
 }
@@ -4437,7 +4437,7 @@ Create_func_strcmp::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_substr_index Create_func_substr_index::s_singleton;
 
 Item*
-Create_func_substr_index::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
+Create_func_substr_index::create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 {
   return new (thd->mem_root) Item_func_substr_index(arg1, arg2, arg3);
 }
@@ -4446,7 +4446,7 @@ Create_func_substr_index::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 Create_func_subtime Create_func_subtime::s_singleton;
 
 Item*
-Create_func_subtime::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_subtime::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_add_time(arg1, arg2, 0, 1);
 }
@@ -4455,7 +4455,7 @@ Create_func_subtime::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_tan Create_func_tan::s_singleton;
 
 Item*
-Create_func_tan::create(THD *thd, Item *arg1)
+Create_func_tan::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_tan(arg1);
 }
@@ -4464,7 +4464,7 @@ Create_func_tan::create(THD *thd, Item *arg1)
 Create_func_time_format Create_func_time_format::s_singleton;
 
 Item*
-Create_func_time_format::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_time_format::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_date_format(arg1, arg2, 1);
 }
@@ -4473,7 +4473,7 @@ Create_func_time_format::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_time_to_sec Create_func_time_to_sec::s_singleton;
 
 Item*
-Create_func_time_to_sec::create(THD *thd, Item *arg1)
+Create_func_time_to_sec::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_time_to_sec(arg1);
 }
@@ -4482,7 +4482,7 @@ Create_func_time_to_sec::create(THD *thd, Item *arg1)
 Create_func_timediff Create_func_timediff::s_singleton;
 
 Item*
-Create_func_timediff::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_timediff::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_timediff(arg1, arg2);
 }
@@ -4491,7 +4491,7 @@ Create_func_timediff::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_to_days Create_func_to_days::s_singleton;
 
 Item*
-Create_func_to_days::create(THD *thd, Item *arg1)
+Create_func_to_days::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_to_days(arg1);
 }
@@ -4501,7 +4501,7 @@ Create_func_to_days::create(THD *thd, Item *arg1)
 Create_func_touches Create_func_touches::s_singleton;
 
 Item*
-Create_func_touches::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_touches::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_spatial_rel(arg1, arg2,
                                                    Item_func::SP_TOUCHES_FUNC);
@@ -4512,7 +4512,7 @@ Create_func_touches::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_ucase Create_func_ucase::s_singleton;
 
 Item*
-Create_func_ucase::create(THD *thd, Item *arg1)
+Create_func_ucase::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_ucase(arg1);
 }
@@ -4521,7 +4521,7 @@ Create_func_ucase::create(THD *thd, Item *arg1)
 Create_func_uncompress Create_func_uncompress::s_singleton;
 
 Item*
-Create_func_uncompress::create(THD *thd, Item *arg1)
+Create_func_uncompress::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_uncompress(arg1);
 }
@@ -4530,7 +4530,7 @@ Create_func_uncompress::create(THD *thd, Item *arg1)
 Create_func_uncompressed_length Create_func_uncompressed_length::s_singleton;
 
 Item*
-Create_func_uncompressed_length::create(THD *thd, Item *arg1)
+Create_func_uncompressed_length::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_uncompressed_length(arg1);
 }
@@ -4539,7 +4539,7 @@ Create_func_uncompressed_length::create(THD *thd, Item *arg1)
 Create_func_unhex Create_func_unhex::s_singleton;
 
 Item*
-Create_func_unhex::create(THD *thd, Item *arg1)
+Create_func_unhex::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_unhex(arg1);
 }
@@ -4620,7 +4620,7 @@ Create_func_version::create(THD *thd)
 Create_func_weekday Create_func_weekday::s_singleton;
 
 Item*
-Create_func_weekday::create(THD *thd, Item *arg1)
+Create_func_weekday::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_weekday(arg1, 0);
 }
@@ -4629,7 +4629,7 @@ Create_func_weekday::create(THD *thd, Item *arg1)
 Create_func_weekofyear Create_func_weekofyear::s_singleton;
 
 Item*
-Create_func_weekofyear::create(THD *thd, Item *arg1)
+Create_func_weekofyear::create_1_arg(THD *thd, Item *arg1)
 {
   Item *i1= new (thd->mem_root) Item_int((char*) "0", 3, 1);
   return new (thd->mem_root) Item_func_week(arg1, i1);
@@ -4640,7 +4640,7 @@ Create_func_weekofyear::create(THD *thd, Item *arg1)
 Create_func_within Create_func_within::s_singleton;
 
 Item*
-Create_func_within::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_within::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_spatial_rel(arg1, arg2,
                                                    Item_func::SP_WITHIN_FUNC);
@@ -4652,7 +4652,7 @@ Create_func_within::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_x Create_func_x::s_singleton;
 
 Item*
-Create_func_x::create(THD *thd, Item *arg1)
+Create_func_x::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_x(arg1);
 }
@@ -4662,7 +4662,7 @@ Create_func_x::create(THD *thd, Item *arg1)
 Create_func_xml_extractvalue Create_func_xml_extractvalue::s_singleton;
 
 Item*
-Create_func_xml_extractvalue::create(THD *thd, Item *arg1, Item *arg2)
+Create_func_xml_extractvalue::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 {
   return new (thd->mem_root) Item_func_xml_extractvalue(arg1, arg2);
 }
@@ -4671,7 +4671,7 @@ Create_func_xml_extractvalue::create(THD *thd, Item *arg1, Item *arg2)
 Create_func_xml_update Create_func_xml_update::s_singleton;
 
 Item*
-Create_func_xml_update::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
+Create_func_xml_update::create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 {
   return new (thd->mem_root) Item_func_xml_update(arg1, arg2, arg3);
 }
@@ -4681,7 +4681,7 @@ Create_func_xml_update::create(THD *thd, Item *arg1, Item *arg2, Item *arg3)
 Create_func_y Create_func_y::s_singleton;
 
 Item*
-Create_func_y::create(THD *thd, Item *arg1)
+Create_func_y::create_1_arg(THD *thd, Item *arg1)
 {
   return new (thd->mem_root) Item_func_y(arg1);
 }
diff --git a/sql/item_create.h b/sql/item_create.h
index a3ba6bd26a6..9f439a3aead 100644
--- a/sql/item_create.h
+++ b/sql/item_create.h
@@ -91,8 +91,9 @@ public:
     @param item_list The list of arguments to the function, can be NULL
     @return An item representing the parsed function call
   */
-  virtual Item* create(THD *thd, LEX_STRING db, LEX_STRING name,
-                       bool use_explicit_name, List<Item> *item_list) = 0;
+  virtual Item *create_with_db(THD *thd, LEX_STRING db, LEX_STRING name,
+                               bool use_explicit_name,
+                               List<Item> *item_list) = 0;
 
 protected:
   /** Constructor. */
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 15b17cbdc1b..6f852e1016c 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -642,7 +642,7 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref)
   default:
     DBUG_ASSERT(0);
   };
-  setup(args[0], NULL);
+  setup_item(args[0], NULL);
   /* MIN/MAX can return NULL for empty set indepedent of the used column */
   maybe_null= 1;
   unsigned_flag=item->unsigned_flag;
@@ -676,7 +676,7 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref)
     of the original MIN/MAX object and it is saved in this object's cache.
 */
 
-void Item_sum_hybrid::setup(Item *item, Item *value_arg)
+void Item_sum_hybrid::setup_item(Item *item, Item *value_arg)
 {
   value= Item_cache::get_cache(item);
   value->setup(item);
@@ -1646,7 +1646,7 @@ void Item_sum_hybrid::no_rows_in_result()
 Item *Item_sum_min::copy_or_same(THD* thd)
 {
   Item_sum_min *item= new (thd->mem_root) Item_sum_min(thd, this);
-  item->setup(args[0], value);
+  item->setup_item(args[0], value);
   return item;
 }
 
@@ -1669,7 +1669,7 @@ bool Item_sum_min::add()
 Item *Item_sum_max::copy_or_same(THD* thd)
 {
   Item_sum_max *item= new (thd->mem_root) Item_sum_max(thd, this);
-  item->setup(args[0], value);
+  item->setup_item(args[0], value);
   return item;
 }
 
diff --git a/sql/item_sum.h b/sql/item_sum.h
index ad66d4b7098..110265fd8b4 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -858,7 +858,7 @@ protected:
     was_values(item->was_values)
   { }
   bool fix_fields(THD *, Item **);
-  void setup(Item *item, Item *value_arg);
+  void setup_item(Item *item, Item *value_arg);
   void clear();
   double val_real();
   longlong val_int();
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 2adec7e7f0a..faea858c2b9 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1263,16 +1263,16 @@ uchar *sys_var_set::value_ptr(THD *thd, enum_var_type type,
 
 void sys_var_set_slave_mode::set_default(THD *thd, enum_var_type type)
 {
-  slave_exec_mode_options= 0;
-  bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
+  slave_exec_mode_options= (ULL(1) << SLAVE_EXEC_MODE_STRICT);
 }
 
 bool sys_var_set_slave_mode::check(THD *thd, set_var *var)
 {
   bool rc=  sys_var_set::check(thd, var);
   if (!rc &&
-      bit_is_set(var->save_result.ulong_value, SLAVE_EXEC_MODE_STRICT) == 1 &&
-      bit_is_set(var->save_result.ulong_value, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
+      test_all_bits(var->save_result.ulong_value,
+                    ((ULL(1) << SLAVE_EXEC_MODE_STRICT) |
+                     (ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT))))
   {
     rc= true;
     my_error(ER_SLAVE_AMBIGOUS_EXEC_MODE, MYF(0), "");
@@ -1294,15 +1294,16 @@ void fix_slave_exec_mode(enum_var_type type)
   DBUG_ENTER("fix_slave_exec_mode");
   compile_time_assert(sizeof(slave_exec_mode_options) * CHAR_BIT
                       > SLAVE_EXEC_MODE_LAST_BIT - 1);
-  if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT) == 1 &&
-      bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
+  if (test_all_bits(slave_exec_mode_options,
+                    ((ULL(1) << SLAVE_EXEC_MODE_STRICT) |
+                     (ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT))))
   {
     sql_print_error("Ambiguous slave modes combination."
                     " STRICT will be used");
-    bit_do_clear(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT);
+    slave_exec_mode_options&= ~(ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT);
   }
-  if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 0)
-    bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
+  if (!(slave_exec_mode_options & (ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT)))
+    slave_exec_mode_options|= (ULL(1)<< SLAVE_EXEC_MODE_STRICT);
   DBUG_VOID_RETURN;
 }
 
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index e0f5cd9a562..fc2e18f28f2 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -8082,7 +8082,7 @@ function_call_generic:
 
             builder= find_qualified_function_builder(thd);
             DBUG_ASSERT(builder);
-            item= builder->create(thd, $1, $3, true, $5);
+            item= builder->create_with_db(thd, $1, $3, true, $5);
 
             if (! ($$= item))
             {
diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h
index ec3987ced5d..f67235eefd1 100644
--- a/storage/example/ha_example.h
+++ b/storage/example/ha_example.h
@@ -155,7 +155,8 @@ public:
   /** @brief
     This method will never be called if you do not implement indexes.
   */
-  virtual double read_time(ha_rows rows) { return (double) rows /  20.0+1; }
+  virtual double read_time(uint index, uint ranges, ha_rows rows)
+    { return (double) rows /  20.0+1; }
 
   /*
     Everything below are methods that we implement in ha_example.cc.
diff --git a/storage/maria/ma_search.c b/storage/maria/ma_search.c
index 8df0ebc4bf4..a5b9bf18aa9 100644
--- a/storage/maria/ma_search.c
+++ b/storage/maria/ma_search.c
@@ -76,8 +76,8 @@ int _ma_search(register MARIA_HA *info, MARIA_KEY *key, uint32 nextflag,
       bmove512(info->keyread_buff, page_buff, info->s->block_size);
 
       /* Save position for a possible read next / previous */
-      info->int_keypos= info->keyread_buff + (ulonglong) info->int_keypos;
-      info->int_maxpos= info->keyread_buff + (ulonglong) info->int_maxpos;
+      info->int_keypos= info->keyread_buff + info->keypos_offset;
+      info->int_maxpos= info->keyread_buff + info->maxpos_offset;
       info->int_keytree_version= key->keyinfo->version;
       info->last_search_keypage= info->last_keypage;
       info->page_changed= 0;
@@ -214,8 +214,8 @@ static int _ma_search_no_save(register MARIA_HA *info, MARIA_KEY *key,
   info->cur_row.trid=    _ma_trid_from_key(&info->last_key);
 
   /* Store offset to key */
-  info->int_keypos= (uchar*) (keypos - page.buff);
-  info->int_maxpos= (uchar*) (maxpos - page.buff);
+  info->keypos_offset= (uint) (keypos - page.buff);
+  info->maxpos_offset= (uint) (maxpos - page.buff);
   info->int_nod_flag= nod_flag;
   info->last_keypage= pos;
   *res_page_link= page_link;
diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h
index 29eb32a4fb2..db6845cb345 100644
--- a/storage/maria/maria_def.h
+++ b/storage/maria/maria_def.h
@@ -506,8 +506,10 @@ struct st_maria_handler
   uchar *first_mbr_key;			/* Searhed spatial key */
   uchar *rec_buff;			/* Temp buffer for recordpack */
   uchar *blob_buff;                     /* Temp buffer for blobs */
-  uchar *int_keypos,			/* Save position for next/previous */
-   *int_maxpos;				/* -""- */
+  uchar *int_keypos;			/* Save position for next/previous */
+  uchar *int_maxpos;			/* -""- */
+  uint keypos_offset;                   /* Tmp storage for offset int_keypos */
+  uint maxpos_offset;          		/* Tmp storage for offset int_maxpos */
   uchar *update_field_data;		/* Used by update in rows-in-block */
   uint int_nod_flag;			/* -""- */
   uint32 int_keytree_version;		/* -""- */
diff --git a/storage/myisam/ft_stopwords.c b/storage/myisam/ft_stopwords.c
index aa209e082e0..05948a936a6 100644
--- a/storage/myisam/ft_stopwords.c
+++ b/storage/myisam/ft_stopwords.c
@@ -44,9 +44,10 @@ static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action,
 static int ft_add_stopword(const char *w)
 {
   FT_STOPWORD sw;
-  return !w ||
-    (((sw.len= (uint) strlen(sw.pos=(const uchar *)w)) >= ft_min_word_len) &&
-          (tree_insert(stopwords3, &sw, 0, stopwords3->custom_arg)==NULL));
+  return (!w ||
+          (((sw.len= (uint) strlen((char*) (sw.pos=(const uchar *)w))) >= 
+            ft_min_word_len) &&
+           (tree_insert(stopwords3, &sw, 0, stopwords3->custom_arg)==NULL)));
 }
 
 int ft_init_stopwords()
diff --git a/storage/xtradb/fil/fil0fil.c b/storage/xtradb/fil/fil0fil.c
index 9fa401a4b3e..5e4546bf989 100644
--- a/storage/xtradb/fil/fil0fil.c
+++ b/storage/xtradb/fil/fil0fil.c
@@ -3168,7 +3168,7 @@ skip_info:
 					mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, id);
 
 					for (i = 0; (ulint) i < n_index; i++) {
-						if (offset / UNIV_PAGE_SIZE == root_page[i]) {
+                                          if ((ulint) (offset / UNIV_PAGE_SIZE) == root_page[i]) {
 							/* this is index root page */
 							mach_write_to_4(page + FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF
 											+ FSEG_HDR_SPACE, id);
diff --git a/storage/xtradb/include/page0page.h b/storage/xtradb/include/page0page.h
index 3899499fb6a..e182c8f58be 100644
--- a/storage/xtradb/include/page0page.h
+++ b/storage/xtradb/include/page0page.h
@@ -517,7 +517,7 @@ UNIV_INLINE
 rec_t*
 page_rec_get_next(
 /*==============*/
-	rec_t*	rec);	/*!< in: pointer to record */
+	const rec_t*	rec);	/*!< in: pointer to record */
 /************************************************************//**
 Gets the pointer to the next record on the page.
 @return	pointer to next record */
diff --git a/storage/xtradb/include/page0page.ic b/storage/xtradb/include/page0page.ic
index 8f794410f20..9655e6c7e27 100644
--- a/storage/xtradb/include/page0page.ic
+++ b/storage/xtradb/include/page0page.ic
@@ -731,7 +731,7 @@ UNIV_INLINE
 rec_t*
 page_rec_get_next(
 /*==============*/
-	rec_t*	rec)	/*!< in: pointer to record */
+	const rec_t*	rec)	/*!< in: pointer to record */
 {
 	return((rec_t*) page_rec_get_next_low(rec, page_rec_is_comp(rec)));
 }
diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp
index d3806f42b94..3037149d0b4 100644
--- a/support-files/compiler_warnings.supp
+++ b/support-files/compiler_warnings.supp
@@ -65,6 +65,11 @@ db_vrfy.c : .*comparison is always false due to limited range of data type.*
 #
 /usr/share/aclocal/audiofile.m4 : .*
 
+#
+# Ignore strict-aliasing warnings (for now)
+#
+.*: break strict-aliasing rules
+
 #
 # Ignore all conversion warnings on windows 64
 # (Is safe as we are not yet supporting strings >= 2G)

From 639bdb2891efe9378911a9ce7a1ed3d5859183dc Mon Sep 17 00:00:00 2001
From: Michael Widenius <monty@askmonty.org>
Date: Mon, 29 Mar 2010 22:07:45 +0300
Subject: [PATCH 3/5] Fixed random failure in test system Removed and
 suppressed compiler warnings

mysql-test/suite/parts/t/rpl_partition.test:
  Mark as big test (as test takes > 5 minutes)
mysql-test/suite/rpl/t/rpl_row_trig003.test:
  Fixed random failure
sql/item_create.cc:
  Renamed create -> create_builder() to avoid compiler warnings about function hidden by others
sql/net_serv.cc:
  Removed compiler warning
support-files/compiler_warnings.supp:
  Supress some warnings
  Remove suppresstion from set_var.cc, as this has already been fixed
  Added missing \ before .c
  Added suppression of warnings that are due to gcc bug (.*discards qualifiers from pointer target type.*)
---
 mysql-test/suite/parts/t/rpl_partition.test |  1 +
 mysql-test/suite/rpl/t/rpl_row_trig003.test |  2 ++
 sql/item_create.cc                          | 32 ++++++++++-----------
 sql/net_serv.cc                             |  2 +-
 support-files/compiler_warnings.supp        | 13 +++++----
 5 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/mysql-test/suite/parts/t/rpl_partition.test b/mysql-test/suite/parts/t/rpl_partition.test
index c5ee20971b3..f7d1c14cf29 100644
--- a/mysql-test/suite/parts/t/rpl_partition.test
+++ b/mysql-test/suite/parts/t/rpl_partition.test
@@ -1,6 +1,7 @@
 --source include/have_partition.inc
 --source include/have_innodb.inc
 --source include/master-slave.inc
+--source include/big_test.inc
 
 --vertical_results
 
diff --git a/mysql-test/suite/rpl/t/rpl_row_trig003.test b/mysql-test/suite/rpl/t/rpl_row_trig003.test
index 5d667e29d69..dada855a89e 100644
--- a/mysql-test/suite/rpl/t/rpl_row_trig003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig003.test
@@ -149,6 +149,8 @@ DROP TABLE IF EXISTS test.t2;
 DROP TABLE IF EXISTS test.t3;
 --enable_warnings
 
+sync_slave_with_master;
+
 diff_files $MYSQLTEST_VARDIR/tmp/trg003_master.sql $MYSQLTEST_VARDIR/tmp/trg003_slave.sql;
 
 # End of 5.0 test case
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 9a6cde1957d..6799fbddd3f 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -76,7 +76,7 @@ public:
     @param thd The current thread
     @return An item representing the function call
   */
-  virtual Item *create(THD *thd) = 0;
+  virtual Item *create_builder(THD *thd) = 0;
 
 protected:
   /** Constructor. */
@@ -498,7 +498,7 @@ protected:
 class Create_func_connection_id : public Create_func_arg0
 {
 public:
-  virtual Item *create(THD *thd);
+  virtual Item *create_builder(THD *thd);
 
   static Create_func_connection_id s_singleton;
 
@@ -943,7 +943,7 @@ protected:
 class Create_func_found_rows : public Create_func_arg0
 {
 public:
-  virtual Item *create(THD *thd);
+  virtual Item *create_builder(THD *thd);
 
   static Create_func_found_rows s_singleton;
 
@@ -1647,7 +1647,7 @@ protected:
 class Create_func_pi : public Create_func_arg0
 {
 public:
-  virtual Item *create(THD *thd);
+  virtual Item *create_builder(THD *thd);
 
   static Create_func_pi s_singleton;
 
@@ -1766,7 +1766,7 @@ protected:
 class Create_func_row_count : public Create_func_arg0
 {
 public:
-  virtual Item *create(THD *thd);
+  virtual Item *create_builder(THD *thd);
 
   static Create_func_row_count s_singleton;
 
@@ -2136,7 +2136,7 @@ protected:
 class Create_func_uuid : public Create_func_arg0
 {
 public:
-  virtual Item *create(THD *thd);
+  virtual Item *create_builder(THD *thd);
 
   static Create_func_uuid s_singleton;
 
@@ -2149,7 +2149,7 @@ protected:
 class Create_func_uuid_short : public Create_func_arg0
 {
 public:
-  virtual Item *create(THD *thd);
+  virtual Item *create_builder(THD *thd);
 
   static Create_func_uuid_short s_singleton;
 
@@ -2162,7 +2162,7 @@ protected:
 class Create_func_version : public Create_func_arg0
 {
 public:
-  virtual Item *create(THD *thd);
+  virtual Item *create_builder(THD *thd);
 
   static Create_func_version s_singleton;
 
@@ -2538,7 +2538,7 @@ Create_func_arg0::create(THD *thd, LEX_STRING name, List<Item> *item_list)
     return NULL;
   }
 
-  return create(thd);
+  return create_builder(thd);
 }
 
 
@@ -2882,7 +2882,7 @@ Create_func_compress::create_1_arg(THD *thd, Item *arg1)
 Create_func_connection_id Create_func_connection_id::s_singleton;
 
 Item*
-Create_func_connection_id::create(THD *thd)
+Create_func_connection_id::create_builder(THD *thd)
 {
   thd->lex->safe_to_cache_query= 0;
   return new (thd->mem_root) Item_func_connection_id();
@@ -3361,7 +3361,7 @@ Create_func_format::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 Create_func_found_rows Create_func_found_rows::s_singleton;
 
 Item*
-Create_func_found_rows::create(THD *thd)
+Create_func_found_rows::create_builder(THD *thd)
 {
   thd->lex->set_stmt_unsafe();
   thd->lex->safe_to_cache_query= 0;
@@ -4120,7 +4120,7 @@ Create_func_period_diff::create_2_arg(THD *thd, Item *arg1, Item *arg2)
 Create_func_pi Create_func_pi::s_singleton;
 
 Item*
-Create_func_pi::create(THD *thd)
+Create_func_pi::create_builder(THD *thd)
 {
   return new (thd->mem_root) Item_static_float_func("pi()", M_PI, 6, 8);
 }
@@ -4274,7 +4274,7 @@ Create_func_round::create_native(THD *thd, LEX_STRING name,
 Create_func_row_count Create_func_row_count::s_singleton;
 
 Item*
-Create_func_row_count::create(THD *thd)
+Create_func_row_count::create_builder(THD *thd)
 {
   thd->lex->set_stmt_unsafe();
   thd->lex->safe_to_cache_query= 0;
@@ -4584,7 +4584,7 @@ Create_func_unix_timestamp::create_native(THD *thd, LEX_STRING name,
 Create_func_uuid Create_func_uuid::s_singleton;
 
 Item*
-Create_func_uuid::create(THD *thd)
+Create_func_uuid::create_builder(THD *thd)
 {
   thd->lex->set_stmt_unsafe();
   thd->lex->safe_to_cache_query= 0;
@@ -4595,7 +4595,7 @@ Create_func_uuid::create(THD *thd)
 Create_func_uuid_short Create_func_uuid_short::s_singleton;
 
 Item*
-Create_func_uuid_short::create(THD *thd)
+Create_func_uuid_short::create_builder(THD *thd)
 {
   thd->lex->set_stmt_unsafe();
   thd->lex->safe_to_cache_query= 0;
@@ -4606,7 +4606,7 @@ Create_func_uuid_short::create(THD *thd)
 Create_func_version Create_func_version::s_singleton;
 
 Item*
-Create_func_version::create(THD *thd)
+Create_func_version::create_builder(THD *thd)
 {
   thd->lex->set_stmt_unsafe();
   return new (thd->mem_root) Item_static_string_func("version()",
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 58ccde760c2..5df98662fe7 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -279,7 +279,7 @@ static int net_data_is_ready(my_socket sd)
   @param clear_buffer           if <> 0, then clear all data from comm buff
 */
 
-void net_clear(NET *net, my_bool clear_buffer)
+void net_clear(NET *net, my_bool clear_buffer __attribute__((unused)))
 {
 #if !defined(EMBEDDED_LIBRARY) && defined(DBUG_OFF)
   size_t count;
diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp
index 3037149d0b4..0a5aa645d3a 100644
--- a/support-files/compiler_warnings.supp
+++ b/support-files/compiler_warnings.supp
@@ -39,6 +39,7 @@ sync/sync0rw\.c: unused parameter
 sync/sync0sync\.c: unused parameter
 sync/sync0sync\.c: unused variable
 ut/ut0ut\.c: ignoring return value of
+srv/srv0srv\.c: value computed is not used
 
 #
 # bdb is not critical to keep up to date
@@ -128,18 +129,18 @@ include/runtime.hpp: .*pure_error.*
 #
 listener.cc : .*conversion from 'SOCKET' to 'int'.*
 net_serv.cc : .*conversion from 'SOCKET' to 'int'.*
-set_var.cc:  right-hand operand of comma has no effect : 1000-1400
-
 
 # allow a little moving space for the warning below
-mi_packrec.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600
-ma_packrec.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 550-650
+mi_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600
+ma_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 550-650
 
 #
 # Wrong compiler warnings
 #
 .* : .*no matching operator delete found; memory will not be freed if initialization throws an exception.*
-ctype-simple.c : .*unary minus operator applied to unsigned type, result still unsigned.*
+ctype-simple\.c : .*unary minus operator applied to unsigned type, result still unsigned.*
 
 # Wrong warning due to GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29478
-regexec\.c : .*passing argument 3 of.*matcher.* discards qualifiers from pointer target type.*
+regexec\.c : passing argument 3 of.*matcher.* discards qualifiers from pointer target type
+libmysql\.c: passing argument 2 of .*memcpy.* discards qualifiers from pointer target type : 3000-4000
+storage/xtradb/dict/dict0dict\.c: passing argument 1 of .*strcpy.* discards qualifiers from pointer target type : 2500-3500

From d904739cc1d98107f67e76a67b0ea6eb2af326ec Mon Sep 17 00:00:00 2001
From: Michael Widenius <monty@askmonty.org>
Date: Tue, 30 Mar 2010 15:36:49 +0300
Subject: [PATCH 4/5] Removed compiler warning Disable pbxt for test cases not
 using pbxt (speeds up test suite)

extra/comp_err.c:
  Added cast to get rid of compiler warning
extra/libevent/kqueue.c:
  Added cast to get rid of compiler warning
mysql-test/lib/mtr_cases.pm:
  Use --skip-pbxt for test cases that doesn't need pbxt
  Collect default-storage-engine from suite.opt file (should actually be my.cnf file, but that wasn't easy to do)
mysql-test/suite/pbxt/t/suite.opt:
  Added marker for mysql-test-run.pl that this suite require pbxt
mysys/mf_keycache.c:
  Use LINT_INIT() to remove compiler warnings
mysys/my_gethostbyname.c:
  Remove compiler warnings
sql/handler.cc:
  Reset variable that may be used uninitialized
sql/item.h:
  Remove compiler warning
sql/mysqld.cc:
  Use LINT_INIT() to remove compiler warnings
sql/sql_class.h:
  Remove compiler warning
sql/sql_table.cc:
  Ensure variable is always set (to remove compiler warning)
sql/sql_view.cc:
  Use LINT_INIT() to remove compiler warnings
storage/maria/ma_loghandler.c:
  Use LINT_INIT() to remove compiler warnings
storage/myisammrg/ha_myisammrg.cc:
  Fixed wrong type to printf
storage/myisammrg/myrg_open.c:
  Use LINT_INIT() to remove compiler warnings
storage/xtradb/include/ut0lst.h:
  Trivial change of macro to remove compiler warning
strings/ctype-ucs2.c:
  Use LINT_INIT() to remove compiler warnings
strings/ctype-utf8.c:
  Use LINT_INIT() to remove compiler warnings
support-files/compiler_warnings.supp:
  Suppress some not relevant warnings
unittest/mysys/waiting_threads-t.c:
  Don't use ftruncate() as this gives warning about ignored return value
---
 extra/comp_err.c                     |  2 +-
 extra/libevent/kqueue.c              |  2 +-
 mysql-test/lib/mtr_cases.pm          | 44 ++++++++++++++++++++++++++--
 mysql-test/suite/pbxt/t/suite.opt    |  1 +
 mysys/mf_keycache.c                  |  6 ++++
 mysys/my_gethostbyname.c             |  9 ++++--
 sql/handler.cc                       |  2 +-
 sql/item.h                           |  3 +-
 sql/mysqld.cc                        | 10 +++++++
 sql/sql_class.h                      |  2 ++
 sql/sql_table.cc                     |  8 ++---
 sql/sql_view.cc                      |  4 ++-
 storage/maria/ma_loghandler.c        |  4 +++
 storage/myisammrg/ha_myisammrg.cc    |  2 +-
 storage/myisammrg/myrg_open.c        |  1 +
 storage/xtradb/include/ut0lst.h      |  2 +-
 strings/ctype-ucs2.c                 |  6 ++--
 strings/ctype-utf8.c                 |  4 +--
 support-files/compiler_warnings.supp | 11 +++++++
 unittest/mysys/waiting_threads-t.c   |  2 +-
 20 files changed, 102 insertions(+), 23 deletions(-)
 create mode 100644 mysql-test/suite/pbxt/t/suite.opt

diff --git a/extra/comp_err.c b/extra/comp_err.c
index 9326444ade9..bca8d3895cb 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -660,7 +660,7 @@ static ha_checksum checksum_format_specifier(const char* msg)
       case 'u':
       case 'x':
       case 's':
-        chksum= my_checksum(chksum, start, (uint) (p + 1 - start));
+        chksum= my_checksum(chksum, (uchar*) start, (uint) (p + 1 - start));
         start= 0; /* Not in format specifier anymore */
         break;
 
diff --git a/extra/libevent/kqueue.c b/extra/libevent/kqueue.c
index 775698baa67..eec5a6ab6fb 100644
--- a/extra/libevent/kqueue.c
+++ b/extra/libevent/kqueue.c
@@ -144,7 +144,7 @@ kq_init(struct event_base *base)
 	 */
 	if (kevent(kq,
 		kqueueop->changes, 1, kqueueop->events, NEVENT, NULL) != 1 ||
-	    kqueueop->events[0].ident != -1 ||
+	    ((int) kqueueop->events[0].ident) != -1 ||
 	    kqueueop->events[0].flags != EV_ERROR) {
 		event_warn("%s: detected broken kqueue; not using.", __func__);
 		free(kqueueop->changes);
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index 220db3d6217..ad8a204db47 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -681,6 +681,8 @@ sub optimize_cases {
 	  if ( $default_engine =~ /^ndb/i );
 	$tinfo->{'innodb_test'}= 1
 	  if ( $default_engine =~ /^innodb/i );
+	$tinfo->{'pbxt_test'}= 1
+	  if ( $default_engine =~ /^pbxt/i );
       }
     }
 
@@ -778,6 +780,8 @@ sub collect_one_test_case {
   my $disabled=   shift;
   my $suite_opts= shift;
 
+  my $local_default_storage_engine= $default_storage_engine;
+
   #print "collect_one_test_case\n";
   #print " suitedir: $suitedir\n";
   #print " testdir: $testdir\n";
@@ -932,15 +936,26 @@ sub collect_one_test_case {
 
   tags_from_test_file($tinfo,"$testdir/${tname}.test");
 
-  if ( defined $default_storage_engine )
+  # Get default storage engine from suite.opt file
+
+  if (defined $suite_opts &&
+      "@$suite_opts" =~ "default-storage-engine=\s*([^\s]*)")
+  {
+    $local_default_storage_engine= $1;
+  }
+
+  if ( defined $local_default_storage_engine )
   {
     # Different default engine is used
     # tag test to require that engine
     $tinfo->{'ndb_test'}= 1
-      if ( $default_storage_engine =~ /^ndb/i );
+      if ( $local_default_storage_engine =~ /^ndb/i );
 
     $tinfo->{'innodb_test'}= 1
-      if ( $default_storage_engine =~ /^innodb/i );
+      if ( $local_default_storage_engine =~ /^innodb/i );
+
+    $tinfo->{'pbxt_test'}= 1
+      if ( $local_default_storage_engine =~ /^pbxt/i );
 
   }
 
@@ -1103,6 +1118,28 @@ sub collect_one_test_case {
     $tinfo->{template_path}= $config;
   }
 
+  if ( $tinfo->{'pbxt_test'} )
+  {
+    # This is a test that needs pbxt
+    if ( $::mysqld_variables{'pbxt'} eq "OFF" ||
+         ! exists $::mysqld_variables{'pbxt'} )
+    {
+      # Engine is not supported, skip it
+      $tinfo->{'skip'}= 1;
+      return $tinfo;
+    }
+  }
+  else
+  {
+    # Only disable engine if it's on by default (to avoid warnings about
+    # not existing loose options
+    if ( $::mysqld_variables{'pbxt'} eq "ON")
+    {
+      push(@{$tinfo->{'master_opt'}}, "--loose-skip-pbxt");
+      push(@{$tinfo->{'slave_opt'}}, "--loose-skip-pbxt");
+    }
+  }
+
   if ( $tinfo->{'example_plugin_test'} )
   {
     if ( !$ENV{'EXAMPLE_PLUGIN'} )
@@ -1156,6 +1193,7 @@ my @tags=
  ["include/have_log_bin.inc", "need_binlog", 1],
 
  ["include/have_innodb.inc", "innodb_test", 1],
+ ["include/have_pbxt.inc", "pbxt_test", 1],
  ["include/big_test.inc", "big_test", 1],
  ["include/have_debug.inc", "need_debug", 1],
  ["include/have_ndb.inc", "ndb_test", 1],
diff --git a/mysql-test/suite/pbxt/t/suite.opt b/mysql-test/suite/pbxt/t/suite.opt
new file mode 100644
index 00000000000..3036df38940
--- /dev/null
+++ b/mysql-test/suite/pbxt/t/suite.opt
@@ -0,0 +1 @@
+--default-storage-engine=pbxt
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 0630d194234..f7b420c3bf2 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -3924,6 +3924,12 @@ restart:
               uint                next_status;
               uint                hash_requests;
 
+              LINT_INIT(next_hash_link);
+              LINT_INIT(next_diskpos);
+              LINT_INIT(next_file);
+              LINT_INIT(next_status);
+              LINT_INIT(hash_requests);
+
               total_found++;
               found++;
               KEYCACHE_DBUG_ASSERT(found <= keycache->blocks_used);
diff --git a/mysys/my_gethostbyname.c b/mysys/my_gethostbyname.c
index 067fdfee9db..985a76faf0d 100644
--- a/mysys/my_gethostbyname.c
+++ b/mysys/my_gethostbyname.c
@@ -91,9 +91,12 @@ extern pthread_mutex_t LOCK_gethostbyname_r;
   is finished with the structure.
 */
 
-struct hostent *my_gethostbyname_r(const char *name,
-				   struct hostent *result, char *buffer,
-				   int buflen, int *h_errnop)
+struct hostent *
+my_gethostbyname_r(const char *name,
+                   struct hostent *result __attribute__((unused)),
+                   char *buffer __attribute__((unused)),
+                   int buflen__attribute__((unused)),
+                   int *h_errnop)
 {
   struct hostent *hp;
   pthread_mutex_lock(&LOCK_gethostbyname_r);
diff --git a/sql/handler.cc b/sql/handler.cc
index 72c78727111..876512ed87f 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -4129,7 +4129,7 @@ int handler::read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
 */
 int handler::read_multi_range_next(KEY_MULTI_RANGE **found_range_p)
 {
-  int result;
+  int result= 0;
   DBUG_ENTER("handler::read_multi_range_next");
 
   /* We should not be called after the last call returned EOF. */
diff --git a/sql/item.h b/sql/item.h
index beed859a2c7..8bcfaa286c7 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1077,7 +1077,8 @@ class Field_enumerator
 {
 public:
   virtual void visit_field(Field *field)= 0;
-  virtual ~Field_enumerator() {}; /* purecov: inspected */
+  virtual ~Field_enumerator() {};             /* purecov: inspected */
+  Field_enumerator() {}                       /* Remove gcc warning */
 };
 
 
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 0eeea729adc..6b5783b7e2e 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -8323,6 +8323,8 @@ mysqld_get_one_option(int optid,
   case (int) OPT_INIT_RPL_ROLE:
   {
     int role;
+    LINT_INIT(role);
+
     if (!find_opt_type(argument, &rpl_role_typelib, opt->name, &role))
     {
       rpl_status = (role == 1) ?  RPL_AUTH_MASTER : RPL_IDLE_SLAVE;
@@ -8378,6 +8380,8 @@ mysqld_get_one_option(int optid,
   case OPT_BINLOG_FORMAT:
   {
     int id;
+    LINT_INIT(id);
+
     if (!find_opt_type(argument, &binlog_format_typelib, opt->name, &id))
     {
       global_system_variables.binlog_format= opt_binlog_format_id= id - 1;
@@ -8628,6 +8632,8 @@ mysqld_get_one_option(int optid,
     else
     {
       int type;
+      LINT_INIT(type);
+
       if (!find_opt_type(argument, &delay_key_write_typelib, opt->name, &type))
         delay_key_write_options= (uint) type-1;
     }
@@ -8639,6 +8645,8 @@ mysqld_get_one_option(int optid,
   case OPT_TX_ISOLATION:
   {
     int type;
+    LINT_INIT(type);
+
     if (!find_opt_type(argument, &tx_isolation_typelib, opt->name, &type))
       global_system_variables.tx_isolation= (type-1);
     break;
@@ -8726,6 +8734,7 @@ mysqld_get_one_option(int optid,
     ulong method_conv;
     int method;
     LINT_INIT(method_conv);
+    LINT_INIT(method);
 
     myisam_stats_method_str= argument;
     if (!find_opt_type(argument, &myisam_stats_method_typelib,
@@ -8788,6 +8797,7 @@ mysqld_get_one_option(int optid,
   case OPT_THREAD_HANDLING:
   {
     int id;
+    LINT_INIT(id);
     if (!find_opt_type(argument, &thread_handling_typelib, opt->name, &id))
       global_system_variables.thread_handling= id - 1;
     opt_thread_handling= thread_handling_typelib.type_names[global_system_variables.thread_handling];
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 841acae0bf8..aa39ddb2b15 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -63,6 +63,7 @@ public:
   bool report_error(THD *thd);
   bool is_invalidated() const { return m_invalidated; }
   void reset_reprepare_observer() { m_invalidated= FALSE; }
+  Reprepare_observer() {}                     /* Remove gcc warning */
 private:
   bool m_invalidated;
 };
@@ -1107,6 +1108,7 @@ public:
     /* Ignore error */
     return TRUE;
   }
+  Dummy_error_handler() {}                    /* Remove gcc warning */
 };
 
 
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 6d20ea0d3e5..6b7b3e2c0ab 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -5668,6 +5668,10 @@ compare_tables(TABLE *table,
   */
   Alter_info tmp_alter_info(*alter_info, thd->mem_root);
   uint db_options= 0; /* not used */
+
+  /* Set default value for return value (to ensure it's always set) */
+  *need_copy_table= ALTER_TABLE_DATA_CHANGED;
+
   /* Create the prepared information. */
   if (mysql_prepare_create_table(thd, create_info,
                                  &tmp_alter_info,
@@ -5726,7 +5730,6 @@ compare_tables(TABLE *table,
       (table->s->frm_version < FRM_VER_TRUE_VARCHAR && varchar))
   {
     DBUG_PRINT("info", ("Basic checks -> ALTER_TABLE_DATA_CHANGED"));
-    *need_copy_table= ALTER_TABLE_DATA_CHANGED;
     DBUG_RETURN(0);
   }
 
@@ -5756,7 +5759,6 @@ compare_tables(TABLE *table,
     {
       DBUG_PRINT("info", ("NULL behaviour difference in field '%s' -> "
                           "ALTER_TABLE_DATA_CHANGED", new_field->field_name));
-      *need_copy_table= ALTER_TABLE_DATA_CHANGED;
       DBUG_RETURN(0);
     }
 
@@ -5779,7 +5781,6 @@ compare_tables(TABLE *table,
     {
       DBUG_PRINT("info", ("!field_is_equal('%s') -> ALTER_TABLE_DATA_CHANGED",
                           new_field->field_name));
-      *need_copy_table= ALTER_TABLE_DATA_CHANGED;
       DBUG_RETURN(0);
     }
     // Clear indexed marker
@@ -5914,7 +5915,6 @@ compare_tables(TABLE *table,
   {
     DBUG_PRINT("info", ("check_if_incompatible_data() -> "
                         "ALTER_TABLE_DATA_CHANGED"));
-    *need_copy_table= ALTER_TABLE_DATA_CHANGED;
     DBUG_RETURN(0);
   }
 
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index c6d412112c2..e1e0b3ff6c4 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1034,10 +1034,12 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
   bool parse_status;
   bool result, view_is_mergeable;
   TABLE_LIST *UNINIT_VAR(view_main_select_tables);
-
   DBUG_ENTER("mysql_make_view");
   DBUG_PRINT("info", ("table: 0x%lx (%s)", (ulong) table, table->table_name));
 
+  LINT_INIT(parse_status);
+  LINT_INIT(view_select);
+
   if (table->view)
   {
     /*
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index aff2b638e4e..5e316e2d776 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -1211,6 +1211,8 @@ static my_bool translog_set_lsn_for_files(uint32 from_file, uint32 to_file,
   for (file= from_file; file <= to_file; file++)
   {
     LOGHANDLER_FILE_INFO info;
+    LINT_INIT(info.max_lsn);
+
     File fd= open_logfile_by_number_no_cache(file);
     if ((fd < 0) ||
         ((translog_read_file_header(&info, fd) ||
@@ -3845,6 +3847,8 @@ my_bool translog_init_with_table(const char *directory,
     if (!old_log_was_recovered && old_flags == flags)
     {
       LOGHANDLER_FILE_INFO info;
+      LINT_INIT(info.maria_version);
+
       /*
         Accessing &log_descriptor.open_files without mutex is safe
         because it is initialization
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 0d4ab20a834..9dac355fd0a 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -382,7 +382,7 @@ static MI_INFO *myisammrg_attach_children_callback(void *callback_param)
     my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
   }
   DBUG_PRINT("myrg", ("MyISAM handle: 0x%lx  my_errno: %d",
-                      my_errno ? NULL : (long) myisam, my_errno));
+                      my_errno ? 0L : (long) myisam, my_errno));
 
  err:
   DBUG_RETURN(my_errno ? NULL : myisam);
diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c
index 7b310dc2eed..32ac719ec4d 100644
--- a/storage/myisammrg/myrg_open.c
+++ b/storage/myisammrg/myrg_open.c
@@ -239,6 +239,7 @@ MYRG_INFO *myrg_parent_open(const char *parent_name,
   rc= 1;
   errpos= 0;
   bzero((char*) &file_cache, sizeof(file_cache));
+  LINT_INIT(m_info);
 
   /* Open MERGE meta file. */
   if ((fd= my_open(fn_format(parent_name_buff, parent_name, "", MYRG_NAME_EXT,
diff --git a/storage/xtradb/include/ut0lst.h b/storage/xtradb/include/ut0lst.h
index 261d33963dc..fa7a186dfb1 100644
--- a/storage/xtradb/include/ut0lst.h
+++ b/storage/xtradb/include/ut0lst.h
@@ -158,7 +158,7 @@ Inserts a NODE2 after NODE1 in a list.
 /** Invalidate the pointers in a list node.
 @param NAME	list name
 @param N	pointer to the node that was removed */
-# define UT_LIST_REMOVE_CLEAR(NAME, N) while (0)
+# define UT_LIST_REMOVE_CLEAR(NAME, N) {} while (0)
 #endif
 
 /*******************************************************************//**
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index bf9c6f9626a..9e37518fb1b 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -203,7 +203,7 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs,
                              my_bool t_is_prefix)
 {
   int s_res,t_res;
-  my_wc_t UNINIT_VAR(s_wc),t_wc;
+  my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
   const uchar *se=s+slen;
   const uchar *te=t+tlen;
   MY_UNICASE_INFO **uni_plane= cs->caseinfo;
@@ -317,7 +317,7 @@ static int my_strncasecmp_ucs2(CHARSET_INFO *cs,
 			       const char *s, const char *t,  size_t len)
 {
   int s_res,t_res;
-  my_wc_t UNINIT_VAR(s_wc),t_wc;
+  my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
   const char *se=s+len;
   const char *te=t+len;
   MY_UNICASE_INFO **uni_plane= cs->caseinfo;
@@ -1384,7 +1384,7 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs,
                           my_bool t_is_prefix)
 {
   int s_res,t_res;
-  my_wc_t UNINIT_VAR(s_wc),t_wc;
+  my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
   const uchar *se=s+slen;
   const uchar *te=t+tlen;
 
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 91f633e45ce..f99c34ec39a 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -2310,7 +2310,7 @@ static int my_strnncoll_utf8(CHARSET_INFO *cs,
                              my_bool t_is_prefix)
 {
   int s_res,t_res;
-  my_wc_t UNINIT_VAR(s_wc), t_wc;
+  my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
   const uchar *se=s+slen;
   const uchar *te=t+tlen;
   MY_UNICASE_INFO **uni_plane= cs->caseinfo;
@@ -2380,7 +2380,7 @@ static int my_strnncollsp_utf8(CHARSET_INFO *cs,
                                my_bool diff_if_only_endspace_difference)
 {
   int s_res, t_res, res;
-  my_wc_t UNINIT_VAR(s_wc),t_wc;
+  my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
   const uchar *se= s+slen, *te= t+tlen;
   MY_UNICASE_INFO **uni_plane= cs->caseinfo;
 
diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp
index 0a5aa645d3a..fbac70c4ebb 100644
--- a/support-files/compiler_warnings.supp
+++ b/support-files/compiler_warnings.supp
@@ -71,6 +71,11 @@ db_vrfy.c : .*comparison is always false due to limited range of data type.*
 #
 .*: break strict-aliasing rules
 
+#
+# Ignore not important declaration warnings
+#
+.*: only defines private constructors and has no friends
+
 #
 # Ignore all conversion warnings on windows 64
 # (Is safe as we are not yet supporting strings >= 2G)
@@ -105,6 +110,11 @@ db_vrfy.c : .*comparison is always false due to limited range of data type.*
 #
 storage/maria/ma_pagecache.c: .*'info_check_pin' defined but not used
 
+#
+# Pbxt
+#
+xaction_xt\.cc: may be used uninitialized in this function
+
 #
 # I think these are due to mix of C and C++.
 #
@@ -118,6 +128,7 @@ include/runtime.hpp: .*pure_error.*
 .*/extra/yassl/taocrypt/src/blowfish\.cpp: array subscript is above array bounds
 .*/extra/yassl/taocrypt/src/file\.cpp: ignoring return value
 .*/extra/yassl/taocrypt/src/integer\.cpp: control reaches end of non-void function
+mySTL/algorithm\.hpp: is used uninitialized in this function
 
 #
 # Groff warnings on OpenSUSE.
diff --git a/unittest/mysys/waiting_threads-t.c b/unittest/mysys/waiting_threads-t.c
index 79dee219efb..e32a83ef172 100644
--- a/unittest/mysys/waiting_threads-t.c
+++ b/unittest/mysys/waiting_threads-t.c
@@ -258,7 +258,7 @@ void do_tests()
 #define test_kill_strategy(X)                   \
   diag("kill strategy: " #X);                   \
   DBUG_EXECUTE("reset_file",                    \
-               { rewind(DBUG_FILE); (void) ftruncate(fileno(DBUG_FILE), 0); }); \
+               { rewind(DBUG_FILE); my_chsize(fileno(DBUG_FILE), 0, 0, MYF(MY_WME)); }); \
   DBUG_PRINT("info", ("kill strategy: " #X));   \
   kill_strategy=X;                              \
   do_one_test();

From cebec393cf0a5558a2800fb193ba098bda4eabe1 Mon Sep 17 00:00:00 2001
From: Michael Widenius <monty@askmonty.org>
Date: Wed, 31 Mar 2010 22:12:21 +0300
Subject: [PATCH 5/5] Fixed compiler warnings Fixed random failure in test
 system

BUILD/compile-solaris-sparc:
  Addex EXTRA_FLAGS to configure line (to get rid of warnings for not initialzed variables on buildbot)
cmd-line-utils/libedit/filecomplete.c:
  Remove not used variables
mysql-test/suite/rpl/r/rpl_optimize.result:
  Updated result
mysql-test/suite/rpl/t/rpl_optimize.test:
  Use sync_salve_with_master to ensure cleanup on slave
support-files/compiler_warnings.supp:
  Added suppression of libedit files
---
 BUILD/compile-solaris-sparc                | 2 +-
 cmd-line-utils/libedit/filecomplete.c      | 3 +--
 mysql-test/suite/rpl/r/rpl_optimize.result | 1 +
 mysql-test/suite/rpl/t/rpl_optimize.test   | 9 ++++++---
 support-files/compiler_warnings.supp       | 6 ++++++
 5 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/BUILD/compile-solaris-sparc b/BUILD/compile-solaris-sparc
index b287baa6845..bc74d7275f3 100755
--- a/BUILD/compile-solaris-sparc
+++ b/BUILD/compile-solaris-sparc
@@ -9,6 +9,6 @@ PATH=$PATH:/usr/ccs/bin:/usr/local/bin
 path=`dirname $0`
 . "$path/autorun.sh"
 
-CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused  -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti  -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g" LIBS="-lmtmalloc" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
+CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused  -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa $EXTRA_FLAGS $EXTRA_CFLAGS" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti  -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g $EXTRA_FLAGS $EXTRA_CXXFLAGS" LIBS="-lmtmalloc" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
 
 make -j 4
diff --git a/cmd-line-utils/libedit/filecomplete.c b/cmd-line-utils/libedit/filecomplete.c
index 4c63f57bc45..05bd10e9f9e 100644
--- a/cmd-line-utils/libedit/filecomplete.c
+++ b/cmd-line-utils/libedit/filecomplete.c
@@ -95,10 +95,9 @@ static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', '@', '$',
 char *
 fn_tilde_expand(const char *txt)
 {
-	struct passwd pwres, *pass;
+	struct passwd *pass;
 	char *temp;
 	size_t len = 0;
-	char pwbuf[1024];
 
 	if (txt[0] != '~')
 		return (strdup(txt));
diff --git a/mysql-test/suite/rpl/r/rpl_optimize.result b/mysql-test/suite/rpl/r/rpl_optimize.result
index 1ae94a3ca36..8c4bcf48a65 100644
--- a/mysql-test/suite/rpl/r/rpl_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_optimize.result
@@ -4,6 +4,7 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+drop tables if exists t1;
 CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
 create table t1 (a int not null auto_increment primary key, b int, key(b));
 INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
diff --git a/mysql-test/suite/rpl/t/rpl_optimize.test b/mysql-test/suite/rpl/t/rpl_optimize.test
index b98f3becd76..7bd53a3fead 100644
--- a/mysql-test/suite/rpl/t/rpl_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_optimize.test
@@ -15,6 +15,10 @@
 -- source include/not_staging.inc
 -- source include/master-slave.inc
 
+--disable_warnings
+drop tables if exists t1;
+--enable_warnings
+
 CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
 
 create table t1 (a int not null auto_increment primary key, b int, key(b));
@@ -51,10 +55,9 @@ sync_with_master; # won't work if slave SQL thread stopped
 
 connection master; # cleanup
 drop table t1;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
 
 # If the machine is so fast that slave syncs before OPTIMIZE
-# starts, this test wil demonstrate nothing but will pass.
+# starts, this test will demonstrate nothing but will pass.
 
 # End of 4.1 tests
diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp
index fbac70c4ebb..f259fcd9b0e 100644
--- a/support-files/compiler_warnings.supp
+++ b/support-files/compiler_warnings.supp
@@ -54,6 +54,12 @@ db_vrfy.c : .*comparison is always false due to limited range of data type.*
 # readline is not maintained by us
 #
 .*/cmd-line-utils/readline/.* : .*
+readline\.c : unused parameter
+term\.c : unused parameter
+vi\.c : unused parameter
+common\.c : unused parameter
+term\.c : *.*
+
 
 #
 # Ignore some warnings in libevent, which is not maintained by us.