- Change && to ||
- Check for return value != 0 in "ndb->init()"
mysql-test/r/ndb_cache_multi2.result:
Update test result
mysql-test/t/ndb_cache_multi2.test:
Update test case
- add printouts for what server the queries are from
- Run the query from "while" once on server1 to cache it
sql/ha_ndbcluster.cc:
&& => ||, to call both the function "thd->store_global()" and "ndb->init()"
ndb_init returns 0 on sucess. Fail if not zero.
- remove timing dependent part of test, wait until condition occurs or sleep max 10 seconds
mysql-test/r/ndb_cache_multi2.result:
Update test results
mysql-test/t/ndb_cache_multi2.test:
Convert long sleeps to a while leep whith small sleeps and a check if condition has occured.
This allows slower machines to sleep longer if needed.
mysql-test/r/ndb_cache_multi2.result:
reset query cache settings on end of test
mysql-test/t/ndb_cache_multi2.test:
reset query cache settings on end of test
- Added a thread that fetches commit_count for open tables. This
will mean that NDB will not have to be contacted for every use of a cached query.
sql/ha_ndbcluster.cc:
Added a thread that periodically will fetch commit_count
for open tables and store that value in share.
The commit count value is then used when query cache
asks if a cached query can be used.
The thread activation interval is regulated by the
config variable ndb_cache_check_time, it's default value is 0
which means that NDB is contacted every time a cached query is reused.
sql/ha_ndbcluster.h:
Added commit_count to share
Added ndb_cache_check_time
sql/mysqld.cc:
Added config variable ndb_cache_check_time
sql/set_var.cc:
Added config variable ndb_cache_check_time