summaryrefslogtreecommitdiff
path: root/sql/sql_cache.h
Commit message (Collapse)AuthorAgeFilesLines
* Updated/added copyright headersKent Boortz2011-06-301-2/+5
|\
| * Bug#30087 Set query_cache_size, if the value is too small, get a unclear warningMarc Alff2008-07-161-2/+0
| | | | | | | | Reverting the previous patch
| * Bug#30087 Set query_cache_size, if the value is too small, get a unclear warningKristofer Pettersson2008-06-191-0/+2
| | | | | | | | | | | | This bugs clarifies a warning message issued when the query cache data size becomes smaller than the minium allowed size.
* | Bug#39253 Large query cache still freezes server after fix for bug #21074Kristofer Pettersson2009-11-201-1/+1
| | | | | | | | | | | | | | | | This patch introduce a limit on the time the query cache can block with a lock on SELECTs. Other operations which causes a change in the table data will still be blocked.
* | Bug#43758 Query cache can lock up threads in 'freeing items' stateKristofer Pettersson2009-06-161-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Early patch submitted for discussion. It is possible for more than one thread to enter the condition in query_cache_insert(), but the condition predicate is to signal one thread each time the cache status changes between the following states: {NO_FLUSH_IN_PROGRESS,FLUSH_IN_PROGRESS, TABLE_FLUSH_IN_PROGRESS} Consider three threads THD1, THD2, THD3 THD2: select ... => Got a writer in ::store_query THD3: select ... => Got a writer in ::store_query THD1: flush tables => qc status= FLUSH_IN_PROGRESS; new writers are blocked. THD2: select ... => Still got a writer and enters cond in query_cache_insert THD3: select ... => Still got a writer and enters cond in query_cache_insert THD1: flush tables => finished and signal status change. THD2: select ... => Wakes up and completes the insert. THD3: select ... => Happily waiting for better times. Why hurry? This patch is a refactoring of this lock system. It introduces four new methods: Query_cache::try_lock() Query_cache::lock() Query_cache::lock_and_suspend() Query_cache::unlock() This change also deprecates wait_while_table_flush_is_in_progress(). All threads are queued and put on a conditional wait. On each unlock the queue is signalled. This resolve the issues with left over threads. To assure that no threads are spending unnecessary time waiting a signal broadcast is issued every time a lock is taken before a full cache flush.
* | Doxygenize comments.cmiller@zippy.cornsilk.net2007-10-161-2/+2
| |
* | Merge adventure.(none):/home/thek/Development/cpp/bug30269/my51-bug30269thek@adventure.(none)2007-08-171-3/+5
|\ \ | | | | | | | | | into adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime
| * \ Merge adventure.(none):/home/thek/Development/cpp/bug30269/my50-bug30269thek@adventure.(none)2007-08-171-3/+5
| |\ \ | | |/ | | | | | | into adventure.(none):/home/thek/Development/cpp/bug30269/my51-bug30269
| | * Bug #30269 Query cache eats memorythek@adventure.(none)2007-08-171-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Although the query cache doesn't support retrieval of statements containing column level access control, it was still possible to cache such statements thus wasting memory. This patch extends the access control check on the target tables to avoid caching a statement with column level restrictions.
* | | Slow query log to file now displays queries with microsecond precissionmonty@mysql.com/nosik.monty.fi2007-07-301-0/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --long-query-time is now given in seconds with microseconds as decimals --min_examined_row_limit added for slow query log long_query_time user variable is now double with 6 decimals Added functions to get time in microseconds Added faster time() functions for system that has gethrtime() (Solaris) We now do less time() calls. Added field->in_read_set() and field->in_write_set() for easier field manipulation by handlers set_var.cc and my_getopt() can now handle DOUBLE variables. All time() calls changed to my_time() my_time() now does retry's if time() call fails. Added debug function for stopping in mysql_admin_table() when tables are locked Some trivial function and struct variable renames to avoid merge errors. Fixed compiler warnings Initialization of some time variables on windows moved to my_init()
* | Fix ndb_cache* test failures in the -runtime tree.kostja@bodhi.(none)2007-07-161-0/+1
| | | | | | | | | | Do not try to acquire structure_guard_mutex for the second time when invalidating a table from send_result_to_client.
* | Bug#21074 Large query_cache freezes mysql server sporadically under heavy loadthek@adventure.(none)2007-07-021-13/+59
| | | | | | | | | | | | | | | | Invaldating a subset of a sufficiently large query cache can take a long time. During this time the server is efficiently frozen and no other operation can be executed. This patch addresses this problem by moving the locks which cause the freezing and also by temporarily disable the query cache while the invalidation takes place.
* | WL#3817: Simplify string / memory area types and make things more consistent ↵monty@mysql.com/narttu.mysql.fi2007-05-101-19/+17
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (first part) The following type conversions was done: - Changed byte to uchar - Changed gptr to uchar* - Change my_string to char * - Change my_size_t to size_t - Change size_s to size_t Removed declaration of byte, gptr, my_string, my_size_t and size_s. Following function parameter changes was done: - All string functions in mysys/strings was changed to use size_t instead of uint for string lengths. - All read()/write() functions changed to use size_t (including vio). - All protocoll functions changed to use size_t instead of uint - Functions that used a pointer to a string length was changed to use size_t* - Changed malloc(), free() and related functions from using gptr to use void * as this requires fewer casts in the code and is more in line with how the standard functions work. - Added extra length argument to dirname_part() to return the length of the created string. - Changed (at least) following functions to take uchar* as argument: - db_dump() - my_net_write() - net_write_command() - net_store_data() - DBUG_DUMP() - decimal2bin() & bin2decimal() - Changed my_compress() and my_uncompress() to use size_t. Changed one argument to my_uncompress() from a pointer to a value as we only return one value (makes function easier to use). - Changed type of 'pack_data' argument to packfrm() to avoid casts. - Changed in readfrm() and writefrom(), ha_discover and handler::discover() the type for argument 'frmdata' to uchar** to avoid casts. - Changed most Field functions to use uchar* instead of char* (reduced a lot of casts). - Changed field->val_xxx(xxx, new_ptr) to take const pointers. Other changes: - Removed a lot of not needed casts - Added a few new cast required by other changes - Added some cast to my_multi_malloc() arguments for safety (as string lengths needs to be uint, not size_t). - Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done explicitely as this conflict was often hided by casting the function to hash_get_key). - Changed some buffers to memory regions to uchar* to avoid casts. - Changed some string lengths from uint to size_t. - Changed field->ptr to be uchar* instead of char*. This allowed us to get rid of a lot of casts. - Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar - Include zlib.h in some files as we needed declaration of crc32() - Changed MY_FILE_ERROR to be (size_t) -1. - Changed many variables to hold the result of my_read() / my_write() to be size_t. This was needed to properly detect errors (which are returned as (size_t) -1). - Removed some very old VMS code - Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix) - Removed windows specific code to restore cursor position as this causes slowdown on windows and we should not mix read() and pread() calls anyway as this is not thread safe. Updated function comment to reflect this. Changed function that depended on original behavior of my_pwrite() to itself restore the cursor position (one such case). - Added some missing checking of return value of malloc(). - Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow. - Changed type of table_def::m_size from my_size_t to ulong to reflect that m_size is the number of elements in the array, not a string/memory length. - Moved THD::max_row_length() to table.cc (as it's not depending on THD). Inlined max_row_length_blob() into this function. - More function comments - Fixed some compiler warnings when compiled without partitions. - Removed setting of LEX_STRING() arguments in declaration (portability fix). - Some trivial indentation/variable name changes. - Some trivial code simplifications: - Replaced some calls to alloc_root + memcpy to use strmake_root()/strdup_root(). - Changed some calls from memdup() to strmake() (Safety fix) - Simpler loops in client-simple.c
* Merge bk-internal.mysql.com:/home/bk/mysql-5.0monty@mysql.com/narttu.mysql.fi2007-01-221-3/+3
|\ | | | | | | into mysql.com:/home/my/mysql-5.0
| * Fixed compiler warnings detected by option -Wshadow and -Wunused:monty@mysql.com/narttu.mysql.fi2006-12-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | - Removed not used variables and functions - Added #ifdef around code that is not used - Renamed variables and functions to avoid conflicts - Removed some not used arguments Fixed some class/struct warnings in ndb Added define IS_LONGDATA() to simplify code in libmysql.c I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes
* | my_strtoll10-x86.s:kent@mysql.com/kent-amd64.(none)2006-12-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Corrected spelling in copyright text Makefile.am: Don't update the files from BitKeeper Many files: Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header Adjusted year(s) in copyright header Many files: Added GPL copyright text Removed files: Docs/Support/colspec-fix.pl Docs/Support/docbook-fixup.pl Docs/Support/docbook-prefix.pl Docs/Support/docbook-split Docs/Support/make-docbook Docs/Support/make-makefile Docs/Support/test-make-manual Docs/Support/test-make-manual-de Docs/Support/xwf
* | Many files:kent@mysql.com/kent-amd64.(none)2006-12-231-2/+1
|/ | | | Changed header to GPL version 2 only
* BUG#21051: RESET QUERY CACHE very slow when query_cache_type=0kroki/tomash@moonlight.intranet2006-08-221-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | There were two problems: RESET QUERY CACHE took a long time to complete and other threads were blocked during this time. The patch does three things: 1 fixes a bug with improper use of test-lock-test_again technique. AKA Double-Checked Locking is applicable here only in few places. 2 Somewhat improves performance of RESET QUERY CACHE. Do my_hash_reset() instead of deleting elements one by one. Note however that the slowdown also happens when inserting into sorted list of free blocks, should be rewritten using balanced tree. 3 Makes RESET QUERY CACHE non-blocking. The patch adjusts the locking protocol of the query cache in the following way: it introduces a flag flush_in_progress, which is set when Query_cache::flush_cache() is in progress. This call sets the flag on enter, and then releases the lock. Every other call is able to acquire the lock, but does nothing if flush_in_progress is set (as if the query cache is disabled). The only exception is the concurrent calls to Query_cache::flush_cache(), that are blocked until the flush is over. When leaving Query_cache::flush_cache(), the lock is acquired and the flag is reset, and one thread waiting on Query_cache::flush_cache() (if any) is notified that it may proceed.
* Fixed compiler warnings from gcc 4.0.2:monty@mysql.com2006-02-251-0/+6
| | | | | - Added empty constructors and virtual destructors to many classes and structs - Removed some usage of the offsetof() macro to instead use C++ class pointers
* Fix for BUG#13549 "Server crash with nested stored proceduresbell@sanja.is.com.ua2005-11-231-1/+1
| | | | | | | | | | | | if inner routine has more local variables than outer one, and one of its last variables was used as argument to NOT operator". THD::spcont was non-0 when we were parsing stored routine/trigger definition during execution of another stored routine. This confused methods of Item_splocal and forced them use wrong runtime context. Fix ensures that we always have THD::spcont equal to zero during routine/trigger body parsing. This also allows to avoid problems with errors which occur during parsing and SQL exception handlers.
* Merge sanja.is.com.ua:/home/bell/mysql/bk/work-4.1bell@sanja.is.com.ua2005-09-061-2/+3
|\ | | | | | | into sanja.is.com.ua:/home/bell/mysql/bk/work-mrg-5.0
| * Merge sanja.is.com.ua:/home/bell/mysql/bk/work-4.0bell@sanja.is.com.ua2005-09-061-2/+3
| |\ | | | | | | | | | into sanja.is.com.ua:/home/bell/mysql/bk/work-4.1
| | * support of concurent query cache resizing (BUG#12848)bell@sanja.is.com.ua2005-09-061-2/+3
| | |
* | | mergebell@sanja.is.com.ua2005-02-071-0/+4
|\ \ \
| * | | fixed QC invaluidation and processing with view (BUG#8050) (BUG#8054)bell@sanja.is.com.ua2005-01-271-0/+4
| | | |
* | | | Merged "query cache for ndb" to 5.0msvensson@neptunus.homeip.net2005-02-031-1/+11
|\ \ \ \ | |/ / / |/| | |
| * | | removed special ndb query cache variabletomas@poseidon.ndb.mysql.com2004-11-251-1/+0
| | | | | | | | | | | | | | | | ndb will always return query cache type ASKTRANSACT
| * | | Mergetomas@poseidon.ndb.mysql.com2004-11-241-1/+11
| |\ \ \
| | * | | sql/ha_innodb.cctomas@poseidon.ndb.mysql.com2004-11-241-1/+11
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | enabled query cache for ndb modified engine interface somewhat sql/ha_innodb.h enabled query cache for ndb modified engine interface somewhat sql/ha_ndbcluster.cc enabled query cache for ndb modified engine interface somewhat ndb will only allow caching and retrieval if running autocommit - return false, but do not invalidate commit count is used as engine data, i.e. - store commit count before store of cache - allow retrieval if commit count has not changed on a table - invalidate if commit count has changed sql/ha_ndbcluster.h enabled query cache for ndb modified engine interface somewhat sql/handler.cc enabled query cache for ndb modified engine interface somewhat sql/handler.h enabled query cache for ndb modified engine interface somewhat new virtual handler method cached_table_registration called on each table before alowing store in query cache - return TRUE - ok to cache, FALSE - not allowed to cache, invalidate queries if engine_data below has changed - sets ulonglong (engine_data) that is stored in query cache for each table - sets callback to be called for each table before usage of cached query, callback = 0 -> no check later sql/mysql_priv.h enabled query cache for ndb modified engine interface somewhat callcack prototype for callback to engine before query cache retrieval sql/sql_cache.cc enabled query cache for ndb modified engine interface somewhat if callback is set on table in cache, do callback to check if allowed to use cache if not allowed to use cache, check if engine_data has changed, if so, invalidate all queries with that table + changes to store and pass callback and engine_data around sql/sql_cache.h enabled query cache for ndb modified engine interface somewhat changes to store callback and engine_data sql/table.h enabled query cache for ndb modified engine interface somewhat changes to store callback and engine_data
| * | | changed query cache type variable for ndbtomas@poseidon.ndb.mysql.com2004-11-231-0/+1
| |/ /
* | | merge with 4.1monty@mysql.com2004-10-291-7/+3
|\ \ \ | |/ /
| * | Merge with 4.0monty@mysql.com2004-10-271-3/+3
| |\ \ | | |/
| | * Check of temporary tables hiding for query fetched from QC (BUG#6084)bell@sanja.is.com.ua2004-10-211-0/+3
| | |
| * | information about different variables agged to query cache (BUG#5515, BUG#5394)bell@sanja.is.com.ua2004-09-101-4/+0
| | |
* | | Fixed BUG#3583: query cache doesn't work for stored procedures.pem@mysql.comhem.se2004-09-171-0/+1
|/ /
* | merge with 4.0monty@mysql.com2004-03-161-0/+1
|\ \ | |/
| * invalidation of locking for write tables (BUG#2693)bell@sanja.is.com.ua2004-03-041-0/+1
| | | | | | | | fixed linking query_prealloc_size to query cache presence
* | SCRUMhf@deer.(none)2003-12-011-2/+2
| | | | | | | | WL#1246 (Query cache in embedded library)
* | Merge laptop.sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1bell@laptop.sanja.is.com.ua2003-08-261-0/+2
|\ \ | | | | | | | | | into laptop.sanja.is.com.ua:/home/bell/mysql/bk/work-qc-4.1
| * | fixed query cache intercommunication with innodb enginebell@sanja.is.com.ua2003-08-121-0/+2
| | |
* | | Merge with 4.0.14monty@mashka.mysql.fi2003-08-111-1/+1
|\ \ \ | |/ / |/| / | |/
| * support of more then 255 tables dependence in query cache (fixed BUG#930)bell@sanja.is.com.ua2003-07-301-1/+1
| |
* | mergingbell@sanja.is.com.ua2003-04-161-8/+18
|\ \
| * \ mergingbell@sanja.is.com.ua2002-12-111-8/+18
| |\ \ | | |/ | |/|
| | * new innodb query cache behaviour (recommit because of problem with 4.1 ↵bell@sanja.is.com.ua2002-11-031-8/+18
| | | | | | | | | | | | | | | | | | repository pushing) fixed bug in quqry cache dbd transaction processing
* | | made variable query_cache_min_res_unit from QUERY_CACHE_MIN_RESULT_DATA_SIZE ↵bell@sanja.is.com.ua2003-03-021-0/+3
|/ / | | | | | | (SCRUM)
* | new status variable (number of queries deleted because of low memory)bell@sanja.is.com.ua2002-11-171-1/+1
| |
* | Portability fixes for Fortre C++ 5.0 (on Sun) in 32 and 64 bit modes.monty@butch.2002-11-071-1/+1
|/
* Updated VC++ project files for 4.0.4monty@mashka.mysql.fi2002-09-241-6/+5
| | | | | | Only write short usage if one starts mysqldump without any options Added query cache on windows Added error message if one can't read privilege tables
* new function for innodbbell@sanja.is.com.ua2002-09-191-0/+2
| | | | windows case insensitive tables name work around