Commit a54df74a authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi

Fixes after last merge.

Ignore changed keyblocks when on does DELETE FROM table_name;
parent 26b1bbdb
...@@ -746,7 +746,12 @@ AC_MSG_CHECKING(for OpenSSL) ...@@ -746,7 +746,12 @@ AC_MSG_CHECKING(for OpenSSL)
AC_DEFINE(HAVE_VIO) AC_DEFINE(HAVE_VIO)
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
openssl_libs="-L$OPENSSL_LIB -lssl -lcrypto" openssl_libs="-L$OPENSSL_LIB -lssl -lcrypto"
# 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" openssl_includes="-I$OPENSSL_INCLUDE"
fi
AC_DEFINE(HAVE_OPENSSL) AC_DEFINE(HAVE_OPENSSL)
# openssl-devel-0.9.6 requires dlopen() and we can't link staticly # openssl-devel-0.9.6 requires dlopen() and we can't link staticly
......
...@@ -52,6 +52,11 @@ int mi_delete_all_rows(MI_INFO *info) ...@@ -52,6 +52,11 @@ int mi_delete_all_rows(MI_INFO *info)
VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE)); VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
if (my_chsize(info->dfile, 0, 0, MYF(MY_WME))) if (my_chsize(info->dfile, 0, 0, MYF(MY_WME)))
goto err; 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 */ allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(0); DBUG_RETURN(0);
......
...@@ -188,10 +188,43 @@ id uniq_id ...@@ -188,10 +188,43 @@ id uniq_id
4 2 4 2
7 3 7 3
8 4 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 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 order_id product_id product_type
3d7ce39b5d4b3e3d22aaafe9b633de51 1206029 3 3d7ce39b5d4b3e3d22aaafe9b633de51 1206029 3
3d7ce39b5d4b3e3d22aaafe9b633de51 5880836 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 id id
alter table t1 add key id (id);
select * from t1, t2 where t1.id = t2.id;
id id id id
DROP table t1,t2; drop table t1,t2;
...@@ -3640,46 +3640,6 @@ ha_innobase::reset(void) ...@@ -3640,46 +3640,6 @@ ha_innobase::reset(void)
} }
/**********************************************************************
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;
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 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, not call external_lock for the temporary table when it uses it. Instead,
......
...@@ -3356,10 +3356,10 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables) ...@@ -3356,10 +3356,10 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables)
} }
if (options & REFRESH_LOG) if (options & REFRESH_LOG)
{ {
mysql_log.new_file(0); mysql_log.new_file(1);
mysql_update_log.new_file(0); mysql_update_log.new_file(1);
mysql_bin_log.new_file(0); mysql_bin_log.new_file(1);
mysql_slow_log.new_file(0); mysql_slow_log.new_file(1);
if (ha_flush_logs()) if (ha_flush_logs())
result=1; result=1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment