summaryrefslogtreecommitdiff
path: root/sql/ha_blackhole.h
diff options
context:
space:
mode:
authorunknown <gluh@mysql.com/eagle.(none)>2007-11-16 14:46:36 +0400
committerunknown <gluh@mysql.com/eagle.(none)>2007-11-16 14:46:36 +0400
commit0cfa3267fb222a8ce15ab80865400ea4293295a5 (patch)
tree9b6844cc88f531e16a01103cd40aaf95615af68e /sql/ha_blackhole.h
parent1490691e31deb4577402120a80c5a448d3a28d6d (diff)
downloadmariadb-git-0cfa3267fb222a8ce15ab80865400ea4293295a5.tar.gz
Bug#30294 blackhole engine causes 100% with 2 alter table statements running
Implement neccessary shared lock structure for table locks. This is the backport of bug26241 fix. sql/ha_blackhole.cc: Implement neccessary shared lock structure for table locks. sql/ha_blackhole.h: Declare shared structure for table locks sql/handler.cc: added BLACKHOLE_DB case
Diffstat (limited to 'sql/ha_blackhole.h')
-rw-r--r--sql/ha_blackhole.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/sql/ha_blackhole.h b/sql/ha_blackhole.h
index 4dcb37c637d..45ed0351457 100644
--- a/sql/ha_blackhole.h
+++ b/sql/ha_blackhole.h
@@ -17,6 +17,18 @@
#pragma interface /* gcc class implementation */
#endif
+
+/*
+ Shared structure for correct LOCK operation
+*/
+struct st_blackhole_share {
+ THR_LOCK lock;
+ uint use_count;
+ uint table_name_length;
+ char table_name[1];
+};
+
+
/*
Class definition for the blackhole storage engine
"Dumbest named feature ever"
@@ -24,7 +36,7 @@
class ha_blackhole: public handler
{
THR_LOCK_DATA lock; /* MySQL lock */
- THR_LOCK thr_lock;
+ st_blackhole_share *share;
public:
ha_blackhole(TABLE *table_arg);
@@ -76,10 +88,12 @@ public:
void position(const byte *record);
int info(uint flag);
int external_lock(THD *thd, int lock_type);
- uint lock_count(void) const;
int create(const char *name, TABLE *table_arg,
HA_CREATE_INFO *create_info);
THR_LOCK_DATA **store_lock(THD *thd,
THR_LOCK_DATA **to,
enum thr_lock_type lock_type);
};
+
+bool blackhole_db_init(void);
+bool blackhole_db_end(void);