summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorjimw@mysql.com <>2005-08-31 15:24:06 -0700
committerjimw@mysql.com <>2005-08-31 15:24:06 -0700
commit1d997477aa848779ea38526e18aaf824fd0ac3de (patch)
tree63161ccb51465f90409872099f902b79a9d23837 /sql
parent41fc00641cf0bcab8bf52059c4e482c964f261fc (diff)
parente0f3c5c0fb936fd0ebeee54c07ae16265e9537b9 (diff)
downloadmariadb-git-1d997477aa848779ea38526e18aaf824fd0ac3de.tar.gz
Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into mysql.com:/home/jimw/my/mysql-5.0-clean
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innodb.cc18
-rw-r--r--sql/item_strfunc.cc6
-rw-r--r--sql/item_sum.cc4
-rw-r--r--sql/sql_table.cc2
4 files changed, 22 insertions, 8 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 9ba75acb444..404ac95b81a 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -2407,6 +2407,7 @@ ha_innobase::open(
my_free((char*) upd_buff, MYF(0));
my_errno = ENOENT;
+ dict_table_decrement_handle_count(ib_table);
DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
}
@@ -6682,7 +6683,7 @@ ha_innobase::store_lock(
if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) {
- /* Starting from 5.0.7, we weaken also the table locks
+ /* Starting from 5.0.7, we weaken also the table locks
set at the start of a MySQL stored procedure call, just like
we weaken the locks set at the start of an SQL statement.
MySQL does set thd->in_lock_tables TRUE there, but in reality
@@ -6690,6 +6691,21 @@ ha_innobase::store_lock(
single transaction stored procedure call deterministic
(if it does not use a consistent read). */
+ if (lock_type == TL_READ && thd->in_lock_tables) {
+ /* We come here if MySQL is processing LOCK TABLES
+ ... READ LOCAL. MyISAM under that table lock type
+ reads the table as it was at the time the lock was
+ granted (new inserts are allowed, but not seen by the
+ reader). To get a similar effect on an InnoDB table,
+ we must use LOCK TABLES ... READ. We convert the lock
+ type here, so that for InnoDB, READ LOCAL is
+ equivalent to READ. This will change the InnoDB
+ behavior in mysqldump, so that dumps of InnoDB tables
+ are consistent with dumps of MyISAM tables. */
+
+ lock_type = TL_READ_NO_INSERT;
+ }
+
/* If we are not doing a LOCK TABLE or DISCARD/IMPORT
TABLESPACE or TRUNCATE TABLE, then allow multiple writers */
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 094a0c56319..4fd33c06095 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -461,11 +461,11 @@ String *Item_func_des_decrypt::val_str(String *str)
struct st_des_keyblock keyblock;
struct st_des_keyschedule keyschedule;
String *res= args[0]->val_str(str);
- uint length= 0, tail;
+ uint length,tail;
- if ((null_value=args[0]->null_value))
+ if ((null_value= args[0]->null_value))
return 0;
- length=res->length();
+ length= res->length();
if (length < 9 || (length % 8) != 1 || !((*res)[0] & 128))
return res; // Skip decryption if not encrypted
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index e86d4f0d8ba..f6544d76504 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -2983,7 +2983,7 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
}
thd->allow_sum_func= 0;
- maybe_null= 0;
+ maybe_null= 1;
/*
Fix fields for select list and ORDER clause
@@ -2995,8 +2995,6 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
args[i]->fix_fields(thd, args + i)) ||
args[i]->check_cols(1))
return TRUE;
- if (i < arg_count_field)
- maybe_null|= args[i]->maybe_null;
}
if (agg_item_charsets(collation, func_name(),
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 1bb6e66a12e..beb43100442 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -3241,7 +3241,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
Field **f_ptr,*field;
for (f_ptr=table->field ; (field= *f_ptr) ; f_ptr++)
{
- /* Check if field should be droped */
+ /* Check if field should be dropped */
Alter_drop *drop;
drop_it.rewind();
while ((drop=drop_it++))