summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--acinclude.m47
-rw-r--r--myisam/mi_delete_all.c5
-rw-r--r--mysql-test/r/null_key.result35
-rw-r--r--sql/ha_innodb.cc40
-rw-r--r--sql/sql_parse.cc8
5 files changed, 49 insertions, 46 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 76953e3e4c2..b91c6905538 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -746,7 +746,12 @@ AC_MSG_CHECKING(for OpenSSL)
AC_DEFINE(HAVE_VIO)
AC_MSG_RESULT(yes)
openssl_libs="-L$OPENSSL_LIB -lssl -lcrypto"
- openssl_includes="-I$OPENSSL_INCLUDE"
+ # Don't set openssl_includes to /usr/include as this gives us a lot of
+ # compiler warnings when using gcc 3.x
+ if test "$OPENSSL_INCLUDE" != "/usr/include"
+ then
+ openssl_includes="-I$OPENSSL_INCLUDE"
+ fi
AC_DEFINE(HAVE_OPENSSL)
# openssl-devel-0.9.6 requires dlopen() and we can't link staticly
diff --git a/myisam/mi_delete_all.c b/myisam/mi_delete_all.c
index 58f885b63f0..7e4239bc7d1 100644
--- a/myisam/mi_delete_all.c
+++ b/myisam/mi_delete_all.c
@@ -52,6 +52,11 @@ int mi_delete_all_rows(MI_INFO *info)
VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
if (my_chsize(info->dfile, 0, 0, MYF(MY_WME)))
goto err;
+ /*
+ If we are using delayed keys or if the user has done changes to the tables
+ since it was locked then there may be key blocks in the key cache
+ */
+ flush_key_blocks(share->kfile, FLUSH_IGNORE_CHANGED);
allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(0);
diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result
index 91cd9dbbc7c..bb8531a9fee 100644
--- a/mysql-test/r/null_key.result
+++ b/mysql-test/r/null_key.result
@@ -188,10 +188,43 @@ id uniq_id
4 2
7 3
8 4
+DROP table t1,t2;
+CREATE TABLE `t1` (
+`order_id` char(32) NOT NULL default '',
+`product_id` char(32) NOT NULL default '',
+`product_type` int(11) NOT NULL default '0',
+PRIMARY KEY (`order_id`,`product_id`,`product_type`)
+) TYPE=MyISAM;
+CREATE TABLE `t2` (
+`order_id` char(32) NOT NULL default '',
+`product_id` char(32) NOT NULL default '',
+`product_type` int(11) NOT NULL default '0',
+PRIMARY KEY (`order_id`,`product_id`,`product_type`)
+) TYPE=MyISAM;
+INSERT INTO t1 (order_id, product_id, product_type) VALUES
+('3d7ce39b5d4b3e3d22aaafe9b633de51',1206029, 3),
+('3d7ce39b5d4b3e3d22aaafe9b633de51',5880836, 3),
+('9d9aad7764b5b2c53004348ef8d34500',2315652, 3);
+INSERT INTO t2 (order_id, product_id, product_type) VALUES
+('9d9aad7764b5b2c53004348ef8d34500',2315652, 3);
+select t1.* from t1
+left join t2 using(order_id, product_id, product_type)
+where t2.order_id=NULL;
order_id product_id product_type
+select t1.* from t1
+left join t2 using(order_id, product_id, product_type)
+where t2.order_id is NULL;
order_id product_id product_type
3d7ce39b5d4b3e3d22aaafe9b633de51 1206029 3
3d7ce39b5d4b3e3d22aaafe9b633de51 5880836 3
+drop table t1,t2;
+create table t1 (id int);
+insert into t1 values (null), (0);
+create table t2 (id int);
+insert into t2 values (null);
+select * from t1, t2 where t1.id = t2.id;
id id
+alter table t1 add key id (id);
+select * from t1, t2 where t1.id = t2.id;
id id
-DROP table t1,t2;
+drop table t1,t2;
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index bb3f254bc03..9e174d7ee59 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -3649,46 +3649,6 @@ int
ha_innobase::start_stmt(
/*====================*/
/* out: 0 or error code */
- THD* thd) /* in: handle to the user thread */
-{
- row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt;
- trx_t* trx;
-
- update_thd(thd);
-
- trx = prebuilt->trx;
-
- innobase_release_stat_resources(trx);
- trx_mark_sql_stat_end(trx);
-
- auto_inc_counter_for_this_stat = 0;
- prebuilt->sql_stat_start = TRUE;
- prebuilt->hint_no_need_to_fetch_extra_cols = TRUE;
- prebuilt->read_just_key = 0;
-
- if (prebuilt->select_lock_type == LOCK_NONE) {
- /* This handle is for a temporary table created inside
- this same LOCK TABLES; since MySQL does NOT call external_lock
- in this case, we must use x-row locks inside InnoDB to be
- prepared for an update of a row */
-
- prebuilt->select_lock_type = LOCK_X;
- }
-
- thd->transaction.all.innodb_active_trans = 1;
-
- return(0);
-}
-
-/**********************************************************************
-When we create a temporary table inside MySQL LOCK TABLES, MySQL will
-not call external_lock for the temporary table when it uses it. Instead,
-it will call this function. */
-
-int
-ha_innobase::start_stmt(
-/*====================*/
- /* out: 0 or error code */
THD* thd) /* in: handle to the user thread */
{
row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 2642a27cfff..693de0dccb7 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3356,10 +3356,10 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables)
}
if (options & REFRESH_LOG)
{
- mysql_log.new_file(0);
- mysql_update_log.new_file(0);
- mysql_bin_log.new_file(0);
- mysql_slow_log.new_file(0);
+ mysql_log.new_file(1);
+ mysql_update_log.new_file(1);
+ mysql_bin_log.new_file(1);
+ mysql_slow_log.new_file(1);
if (ha_flush_logs())
result=1;
}