diff options
author | unknown <msvensson@neptunus.(none)> | 2005-03-15 15:03:25 +0100 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2005-03-15 15:03:25 +0100 |
commit | aa5dba42ef7e68cb013d36c689fec4ec62a14f1d (patch) | |
tree | 010081d8effca4d5df9e0ba9b338746127e2685b /sql/ha_ndbcluster.h | |
parent | 87636012c7a84ad90d38ff7b28d68ebea67a5098 (diff) | |
download | mariadb-git-aa5dba42ef7e68cb013d36c689fec4ec62a14f1d.tar.gz |
WL#2269 Enable query cache for NDB part 2
-This is mostly fixes for correct behaviour when using query cache + transactions + the thread that
fetches commit count from NDB at regular intervals. The major fix is to add a
list in thd_ndb, that keeps a list of NDB_SHARE's that were modified by
transaction and then "clearing" them in ndbcluster_commit.
mysql-test/r/ndb_cache2.result:
Updated test cases for the ndb_util thread, more simultaneous tables and more tesst
mysql-test/t/ndb_cache2.test:
Updated test cases for the ndb_util thread, more simultaneous tables and more advanced tesst
sql/ha_ndbcluster.cc:
Add table changed during transaction to list of changed tables in Thd_ndb, this list is then used in ndbcluster_commit to invalidate the cached commit_count in share
Fix so that ndb_util_thread uses milliseconds "sleeps"
Changed so that ndb_commit_count uses the commit_count from share if available
sql/ha_ndbcluster.h:
Add commit_count_lock to NBD_SHARE, use for detecting simultaneous attempts to update commit_count
Add list of tables changed by transaction to Thd_ndb
Change check_ndb_connection to take thd as argument, use current_thd as default
Added m_rows_changed variable to keep track of if this handler has modified any records within the transaction
sql/set_var.cc:
Change format of code
Sort sys__ variables in aplha order
Diffstat (limited to 'sql/ha_ndbcluster.h')
-rw-r--r-- | sql/ha_ndbcluster.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 10ee568df69..a88a05b3543 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -60,6 +60,7 @@ typedef struct st_ndbcluster_share { pthread_mutex_t mutex; char *table_name; uint table_name_length,use_count; + uint commit_count_lock; ulonglong commit_count; } NDB_SHARE; @@ -77,6 +78,7 @@ class Thd_ndb { NdbTransaction *all; NdbTransaction *stmt; int error; + List<NDB_SHARE> changed_tables; }; class ha_ndbcluster: public handler @@ -226,7 +228,7 @@ private: char *update_table_comment(const char * comment); private: - int check_ndb_connection(); + int check_ndb_connection(THD* thd= current_thd); NdbTransaction *m_active_trans; NdbScanOperation *m_active_cursor; @@ -250,6 +252,7 @@ private: ha_rows m_rows_to_insert; ha_rows m_rows_inserted; ha_rows m_bulk_insert_rows; + ha_rows m_rows_changed; bool m_bulk_insert_not_flushed; ha_rows m_ops_pending; bool m_skip_auto_increment; |