1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Merge mysql.com:/opt/local/work/mysql-4.1-16365

into  mysql.com:/opt/local/work/mysql-5.0-merge


sql/set_var.cc:
  Auto merged
mysql-test/r/ps.result:
  Manual merge.
mysql-test/t/ps.test:
  Manual merge.
sql/item_row.cc:
  Manual merge.
sql/item_row.h:
  Manual merge.
sql/mysql_priv.h:
  Manual merge.
sql/mysqld.cc:
  Manual merge.
sql/set_var.h:
  Manual merge.
sql/sql_class.cc:
  Manual merge.
sql/sql_class.h:
  Manual merge.
sql/sql_prepare.cc:
  Manual merge.
This commit is contained in:
unknown
2006-04-12 18:30:54 +04:00
10 changed files with 397 additions and 51 deletions

View File

@@ -1848,8 +1848,11 @@ void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length)
if (thd->stmt_map.insert(stmt))
{
delete stmt;
DBUG_VOID_RETURN; /* out of memory */
/*
The error is set in the insert. The statement itself
will be also deleted there (this is how the hash works).
*/
DBUG_VOID_RETURN;
}
/* Reset warnings from previous command */
@@ -2026,9 +2029,14 @@ void mysql_sql_stmt_prepare(THD *thd)
DBUG_VOID_RETURN; /* out of memory */
}
if (stmt->set_name(name) || thd->stmt_map.insert(stmt))
if (thd->stmt_map.insert(stmt))
{
delete stmt;
/* The statement is deleted and an error is set if insert fails */
DBUG_VOID_RETURN;
}
if (stmt->set_name(name))
{
thd->stmt_map.erase(stmt);
DBUG_VOID_RETURN;
}