Commit f609d604 authored by unknown's avatar unknown

Merge bk-internal:/home/bk/mysql-5.0

into serg.mylan:/usr/home/serg/Abk/mysql-5.0


sql/ha_ndbcluster.cc:
  Auto merged
parents a44711db 7a053c7d
......@@ -262,7 +262,11 @@ n
5
6
7
rollback to savepoint `savept2`;
savepoint savept3;
rollback to savepoint savept2;
rollback to savepoint savept3;
ERROR 42000: SAVEPOINT savept3 does not exist
rollback to savepoint savept2;
release savepoint `my_savepoint`;
select n from t1;
n
......@@ -272,6 +276,8 @@ n
7
rollback to savepoint `my_savepoint`;
ERROR 42000: SAVEPOINT my_savepoint does not exist
rollback to savepoint savept2;
ERROR 42000: SAVEPOINT savept2 does not exist
insert into t1 values (8);
savepoint sv;
commit;
......
......@@ -130,17 +130,26 @@ insert into t1 values (6);
insert into t1 values (4);
select n from t1;
set autocommit=0;
#
# savepoints
#
begin;
savepoint `my_savepoint`;
insert into t1 values (7);
savepoint `savept2`;
insert into t1 values (3);
select n from t1;
rollback to savepoint `savept2`;
savepoint savept3;
rollback to savepoint savept2;
--error 1305
rollback to savepoint savept3;
rollback to savepoint savept2;
release savepoint `my_savepoint`;
select n from t1;
-- error 1305
rollback to savepoint `my_savepoint`;
--error 1305
rollback to savepoint savept2;
insert into t1 values (8);
savepoint sv;
commit;
......
......@@ -428,7 +428,7 @@ void ha_ndbcluster::invalidateDictionaryCache()
case(PRIMARY_KEY_ORDERED_INDEX):
case(ORDERED_INDEX):
dict->invalidateIndex(index->getName(), m_tabname);
break;
break;
case(UNIQUE_ORDERED_INDEX):
dict->invalidateIndex(index->getName(), m_tabname);
case(UNIQUE_INDEX):
......
......@@ -355,11 +355,11 @@ int check_user(THD *thd, enum enum_server_command command,
if (check_count)
{
VOID(pthread_mutex_lock(&LOCK_thread_count));
bool count_ok= thread_count < max_connections + delayed_insert_threads
bool count_ok= thread_count <= max_connections + delayed_insert_threads
|| (thd->master_access & SUPER_ACL);
VOID(pthread_mutex_unlock(&LOCK_thread_count));
if (!count_ok)
{ // too many connections
{ // too many connections
net_send_error(thd, ER_CON_COUNT_ERROR);
DBUG_RETURN(-1);
}
......@@ -3805,21 +3805,21 @@ mysql_execute_command(THD *thd)
break;
case SQLCOM_RELEASE_SAVEPOINT:
{
SAVEPOINT **sv;
for (sv=&thd->transaction.savepoints; *sv; sv=&(*sv)->prev)
SAVEPOINT *sv;
for (sv=thd->transaction.savepoints; sv; sv=sv->prev)
{
if (my_strnncoll(system_charset_info,
(uchar *)lex->ident.str, lex->ident.length,
(uchar *)(*sv)->name, (*sv)->length) == 0)
(uchar *)sv->name, sv->length) == 0)
break;
}
if (*sv)
if (sv)
{
if (ha_release_savepoint(thd, *sv))
if (ha_release_savepoint(thd, sv))
res= TRUE; // cannot happen
else
send_ok(thd);
*sv=(*sv)->prev;
thd->transaction.savepoints=sv->prev;
}
else
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "SAVEPOINT", lex->ident.str);
......@@ -3827,17 +3827,17 @@ mysql_execute_command(THD *thd)
}
case SQLCOM_ROLLBACK_TO_SAVEPOINT:
{
SAVEPOINT **sv;
for (sv=&thd->transaction.savepoints; *sv; sv=&(*sv)->prev)
SAVEPOINT *sv;
for (sv=thd->transaction.savepoints; sv; sv=sv->prev)
{
if (my_strnncoll(system_charset_info,
(uchar *)lex->ident.str, lex->ident.length,
(uchar *)(*sv)->name, (*sv)->length) == 0)
(uchar *)sv->name, sv->length) == 0)
break;
}
if (*sv)
if (sv)
{
if (ha_rollback_to_savepoint(thd, *sv))
if (ha_rollback_to_savepoint(thd, sv))
res= TRUE; // cannot happen
else
{
......@@ -3848,7 +3848,7 @@ mysql_execute_command(THD *thd)
ER(ER_WARNING_NOT_COMPLETE_ROLLBACK));
send_ok(thd);
}
*sv=(*sv)->prev;
thd->transaction.savepoints=sv;
}
else
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "SAVEPOINT", lex->ident.str);
......
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