summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-08-31 15:24:06 -0700
committerunknown <jimw@mysql.com>2005-08-31 15:24:06 -0700
commitbdddd8c089c05ac8e74ab4996c601175d52a5dc8 (patch)
tree63161ccb51465f90409872099f902b79a9d23837 /sql
parentc6b54efea2f564d7a4d9fda7bc79f2601395250a (diff)
parent92e2b9edb1660a2f9d7dcd7543fc5140abd3ff0d (diff)
downloadmariadb-git-bdddd8c089c05ac8e74ab4996c601175d52a5dc8.tar.gz
Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into mysql.com:/home/jimw/my/mysql-5.0-clean mysql-test/r/func_gconcat.result: Auto merged mysql-test/t/func_gconcat.test: Auto merged mysql-test/t/system_mysql_db_fix.test: Auto merged ndb/src/kernel/blocks/backup/BackupInit.cpp: Auto merged ndb/src/kernel/blocks/dbacc/Dbacc.hpp: Auto merged ndb/src/kernel/blocks/dbacc/DbaccInit.cpp: Auto merged ndb/src/kernel/blocks/dbacc/DbaccMain.cpp: Auto merged ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Auto merged ndb/src/kernel/blocks/dbdict/Dbdict.hpp: Auto merged ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Auto merged ndb/src/kernel/blocks/dblqh/Dblqh.hpp: Auto merged ndb/src/kernel/blocks/dblqh/DblqhInit.cpp: Auto merged ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Auto merged ndb/src/kernel/blocks/dbtup/Dbtup.hpp: Auto merged ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: Auto merged ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: Auto merged ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Auto merged ndb/src/kernel/vm/SimulatedBlock.cpp: Auto merged ndb/src/kernel/vm/SimulatedBlock.hpp: Auto merged ndb/src/mgmclient/CommandInterpreter.cpp: Auto merged ndb/src/mgmsrv/ConfigInfo.cpp: Auto merged sql/item_sum.cc: Auto merged sql/sql_table.cc: Auto merged tests/mysql_client_test.c: Auto merged ndb/src/ndbapi/ndberror.c: Resolve conflicts sql/ha_innodb.cc: Resolve conflicts sql/item_strfunc.cc: Resolve conflicts
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++))