Commit graph

213 commits

Author SHA1 Message Date
Dmitry Lenev
a6c00c276e Part of fix for bug#52044 "FLUSH TABLES WITH READ LOCK and
FLUSH TABLES <list> WITH READ LOCK are incompatible" to
be pushed as separate patch.

Replaced thread state name "Waiting for table", which was
used by threads waiting for a metadata lock or table flush, 
with a set of names which better reflect types of resources
being waited for.

Also replaced "Table lock" thread state name, which was used 
by threads waiting on thr_lock.c table level lock, with more
elaborate "Waiting for table level lock", to make it 
more consistent with other thread state names.

Updated test cases and their results according to these 
changes.

Fixed sys_vars.query_cache_wlock_invalidate_func test to not
to wait for timeout of wait_condition.inc script.
2010-08-06 15:29:37 +04:00
Jon Olav Hauglid
2c4b6dc503 Bug #51336 Assert in reload_acl_and_cache during RESET QUERY CACHE
Attempts to execute RESET statements within a transaction that
had acquired metadata locks, led to an assertion failure on 
debug servers. This bug didn't cause any problems on release
builds.

The triggered assert is designed to check that caches are not
flushed or reset while having active transactions. It is triggered
if acquired metadata locks exist that are not from LOCK TABLE or
HANDLER statements.

In this case it was triggered by RESET QUERY CACHE while having
an active transaction that had acquired locks. The reason the
assertion was triggered, was that RESET statements, unlike the
similar FLUSH statements, was not causing an implicit commit.

This patch fixes the problem by making sure RESET statements
commit the current transaction before executing. The commit
causes acquired metadata locks to be released, preventing the
assertion from being triggered.

Incompatible change: This patch changes RESET statements so
that they cause an implicit commit.

Test case added to query_cache.test.
2010-02-26 10:58:33 +01:00
Sergei Golubchik
ae2768ce9c WL#4738 streamline/simplify @@variable creation process
Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables
Bug#20415 Output of mysqld --help --verbose is incomplete
Bug#25430 variable not found in SELECT @@global.ft_max_word_len;
Bug#32902 plugin variables don't know their names
Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
Bug#34829 No default value for variable and setting default does not raise error
Bug#34834 ? Is accepted as a valid sql mode
Bug#34878 Few variables have default value according to documentation but error occurs  
Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var.
Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status
Bug#40988 log_output_basic.test succeeded though syntactically false.
Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails)
Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations 
Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
Bug#44797 plugins w/o command-line options have no disabling option in --help
Bug#46314 string system variables don't support expressions
Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken
Bug#46586 When using the plugin interface the type "set" for options caused a crash.
Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number
Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds
Bug#49417 some complaints about mysqld --help --verbose output
Bug#49540 DEFAULT value of binlog_format isn't the default value
Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
Bug#49644 init_connect and \0
Bug#49645 init_slave and multi-byte characters
Bug#49646 mysql --show-warnings crashes when server dies
2009-12-22 10:35:56 +01:00
Martin Hansson
f9a7ac0664 Backport of fix for bug#35020 2009-12-17 13:38:27 +01:00
Alexander Nozdrin
3c0c7e9576 Auto-merge from mysql-next-mr. 2009-11-12 15:13:43 +03:00
Alexander Nozdrin
2ca5b2c791 Manual merge from mysql-trunk-merge. 2009-11-06 17:20:27 +03:00
Kristofer Pettersson
4b7a8a294b Moved test case for bug 31157 from query_cache.test to subselect.test 2009-11-03 17:18:43 +01:00
Alexey Botchkov
567bf9d37c Bug#41371 Select returns 1 row with condition "col is not null and col is null"
For application compatibility reasons  MySQL converts "<autoincrement_column> IS NULL"
    predicates to "<autoincrement_column> = LAST_INSERT_ID()" in the first SELECT following an
    INSERT regardless of whether they're top level predicates or not. This causes wrong and
    obscure results when these predicates are combined with others on the same columns. Fixed
    by only doing the transformation on a single top-level predicate if a special SQL mode is
    turned on (sql_auto_is_null).
    Also made sql_auto_is_null off by default.

per-file comments:
  mysql-test/r/func_isnull.result
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
    test result updated

  mysql-test/t/func_isnull.test
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
    test case added

  sql/mysqld.cc
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
    sql_auto_is_null now is OFF by default.

  sql/sql_select.cc
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
    remove_eq_conds() split in two parts - one only checks the upper condition,
    the req_remove_eq_conds() recursively checks all the condition tree.

  mysql-test/extra/rpl_tests/rpl_insert_id.test
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
        test fixed (set the sql_auto_is_null variable)

  mysql-test/r/mysqlbinlog.result
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
        result updated

  mysql-test/r/mysqlbinlog2.result
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
        result updated

  mysql-test/r/odbc.result
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
        result updated

  mysql-test/r/query_cache.result
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
        result updated

  mysql-test/r/user_var-binlog.result
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
        result updated

  mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
        result updated

  mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
        result updated

  mysql-test/suite/rpl/r/rpl_insert_id.result
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
        result updated

  mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
        result updated

  mysql-test/suite/rpl/r/rpl_sp.result
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
        result updated

  mysql-test/t/odbc.test
Bug#41371      Select returns 1 row with condition "col is not null and col is null"
        test fixed (set the sql_auto_is_null variable)
2009-11-03 17:54:41 +04:00
Marc Alff
d5fd452d7c WL#2110 (SIGNAL)
WL#2265 (RESIGNAL)

Manual merge of SIGNAL and RESIGNAL to mysql-trunk-signal,
plus required dependencies.
2009-09-10 03:18:29 -06:00
Georgi Kodinov
3aec7ca415 merged 5.1-main -> 5.1-bugteam 2009-01-30 15:44:49 +02:00
Luis Soares
14d4576bfe merge: 5.1 -> 5.1-rpl
conflicts:
  Text conflict in client/mysqltest.cc
  Text conflict in mysql-test/include/wait_until_connected_again.inc
  Text conflict in mysql-test/lib/mtr_report.pm
  Text conflict in mysql-test/mysql-test-run.pl
  Text conflict in mysql-test/r/events_bugs.result
  Text conflict in mysql-test/r/log_state.result
  Text conflict in mysql-test/r/myisam_data_pointer_size_func.result
  Text conflict in mysql-test/r/mysqlcheck.result
  Text conflict in mysql-test/r/query_cache.result
  Text conflict in mysql-test/r/status.result
  Text conflict in mysql-test/suite/binlog/r/binlog_index.result
  Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result
  Text conflict in mysql-test/suite/rpl/r/rpl_packet.result
  Text conflict in mysql-test/suite/rpl/t/rpl_packet.test
  Text conflict in mysql-test/t/disabled.def
  Text conflict in mysql-test/t/events_bugs.test
  Text conflict in mysql-test/t/log_state.test
  Text conflict in mysql-test/t/myisam_data_pointer_size_func.test
  Text conflict in mysql-test/t/mysqlcheck.test
  Text conflict in mysql-test/t/query_cache.test
  Text conflict in mysql-test/t/rpl_init_slave_func.test
  Text conflict in mysql-test/t/status.test
2009-01-23 13:22:05 +01:00
Davi Arnaut
cf5dd72ee0 Merge from 5.0-bugteam 2009-01-15 08:28:10 -02:00
Davi Arnaut
918a038165 Bug#36326: nested transaction and select
The problem is that the query cache stores packets containing
the server status of the time when the cached statement was run.
This might lead to a wrong transaction status in the client side
if a statement is cached during a transaction and is later served
outside a transaction context (and vice-versa).

The solution is to take into account the transaction status when
storing in and serving from the query cache.
2009-01-13 20:07:06 -02:00
Matthias Leich
674f88380c - Fix for Bug#40179 Test main.query_cache failing randomly on Pushbuild, test weakness
- disable the test suffering from Bug#41098 Query Cache returns wrong result with
                                            concurrent insert
- additional improvements

Details:
- Move the test for the historic bug
  Bug 28249 Query Cache returns wrong result with concurrent insert / certain lock
  into its own testscript query_cache_28249.test.
- query_cache.test:
  - replace error numbers with error names
  - remove trailing spaces, replace tabs with spaces
  - reset of @@global.log_bin_trust_function_creators to its original value
    at the end of the test
- query_cache_28249.test:
  - replace sleep 5 with poll routine
  - avoid random differences caused by concurrent_inserts effects
  - improved comments and formatting
2008-11-28 16:45:34 +01:00
Marc Alff
b8579849f3 Bug#30087 Set query_cache_size, if the value is too small, get a unclear warning
Reverting the previous patch
2008-07-16 16:29:22 -06:00
Sven Sandberg
78c8bfdddf BUG#37975: wait_for_slave_* should increase the timeout
Problem 1: tests often fail in pushbuild with a timeout when waiting
for the slave to start/stop/receive error.
Fix 1: Updated the wait_for_slave_* macros in the following way:
- The timeout is increased by a factor ten
- Refactored the macros so that wait_for_slave_param does the work for
the other macros.
Problem 2: Tests are often incorrectly written, lacking a
source include/wait_for_slave_to_[start|stop].inc.
Fix 2: Improved the chance to get it right by adding
include/start_slave.inc and include/stop_slave.inc, and updated tests
to use these.
Problem 3: The the built-in test language command
wait_for_slave_to_stop is a misnomer (does not wait for the slave io
thread) and does not give as much debug info in case of failure as
the otherwise equivalent macro
source include/wait_for_slave_sql_to_stop.inc
Fix 3: Replaced all calls to the built-in command by a call to the
macro.
Problem 4: Some, but not all, of the wait_for_slave_* macros had an
implicit connection slave. This made some tests confusing to read,
and made it more difficult to use the macro in circular replication
scenarios, where the connection named master needs to wait.
Fix 4: Removed the implicit connection slave from all
wait_for_slave_* macros, and updated tests to use an explicit
connection slave where necessary.
Problem 5: The macros wait_slave_status.inc and wait_show_pattern.inc
were unused. Moreover, using them is difficult and error-prone.
Fix 5: remove these macros.
Problem 6: log_bin_trust_function_creators_basic failed when running
tests because it assumed @@global.log_bin_trust_function_creators=1,
and some tests modified this variable without resetting it to its
original value.
Fix 6: All tests that use this variable have been updated so that
they reset the value at end of test.
2008-07-10 18:09:39 +02:00
Kristofer Pettersson
71be65dd11 Bug#30087 Set query_cache_size, if the value is too small, get a unclear warning
This bugs clarifies a warning message issued when the query cache data
size becomes smaller than the minium allowed size.
2008-06-19 02:40:35 +02:00
msvensson@pilot.mysql.com
a011d27cf9 Merge pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-rpl
into  pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-mtr
2008-04-03 11:50:43 +02:00
istruewing@stella.local
1ce57e889d Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg
2008-03-26 17:36:12 +01:00
istruewing@stella.local
857dd49aa8 Merge stella.local:/home2/mydev/mysql-5.0-axmrg
into  stella.local:/home2/mydev/mysql-5.1-axmrg
2008-03-14 14:15:36 +01:00
istruewing@stella.local
d5390b2d56 Bug#33756 - query cache with concurrent_insert=0 appears broken
When concurrent inserts were disabled, statements after an INSERT
were not put into the query cache. This happened because we do not
save the current data file length at statement start when
concurrent inserts are disabled. But we checked the always zero
local length against the real file length anyway.
  
Fixed by doing the check only if concurrent inserts are not diabled.
2008-03-13 16:39:27 +01:00
thek@adventure.(none)
31ff514ea2 Merge adventure.(none):/home/thek/Development/cpp/bug25132/my50-bug25132
into  adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime
2008-03-10 16:46:38 +01:00
thek@adventure.(none)
a13cba5abd Bug#25132 disabled query cache: Qcache_free_blocks = 1
The initial value of free memory blocks in 0. When the query cache is enabled 
a new memory block gets allocated and is assigned number 1. The free memory
block is later split each time query cache memory is allocated for new blocks.
This means that the free memory block counter won't be reduced to zero when
the number of allocated blocks are zero, but rather one. To avoid confusion
this patch changes this behavior so that the free memory block counter is
reset to zero when the query cache is disabled.
Note that when the query cache is enabled and resized the free memory block
counter was still calculated correctly.
2008-03-06 12:40:46 +01:00
msvensson@pilot.mysql.com
d918988baa WL#4189
- dynamic configuration support
 - safe process
 - cleanups
 - create new suite for fedarated
2007-12-12 18:19:24 +01:00
gluh@mysql.com/eagle.(none)
1d42094d18 after merge fix 2007-10-23 19:28:47 +05:00
gkodinov/kgeorge@magare.gmz
fb640797b8 Bug #31157: crash when select+order by the avg of some field within the group by
The uncacheable flag should be set at fix_fields() stage.
Fixed by moving the flag setting to match the one in 5.1
2007-10-19 15:43:19 +03:00
thek@adventure.(none)
88107378cd Merge adventure.(none):/home/thek/Development/cpp/bug30269/my50-bug30269
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
2007-08-21 17:47:06 +02:00
thek@adventure.(none)
588a528f5a Merge adventure.(none):/home/thek/Development/cpp/bug30269/my51-bug30269
into  adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime
2007-08-21 14:04:31 +02:00
thek@adventure.(none)
1317079fd0 Merge adventure.(none):/home/thek/Development/cpp/bug30269/my50-bug30269
into  adventure.(none):/home/thek/Development/cpp/bug30269/my51-bug30269
2007-08-21 13:44:01 +02:00
thek@adventure.(none)
acfe3fc924 Bug#30269 Query cache eats memory
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. 

Views are excepted and can be cached but only retrieved by super user account.
2007-08-21 13:43:09 +02:00
thek@adventure.(none)
35533f9d8f Merge adventure.(none):/home/thek/Development/cpp/bug30269/my50-bug30269
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
2007-08-17 17:27:41 +02:00
thek@adventure.(none)
c12feca450 Merge adventure.(none):/home/thek/Development/cpp/bug30269/my51-bug30269
into  adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime
2007-08-17 17:26:38 +02:00
thek@adventure.(none)
5d5519edde Merge adventure.(none):/home/thek/Development/cpp/bug30269/my50-bug30269
into  adventure.(none):/home/thek/Development/cpp/bug30269/my51-bug30269
2007-08-17 16:59:20 +02:00
thek@adventure.(none)
a4248c2dd3 Bug #30269 Query cache eats memory
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.
2007-08-17 16:55:20 +02:00
gshchepa/uchum@gleb.loc
538905f12c Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.1-opt
2007-07-29 14:41:39 +05:00
evgen@moonbone.local
e53a484ec9 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/29856-bug-5.0-opt-mysql
2007-07-28 22:47:03 +04:00
evgen@moonbone.local
123666299e Bug#29856: Insufficient buffer space led to a server crash.
The subst_spvars function is used to create query string with SP variables 
substituted with their values. This string is used later for the binary log
and for the query cache. The problem is that the
query_cache_send_result_to_client function requires some additional space
after the query to store database name and query cache flags. This 
space wasn't reserved by the subst_spvars function which led to a memory
corruption and crash.

Now the subst_spvars function reserves additional space for the query cache.
2007-07-28 15:01:29 +04:00
kostja@bodhi.(none)
b8fc731804 Post-merge fixes (merge from the main). 2007-07-17 00:59:21 +04:00
kostja@bodhi.(none)
88fc7cab26 Merge bodhi.(none):/opt/local/work/mysql-5.0-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
2007-07-16 23:31:36 +04:00
thek@adventure.(none)
2a5e7fe592 Merge adventure.(none):/home/thek/Development/cpp/bug28249/my50-bug28249
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
2007-07-12 15:30:34 +02:00
thek@adventure.(none)
8ee7e48de8 Bug#28249 Query Cache returns wrong result with concurrent insert / certain lock
A race condition in the integration between MyISAM and the query cache code 
caused the query cache to fail to invalidate itself on concurrently inserted
data.

This patch fix this problem by using the existing handler interface which, upon
each statement cache attempt, compare the size of the table as viewed from the 
cache writing thread and with any snap shot of the global table state. If the
two sizes are different the global table size is unknown and the current
statement can't be cached.
2007-07-12 13:29:51 +02:00
tsmith@maint1.mysql.com
3ae37d30de Merge maint1.mysql.com:/data/localhome/tsmith/bk/51
into  maint1.mysql.com:/data/localhome/tsmith/bk/maint/51
2007-06-21 18:58:31 +02:00
dkatz@damien-katzs-computer.local
a197a9aa8a Merge damien-katzs-computer.local:/Users/dkatz/mysql50
into  damien-katzs-computer.local:/Users/dkatz/mysql51
2007-06-19 18:18:59 -04:00
kostja@bodhi.(none)
4fd8158456 Fix a merge mistake. 2007-06-19 18:04:42 +04:00
kostja@bodhi.(none)
68632318dc Manual merge. 2007-06-19 15:02:08 +04:00
dkatz@damien-katzs-computer.local
b89e4f9ef2 Bug #29053 SQL_CACHE in UNION causes non-deterministic functions to be cached
Changed code to enforce that SQL_CACHE only in the first SELECT is used to turn on caching(as documented), but any SQL_NO_CACHE will turn off caching (not documented, but a useful behaviour, especially for machine generated queries). Added test cases to explicitly test the documented caching behaviour and test cases for the reported bug.
2007-06-18 17:16:20 -04:00
thek@adventure.(none)
2da91b2316 Bug#28211 RENAME DATABASE and query cache don't play nicely together
When all table blocks were removed from the query cache the client session
hung in a tight loop waiting on an impossible condition while consuming a lot
of CPU.

This patch also corrects an error which caused valid tables to sometimes be
removed from the query cache.
2007-06-18 17:46:29 +02:00
dkatz@damien-katzs-computer.local
7a303bc80e Merge damien-katzs-computer.local:/Users/dkatz/mysql50
into  damien-katzs-computer.local:/Users/dkatz/mysql51
2007-06-13 16:37:16 -04:00
dkatz@damien-katzs-computer.local
1481bfc87b Bug #28897 UUID() returns non-unique values when query cache is enabled
Removed the ability to cache queries containing "UUID()".
2007-06-13 14:23:25 -04:00
thek@adventure.(none)
4144dc7262 Merge adventure.(none):/home/thek/Development/cpp/bug27792/my50-bug27792
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
2007-05-08 12:18:36 +02:00