summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorunknown <kostja@bodhi.(none)>2007-07-31 23:47:38 +0400
committerunknown <kostja@bodhi.(none)>2007-07-31 23:47:38 +0400
commit2914bad6ac429cd401803210b5a7389d141a27a2 (patch)
tree3aa1ba7703851e4f51c6bce20c1be35c0e039b74 /storage
parent5713d2e069017b8fbfda9dcf5c3380534e39a52a (diff)
parent5404ba422e35d75054d3941b6e52f237fbb46e91 (diff)
downloadmariadb-git-2914bad6ac429cd401803210b5a7389d141a27a2.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into bodhi.(none):/opt/local/work/mysql-5.1-runtime client/mysqldump.c: Auto merged mysql-test/r/mysqldump.result: Auto merged mysql-test/t/disabled.def: Auto merged mysql-test/t/mysqldump.test: Auto merged sql/handler.cc: Auto merged sql/lock.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_table.cc: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged mysql-test/include/mix1.inc: Manual merge. mysql-test/r/innodb_mysql.result: Manual merge.
Diffstat (limited to 'storage')
-rw-r--r--storage/csv/ha_tina.cc12
-rw-r--r--storage/csv/ha_tina.h5
-rw-r--r--storage/myisam/ha_myisam.cc36
-rw-r--r--storage/myisam/ha_myisam.h5
-rw-r--r--storage/myisam/mi_test1.c5
-rw-r--r--storage/myisam/mi_test2.c23
-rw-r--r--storage/myisam/mi_test3.c8
7 files changed, 21 insertions, 73 deletions
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 34c1fcde58d..00ca2a6c07f 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -786,18 +786,6 @@ void ha_tina::update_status()
}
-bool ha_tina::check_if_locking_is_allowed(uint sql_command,
- ulong type, TABLE *table,
- uint count, uint current,
- uint *system_count,
- bool called_by_privileged_thread)
-{
- if (!called_by_privileged_thread)
- return check_if_log_table_locking_is_allowed(sql_command, type, table);
-
- return TRUE;
-}
-
/*
Open a database file. Keep in mind that tables are caches, so
this will not be called for every request. Any sort of positions
diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h
index 5bb3e9a79a0..5ce09783b9b 100644
--- a/storage/csv/ha_tina.h
+++ b/storage/csv/ha_tina.h
@@ -131,11 +131,6 @@ public:
*/
ha_rows estimate_rows_upper_bound() { return HA_POS_ERROR; }
- virtual bool check_if_locking_is_allowed(uint sql_command,
- ulong type, TABLE *table,
- uint count, uint current,
- uint *system_count,
- bool called_by_logger_thread);
int open(const char *name, int mode, uint open_options);
int close(void);
int write_row(uchar * buf);
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index c86459ae0a7..77334b2cfba 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -607,41 +607,7 @@ err:
#endif /* HAVE_REPLICATION */
-bool ha_myisam::check_if_locking_is_allowed(uint sql_command,
- ulong type, TABLE *table,
- uint count, uint current,
- uint *system_count,
- bool called_by_privileged_thread)
-{
- /*
- To be able to open and lock for reading system tables like 'mysql.proc',
- when we already have some tables opened and locked, and avoid deadlocks
- we have to disallow write-locking of these tables with any other tables.
- */
- if (table->s->system_table &&
- table->reginfo.lock_type >= TL_WRITE_ALLOW_WRITE)
- (*system_count)++;
-
- /* 'current' is an index, that's why '<=' below. */
- if (*system_count > 0 && *system_count <= current)
- {
- my_error(ER_WRONG_LOCK_OF_SYSTEM_TABLE, MYF(0));
- return FALSE;
- }
-
- /*
- Deny locking of the log tables, which is incompatible with
- concurrent insert. Unless called from a logger THD (general_log_thd
- or slow_log_thd) or by a privileged thread.
- */
- if (!called_by_privileged_thread)
- return check_if_log_table_locking_is_allowed(sql_command, type, table);
-
- return TRUE;
-}
-
- /* Name is here without an extension */
-
+/* Name is here without an extension */
int ha_myisam::open(const char *name, int mode, uint test_if_locked)
{
MI_KEYDEF *keyinfo;
diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h
index 024675075c2..635f314b3da 100644
--- a/storage/myisam/ha_myisam.h
+++ b/storage/myisam/ha_myisam.h
@@ -60,11 +60,6 @@ class ha_myisam: public handler
uint max_supported_key_part_length() const { return MI_MAX_KEY_LENGTH; }
uint checksum() const;
- virtual bool check_if_locking_is_allowed(uint sql_command,
- ulong type, TABLE *table,
- uint count, uint current,
- uint *system_count,
- bool called_by_logger_thread);
int open(const char *name, int mode, uint test_if_locked);
int close(void);
int write_row(uchar * buf);
diff --git a/storage/myisam/mi_test1.c b/storage/myisam/mi_test1.c
index 1165ea4bb32..08627ba7e92 100644
--- a/storage/myisam/mi_test1.c
+++ b/storage/myisam/mi_test1.c
@@ -258,7 +258,8 @@ static int run_test(const char *filename)
continue;
create_key(key,j);
my_errno=0;
- if ((error = mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT)))
+ if ((error = mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT)))
{
if (verbose || (flags[j] >= 1 ||
(error && my_errno != HA_ERR_KEY_NOT_FOUND)))
@@ -285,7 +286,7 @@ static int run_test(const char *filename)
{
create_key(key,i);
my_errno=0;
- error=mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT);
+ error=mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT);
if (verbose ||
(error == 0 && flags[i] == 0 && unique_key) ||
(error && (flags[i] != 0 || my_errno != HA_ERR_KEY_NOT_FOUND)))
diff --git a/storage/myisam/mi_test2.c b/storage/myisam/mi_test2.c
index 96ee82e023c..99d0c23d2a4 100644
--- a/storage/myisam/mi_test2.c
+++ b/storage/myisam/mi_test2.c
@@ -263,7 +263,7 @@ int main(int argc, char *argv[])
if (!j)
for (j=999 ; j>0 && key1[j] == 0 ; j--) ;
sprintf(key,"%6d",j);
- if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
+ if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
{
printf("Test in loop: Can't find key: \"%s\"\n",key);
goto err;
@@ -291,7 +291,7 @@ int main(int argc, char *argv[])
if (j != 0)
{
sprintf(key,"%6d",j);
- if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
+ if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
{
printf("can't find key1: \"%s\"\n",key);
goto err;
@@ -325,7 +325,7 @@ int main(int argc, char *argv[])
if (j != 0)
{
sprintf(key,"%6d",j);
- if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
+ if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
{
printf("can't find key1: \"%s\"\n",key);
goto err;
@@ -377,7 +377,7 @@ int main(int argc, char *argv[])
DBUG_PRINT("progpos",("first - next -> last - prev -> first"));
if (verbose) printf(" Using key: \"%s\" Keys: %d\n",key,dupp_keys);
- if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
+ if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
goto err;
if (mi_rsame(file,read_record2,-1))
goto err;
@@ -422,7 +422,7 @@ int main(int argc, char *argv[])
}
/* Check of mi_rnext_same */
- if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
+ if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
goto err;
ant=1;
while (!mi_rnext_same(file,read_record3) && ant < dupp_keys+10)
@@ -496,7 +496,7 @@ int main(int argc, char *argv[])
goto err;
if (bcmp(read_record2,read_record3,reclength))
printf("Can't find last record\n");
-
+#ifdef NOT_ANYMORE
if (!silent)
puts("- Test read key-part");
strmov(key2,key);
@@ -514,12 +514,14 @@ int main(int argc, char *argv[])
goto end;
}
}
+#endif
if (dupp_keys > 2)
{
if (!silent)
printf("- Read key (first) - next - delete - next -> last\n");
DBUG_PRINT("progpos",("first - next - delete - next -> last"));
- if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT)) goto err;
+ if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
+ goto err;
if (mi_rnext(file,read_record3,0)) goto err;
if (mi_delete(file,read_record3)) goto err;
opt_delete++;
@@ -555,7 +557,8 @@ int main(int argc, char *argv[])
if (!silent)
printf("- Read first - delete - next -> last\n");
DBUG_PRINT("progpos",("first - delete - next -> last"));
- if (mi_rkey(file,read_record3,0,key,0,HA_READ_KEY_EXACT)) goto err;
+ if (mi_rkey(file,read_record3,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
+ goto err;
if (mi_delete(file,read_record3)) goto err;
opt_delete++;
ant=1;
@@ -618,10 +621,10 @@ int main(int argc, char *argv[])
copy_key(file,(uint) i,(uchar*) read_record,(uchar*) key);
copy_key(file,(uint) i,(uchar*) read_record2,(uchar*) key2);
min_key.key= key;
- min_key.length= USE_WHOLE_KEY;
+ min_key.keypart_map= HA_WHOLE_KEY;
min_key.flag= HA_READ_KEY_EXACT;
max_key.key= key2;
- max_key.length= USE_WHOLE_KEY;
+ max_key.keypart_map= HA_WHOLE_KEY;
max_key.flag= HA_READ_AFTER_KEY;
range_records= mi_records_in_range(file,(int) i, &min_key, &max_key);
diff --git a/storage/myisam/mi_test3.c b/storage/myisam/mi_test3.c
index 982b999c3a5..ed9cd8e7b8c 100644
--- a/storage/myisam/mi_test3.c
+++ b/storage/myisam/mi_test3.c
@@ -243,8 +243,8 @@ int test_read(MI_INFO *file,int id)
for (i=0 ; i < 100 ; i++)
{
find=rnd(100000);
- if (!mi_rkey(file,record.id,1,(uchar*) &find,
- sizeof(find),HA_READ_KEY_EXACT))
+ if (!mi_rkey(file,record.id,1,(uchar*) &find, HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
found++;
else
{
@@ -426,8 +426,8 @@ int test_update(MI_INFO *file,int id,int lock_type)
{
tmp=rnd(100000);
int4store(find,tmp);
- if (!mi_rkey(file,record.id,1,(uchar*) find,
- sizeof(find),HA_READ_KEY_EXACT))
+ if (!mi_rkey(file,record.id,1,(uchar*) find, HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
found++;
else
{