summaryrefslogtreecommitdiff
path: root/sql/ha_berkeley.cc
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-12-31 11:38:44 +0200
committerunknown <monty@donna.mysql.com>2000-12-31 11:38:44 +0200
commit085ac18198f212d1fd34e0f327dca390c18476c1 (patch)
treef0e63f2938983bf57301ef7e1bf1fd2fd2334fed /sql/ha_berkeley.cc
parent53b6c99d04f3d3a4ff2c9b46d431d379bc5786e6 (diff)
downloadmariadb-git-085ac18198f212d1fd34e0f327dca390c18476c1.tar.gz
Fixed new bug in BDB tables
myisam/mi_info.c: Fixed potential bug scripts/safe_mysqld.sh: Only set --user if running as root sql/ha_berkeley.cc: Fixed core dump bug in ALTER TABLE sql/mysql_priv.h: Fixed wrong define sql/mysqld.cc: Cleanup
Diffstat (limited to 'sql/ha_berkeley.cc')
-rw-r--r--sql/ha_berkeley.cc24
1 files changed, 4 insertions, 20 deletions
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index 8dbf15068b5..28a33c6a99e 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -796,7 +796,8 @@ int ha_berkeley::write_row(byte * record)
else
{
DB_TXN *sub_trans = transaction;
- ulong thd_options = table->in_use->options;
+ /* Don't use sub transactions in temporary tables (in_use == 0) */
+ ulong thd_options = table->in_use ? table->in_use->options : 0;
for (uint retry=0 ; retry < berkeley_trans_retry ; retry++)
{
key_map changed_keys = 0;
@@ -1014,7 +1015,7 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
DBT prim_key, key, old_prim_key;
int error;
DB_TXN *sub_trans;
- ulong thd_options = table->in_use->options;
+ ulong thd_options = table->in_use ? table->in_use->options : 0;
bool primary_key_changed;
DBUG_ENTER("update_row");
@@ -1112,23 +1113,6 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
break;
}
}
-#ifdef BROKEN_CODE_HERE
- int new_error;
- DBUG_PRINT("error",("Got error %d",error));
- if (using_ignore && (thd_options & OPTION_INTERNAL_SUBTRANSACTIONS))
- {
- DBUG_PRINT("trans",("aborting subtransaction"));
- new_error=txn_abort(sub_trans);
- }
- else if (changed_keys)
- new_error=restore_keys(changed_keys, primary_key,
- old_row, old_prim_key, new_row, prim_key);
- if (new_error)
- {
- error=new_error; // This shouldn't happen
- break;
- }
-#endif
}
else if (using_ignore && (thd_options & OPTION_INTERNAL_SUBTRANSACTIONS))
{
@@ -1227,7 +1211,7 @@ int ha_berkeley::delete_row(const byte * record)
int error;
DBT row, prim_key;
key_map keys=table->keys_in_use;
- ulong thd_options = table->in_use->options;
+ ulong thd_options = table->in_use ? table->in_use->options : 0;
DBUG_ENTER("delete_row");
statistic_increment(ha_delete_count,&LOCK_status);