Below is the list of changes that have just been committed into a local
5.0 repository of serg. When serg does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-03-24 17:16:53+02:00, serg@stripped +11 -0
Merge bk-internal.mysql.com:/home/bk/mysql-5.0-marvel
into sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.0
MERGE: 1.2392.114.5
mysql-test/r/sp.result@stripped, 2007-03-24 17:16:47+02:00, serg@stripped +0 -0
Auto merged
MERGE: 1.221.1.1
mysql-test/t/sp.test@stripped, 2007-03-24 17:16:48+02:00, serg@stripped +0 -0
Auto merged
MERGE: 1.211.1.1
sql/ha_ndbcluster.cc@stripped, 2007-03-24 17:16:48+02:00, serg@stripped +0 -0
Auto merged
MERGE: 1.300.1.2
sql/handler.cc@stripped, 2007-03-24 17:16:48+02:00, serg@stripped +0 -0
Auto merged
MERGE: 1.228.1.1
sql/mysql_priv.h@stripped, 2007-03-24 17:16:48+02:00, serg@stripped +0 -0
Auto merged
MERGE: 1.438.1.1
sql/sp_head.cc@stripped, 2007-03-24 17:16:48+02:00, serg@stripped +0 -0
Auto merged
MERGE: 1.236.1.2
sql/sql_base.cc@stripped, 2007-03-24 17:16:48+02:00, serg@stripped +0 -0
Auto merged
MERGE: 1.370.2.1
sql/sql_class.h@stripped, 2007-03-24 17:16:49+02:00, serg@stripped +0 -0
Auto merged
MERGE: 1.325.1.1
sql/sql_insert.cc@stripped, 2007-03-24 17:16:49+02:00, serg@stripped +0 -0
Auto merged
MERGE: 1.225.1.1
sql/sql_table.cc@stripped, 2007-03-24 17:16:49+02:00, serg@stripped +0 -0
Auto merged
MERGE: 1.333.1.3
sql/sql_view.cc@stripped, 2007-03-24 17:16:49+02:00, serg@stripped +0 -0
Auto merged
MERGE: 1.106.1.1
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: serg
# Host: sergbook.mysql.com
# Root: /usr/home/serg/Abk/mysql-5.0/RESYNC
--- 1.229/sql/handler.cc 2007-03-24 17:17:00 +02:00
+++ 1.230/sql/handler.cc 2007-03-24 17:17:00 +02:00
@@ -830,7 +830,7 @@
the error log; but we don't want users to wonder why they have this
message in the error log, so we don't send it.
*/
- if (is_real_trans && (thd->options & OPTION_STATUS_NO_TRANS_UPDATE) &&
+ if (is_real_trans && thd->no_trans_update.all &&
!thd->slave_thread)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARNING_NOT_COMPLETE_ROLLBACK,
--- 1.440/sql/mysql_priv.h 2007-03-24 17:17:00 +02:00
+++ 1.441/sql/mysql_priv.h 2007-03-24 17:17:00 +02:00
@@ -347,9 +347,6 @@
in the user query has requested */
#define SELECT_ALL (ULL(1) << 24) // SELECT, user, parser
-/* Set if we are updating a non-transaction safe table */
-#define OPTION_STATUS_NO_TRANS_UPDATE (ULL(1) << 25) // THD, intern
-
/* The following can be set when importing tables in a 'wrong order'
to suppress foreign key checks */
#define OPTION_NO_FOREIGN_KEY_CHECKS (ULL(1) << 26) // THD, user, binlog
--- 1.372/sql/sql_base.cc 2007-03-24 17:17:00 +02:00
+++ 1.373/sql/sql_base.cc 2007-03-24 17:17:00 +02:00
@@ -3573,14 +3573,35 @@
{
Field *cur_field= find_field_in_table_ref(thd, cur_table, name, length,
item->name, db, table_name, ref,
- check_privileges, allow_rowid,
+ check_privileges,
+ allow_rowid,
&(item->cached_field_index),
register_tree_change,
&actual_table);
if (cur_field)
{
if (cur_field == WRONG_GRANT)
- return (Field*) 0;
+ {
+ if (thd->lex->sql_command != SQLCOM_SHOW_FIELDS)
+ return (Field*) 0;
+
+ thd->clear_error();
+ cur_field= find_field_in_table_ref(thd, cur_table, name, length,
+ item->name, db, table_name, ref,
+ false,
+ allow_rowid,
+ &(item->cached_field_index),
+ register_tree_change,
+ &actual_table);
+ if (cur_field)
+ {
+ Field *nf=new Field_null(NULL,0,Field::NONE,
+ cur_field->field_name,
+ cur_field->table,
+ &my_charset_bin);
+ cur_field= nf;
+ }
+ }
/*
Store the original table of the field, which may be different from
@@ -3603,7 +3624,7 @@
report_error == IGNORE_EXCEPT_NON_UNIQUE)
my_error(ER_NON_UNIQ_ERROR, MYF(0),
table_name ? item->full_name() : name, thd->where);
- return (Field*) 0;
+ return (Field*) 0;
}
found= cur_field;
}
--- 1.326/sql/sql_class.h 2007-03-24 17:17:00 +02:00
+++ 1.327/sql/sql_class.h 2007-03-24 17:17:00 +02:00
@@ -1440,7 +1440,11 @@
bool charset_is_system_charset, charset_is_collation_connection;
bool charset_is_character_set_filesystem;
bool enable_slow_log; /* enable slow log for current statement */
- bool no_trans_update, abort_on_warning;
+ struct {
+ bool all:1;
+ bool stmt:1;
+ } no_trans_update;
+ bool abort_on_warning;
bool got_warning; /* Set on call to push_warning() */
bool no_warnings_for_error; /* no warnings on call to my_error() */
/* set during loop of derived table processing */
@@ -1667,7 +1671,7 @@
inline bool really_abort_on_warning()
{
return (abort_on_warning &&
- (!no_trans_update ||
+ (!no_trans_update.stmt ||
(variables.sql_mode & MODE_STRICT_ALL_TABLES)));
}
void set_status_var_init();
--- 1.226/sql/sql_insert.cc 2007-03-24 17:17:00 +02:00
+++ 1.227/sql/sql_insert.cc 2007-03-24 17:17:00 +02:00
@@ -584,7 +584,7 @@
if (lock_type != TL_WRITE_DELAYED && !thd->prelocked_mode)
table->file->start_bulk_insert(values_list.elements);
- thd->no_trans_update= 0;
+ thd->no_trans_update.stmt= FALSE;
thd->abort_on_warning= (!ignore && (thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
MODE_STRICT_ALL_TABLES)));
@@ -731,7 +731,7 @@
error=1;
}
if (!transactional_table)
- thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
+ thd->no_trans_update.all= TRUE;
}
}
if (transactional_table)
@@ -1129,7 +1129,7 @@
then both on update triggers will work instead. Similarly both on
delete triggers will be invoked if we will delete conflicting records.
- Sets thd->no_trans_update if table which is updated didn't have
+ Sets thd->no_trans_update.stmt to TRUE if table which is updated didn't have
transactions.
RETURN VALUE
@@ -1295,7 +1295,7 @@
goto err;
info->deleted++;
if (!table->file->has_transactions())
- thd->no_trans_update= 1;
+ thd->no_trans_update.stmt= TRUE;
if (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_DELETE,
TRG_ACTION_AFTER, TRUE))
@@ -1327,7 +1327,7 @@
if (key)
my_safe_afree(key,table->s->max_unique_length,MAX_KEY_LENGTH);
if (!table->file->has_transactions())
- thd->no_trans_update= 1;
+ thd->no_trans_update.stmt= TRUE;
DBUG_RETURN(trg_error);
err:
@@ -2520,7 +2520,7 @@
table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE);
table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS);
}
- thd->no_trans_update= 0;
+ thd->no_trans_update.stmt= FALSE;
thd->abort_on_warning= (!info.ignore &&
(thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
@@ -2678,7 +2678,7 @@
mysql_bin_log.write(&qinfo);
}
if (!table->s->tmp_table)
- thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
+ thd->no_trans_update.all= TRUE;
}
if (info.copied || info.deleted || info.updated)
{
@@ -2707,7 +2707,7 @@
{
query_cache_invalidate3(thd, table, 1);
if (!(table->file->has_transactions() || table->s->tmp_table))
- thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
+ thd->no_trans_update.all= TRUE;
}
if (last_insert_id)
@@ -2933,7 +2933,7 @@
}
if (!thd->prelocked_mode)
table->file->start_bulk_insert((ha_rows) 0);
- thd->no_trans_update= 0;
+ thd->no_trans_update.stmt= FALSE;
thd->abort_on_warning= (!info.ignore &&
(thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
--- 1.335/sql/sql_table.cc 2007-03-24 17:17:00 +02:00
+++ 1.336/sql/sql_table.cc 2007-03-24 17:17:00 +02:00
@@ -3968,7 +3968,7 @@
alter_table_manage_keys(to, from->file->indexes_are_disabled(), keys_onoff);
/* We can abort alter table for any table type */
- thd->no_trans_update= 0;
+ thd->no_trans_update.stmt= FALSE;
thd->abort_on_warning= !ignore && test(thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
MODE_STRICT_ALL_TABLES));
--- 1.107/sql/sql_view.cc 2007-03-24 17:17:00 +02:00
+++ 1.108/sql/sql_view.cc 2007-03-24 17:17:00 +02:00
@@ -1018,6 +1018,11 @@
CHARSET_INFO *save_cs= thd->variables.character_set_client;
thd->variables.character_set_client= system_charset_info;
res= MYSQLparse((void *)thd);
+
+ if ((old_lex->sql_command == SQLCOM_SHOW_FIELDS) ||
+ (old_lex->sql_command == SQLCOM_SHOW_CREATE))
+ lex->sql_command= old_lex->sql_command;
+
thd->variables.character_set_client= save_cs;
thd->variables.sql_mode= save_mode;
}
@@ -1043,7 +1048,7 @@
}
}
else if (!table->prelocking_placeholder &&
- old_lex->sql_command == SQLCOM_SHOW_CREATE &&
+ (old_lex->sql_command == SQLCOM_SHOW_CREATE) &&
!table->belong_to_view)
{
if (check_table_access(thd, SHOW_VIEW_ACL, table, 0))
--- 1.301/sql/ha_ndbcluster.cc 2007-03-24 17:17:00 +02:00
+++ 1.302/sql/ha_ndbcluster.cc 2007-03-24 17:17:00 +02:00
@@ -3636,8 +3636,7 @@
{
m_transaction_on= FALSE;
/* Would be simpler if has_transactions() didn't always say "yes" */
- thd->options|= OPTION_STATUS_NO_TRANS_UPDATE;
- thd->no_trans_update= TRUE;
+ thd->no_trans_update.all= thd->no_trans_update.stmt= TRUE;
}
else if (!thd->transaction.on)
m_transaction_on= FALSE;
--- 1.222/mysql-test/r/sp.result 2007-03-24 17:17:00 +02:00
+++ 1.223/mysql-test/r/sp.result 2007-03-24 17:17:00 +02:00
@@ -5970,3 +5970,28 @@
DROP FUNCTION bug25373|
DROP TABLE t3|
drop table t1,t2;
+CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM;
+CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb;
+set @a=0;
+CREATE function bug27354() RETURNS int deterministic
+begin
+insert into t1 values (null);
+set @a=@a+1;
+return @a;
+end|
+update t2 set b=1 where a=bug27354();
+select count(t_1.a),count(t_2.a) from t1 as t_1, t2 as t_2 /* must be 0,0 */;
+count(t_1.a) count(t_2.a)
+0 0
+insert into t2 values (1,1),(2,2),(3,3);
+update t2 set b=-b where a=bug27354();
+select * from t2 /* must return 1,-1 ... */;
+a b
+1 -1
+2 -2
+3 -3
+select count(*) from t1 /* must be 3 */;
+count(*)
+3
+drop table t1,t2;
+drop function bug27354;
--- 1.212/mysql-test/t/sp.test 2007-03-24 17:17:00 +02:00
+++ 1.213/mysql-test/t/sp.test 2007-03-24 17:17:00 +02:00
@@ -6946,3 +6946,27 @@
# practical, or create table t3, t4 etc temporarily (and drop them).
delimiter ;|
drop table t1,t2;
+
+CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM;
+CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb;
+set @a=0;
+
+delimiter |;
+CREATE function bug27354() RETURNS int deterministic
+begin
+insert into t1 values (null);
+set @a=@a+1;
+return @a;
+end|
+
+delimiter ;|
+update t2 set b=1 where a=bug27354();
+select count(t_1.a),count(t_2.a) from t1 as t_1, t2 as t_2 /* must be 0,0 */;
+insert into t2 values (1,1),(2,2),(3,3);
+update t2 set b=-b where a=bug27354();
+select * from t2 /* must return 1,-1 ... */;
+select count(*) from t1 /* must be 3 */;
+
+
+drop table t1,t2;
+drop function bug27354;
--- 1.239/sql/sp_head.cc 2007-03-24 17:17:00 +02:00
+++ 1.240/sql/sp_head.cc 2007-03-24 17:17:00 +02:00
@@ -337,13 +337,13 @@
enum_check_fields save_count_cuted_fields= thd->count_cuted_fields;
bool save_abort_on_warning= thd->abort_on_warning;
- bool save_no_trans_update= thd->no_trans_update;
+ bool save_no_trans_update_stmt= thd->no_trans_update.stmt;
thd->count_cuted_fields= CHECK_FIELD_ERROR_FOR_NULL;
thd->abort_on_warning=
thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES);
- thd->no_trans_update= 0;
+ thd->no_trans_update.stmt= FALSE;
/* Save the value in the field. Convert the value if needed. */
@@ -351,7 +351,7 @@
thd->count_cuted_fields= save_count_cuted_fields;
thd->abort_on_warning= save_abort_on_warning;
- thd->no_trans_update= save_no_trans_update;
+ thd->no_trans_update.stmt= save_no_trans_update_stmt;
if (thd->net.report_error)
{
| Thread |
|---|
| • bk commit into 5.0 tree (serg:1.2420) | Sergei Golubchik | 24 Mar |