Commit graph

54259 commits

Author SHA1 Message Date
Tatiana A. Nurnberg
6b584b80da Bug#23921: random failure of user_limits.test
mysqltest disconnect/connect-combo could be so
quick that connect would hit the server before
it had processed the disconnect. Since that
resulted in one more concurrent connection than
we meant to have, global or per-user
max-user-connections could be exceeded.
This could lead to "random" failures in tests
that set those limits.


client/mysqltest.c:
  Retry max-connect-retries times if connect in
  connect_n_handle_errors() unexpectedly fails
  on connection-limit as this could be a race.
  Break out code that checks for expected --errors
  into its own function.
mysql-test/r/mysqltest.result:
  show that we throw a warning if test expects a SQL-state from
  a command (diff_files, ...) that clearly can't produce one.
mysql-test/t/disabled.def:
  re-enable user_limits
mysql-test/t/mysqltest.test:
  show that we throw a warning if test expects a SQL-state from
  a command (diff_files, ...) that clearly can't produce one.
2008-07-15 13:42:21 +02:00
Mattias Jonsson
58f30a5886 Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
post push patch

push build found tree failing test when using:
--ps-protocol --mysqld=--binlog-format=row
Changed to the new error message.

sql/sql_prepare.cc:
  Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
  
  Changed to the newly added error message
2008-06-09 14:39:20 +02:00
Mattias Jonsson
41c80004ff merge before pushing 2008-06-04 11:08:44 +02:00
Davi Arnaut
2100ec9ec9 Bug#33362: Query cache invalidation (truncate) may hang
if cached query uses many tables

The problem was that query cache would not properly cache
queries which used 256 or more tables but yet would leave
behind query cache blocks pointing to freed (destroyed)
data. Later when invalidating (due to a truncate) query cache
would attempt to grab a lock which resided in the freed data,
leading to hangs or undefined behavior.

This was happening due to a improper return value from the
function responsible for registering the tables used in the
query (so the cache can be invalidated later if one of the
tables is modified). The function expected a return value of
type boolean (char, 8 bits) indicating success (1) or failure
(0) but the number of tables registered (unsigned int, 32 bits)
was being returned instead. This caused the function to return
failure for cases where it had actually succeed because when
a type (unsigned int) is converted to a narrower type (char),
the excess bits on the left are discarded. Thus if the 8
rightmost bits are zero, the return value will be 0 (failure).

The solution is to simply return true (1) only if the number of
registered table is greater than zero and false (0) otherwise.

mysql-test/r/query_cache_merge.result:
  Add test case result for Bug#33362
mysql-test/t/query_cache_merge.test:
  Add test case for Bug#33362
sql/sql_cache.cc:
  Return 1 or 0 depending on the number of registered tables.
2008-06-03 10:59:46 -03:00
Mattias Jonsson
a8af693b50 Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
Problem was an unclear error message since it could suggest that
MyISAM did not support INSERT DELAYED.
Changed the error message to say that DELAYED is not supported by the
table, instead of the table's storage engine.
The confusion is that a partitioned table is in somewhat sense using
the partitioning storage engine, which in turn uses the ordinary
storage engine. By saying that the table does not support DELAYED we
do not give any extra informantion about the storage engine or if it
is partitioned.

mysql-test/r/innodb-replace.result:
  Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
  
  changed error message
mysql-test/t/innodb-replace.test:
  Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
  
  changed error message
mysql-test/t/merge.test:
  Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
  
  changed error message
mysql-test/t/partition_hash.test:
  Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
  
  changed error message
sql/share/errmsg.txt:
  Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
  
  added error message for tables not supporting DELAYED
sql/sql_insert.cc:
  Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
  
  changed error message
2008-06-03 13:25:41 +02:00
Matthias Leich mleich@mysql.com
8d7fcad196 Upmerge of fix for
Bug 36788 Multiple funcs_1 'trig' tests are failing on vanilla builds
2008-06-03 12:21:48 +02:00
Matthias Leich mleich@mysql.com
1544026443 Bug#36788 Multiple funcs_1 'trig' tests are failing on vanilla builds
Fix for this bug and additional improvements/fixes
In detail:
- Remove unicode attribute from several columns
  (unicode properties were nowhere needed/tested)
  of the table tb3
  -> The runnability of these tests depends no more on
     the availibility of some optional collations.
- Use a table tb3 with the same layout for all
  engines to be tested and unify the engine name
  within the protocols.
  -> <engine>_trig_<abc>.result have the same content
- Do not load data into tb3 if these rows have no
  impact on result sets
- Add tests for NDB (they exist already in 5.1)
- "--replace_result" at various places because
  NDB variants of tests failed with "random" row
  order in results
  This fixes a till now unknown weakness within the
  funcs_1 NDB tests existing in 5.1 and 6.0
- Fix the expected result of ndb_trig_1011ext
  which suffered from Bug 32656
  + disable this test
- funcs_1 could be executed with the mysql-test-run.pl
  option "--reorder", which saves some runtime by
  optimizing server restarts.
  Runtimes on tmpfs (one attempt only):
  with    reorder 132 seconds
  without reorder 183 seconds
- Adjust two "check" statements within func_misc.test
  which were incorrect (We had one run with result set
  difference though the server worked good.)
- minor fixes in comments
2008-06-02 21:57:11 +02:00
Patrick Crews
c392457f7c automatically merged 2008-05-30 12:10:32 -04:00
Patrick Crews
b4501e23cd automatically merged 2008-05-30 11:49:53 -04:00
Matthias Leich mleich@mysql.com
b371ba2e14 Bug#36345 Test 'func_misc' fails on RHAS3 x86_64
Upmerge of fix for this bug and a second similar problem
found during experimenting.

This replaces the first fix (already pushed to 5.1
and merged to 6.0) which
- failed in runs with the embedded server
- cannot be ported back to 5.0
2008-05-29 22:16:22 +02:00
Matthias Leich mleich@mysql.com
200a93632e Bug#36345 Test 'func_misc' fails on RHAS3 x86_64
Fix for this bug and a second similar problem
found during experimenting.

This replaces the first fix (already pushed to 5.1
and merged to 6.0) which
- failed in runs with the embedded server
- cannot be ported back to 5.0
2008-05-29 18:38:10 +02:00
Georgi Kodinov
b459ba03b9 automatically merged 2008-05-28 17:33:27 +03:00
Georgi Kodinov
54190bc098 automatically merged 2008-05-28 17:26:26 +03:00
Georgi Kodinov
b2362674d5 merged 5.0-bugteam to 5.1-bugteam
sql/share/charsets/README:
  merged bug 36676 to 5.1-bugteam
strings/CHARSET_INFO.txt:
  merged bug 36676 to 5.1-bugteam
2008-05-28 17:18:24 +03:00
Alexander Barkov
c9232b936d Updating charset doc files.
Thanks to Paul for preparing the up-to-date files
reflecting 4.1 changes.
2008-05-28 15:03:47 +05:00
Patrick Crews
914bb34b38 Bug#36721 - Test funcs1.<engine>_func_view failing for multiple engines
Bug#36724 - Test funcs_1.<engine>_storedproc_02 needs to be updated
Bug#36726 - Test funcs_1.<engine>_storedproc failing - Needs to be updated on 5.1+

func_view bug:  re-records .result files to account for addition of charset and collation data 
                to SHOW CREATE VIEW output
storedproc bugs:  Added expected errors for those storedprocs that use SQLSTATE:00000
                  in their handlers.  re-recorded .result files to account for these
                  expected errors.

mysql-test/suite/funcs_1/r/innodb_func_view.result:
  Update result set for changes to SHOW CREATE VIEW output
mysql-test/suite/funcs_1/r/memory_func_view.result:
  Updated result set due to changes in SHOW CREATE VIEW output
mysql-test/suite/funcs_1/r/myisam_func_view.result:
  Updated result set due to changes in SHOW CREATE VIEW output
2008-05-27 19:30:07 -04:00
Davi Arnaut
52066c5131 Merge. 2008-05-27 12:47:12 -03:00
Davi Arnaut
f972dce2a2 Add variation of compile-pentium-valgrind-max which does not build ndb.
BUILD/compile-pentium-valgrind-max-no-ndb:
  Disable ndb.
2008-05-27 12:35:35 -03:00
Georgi Kodinov
ed78639805 Bug #36887: Typo in mysql_client_test.c uses bind instead of my_bind
There was a typo in a error check causing wrong thing to be ckecked 
and a possible error not being caught.
Fixed by using the correct variable to test for malloc() errors. 

tests/mysql_client_test.c:
  Bug #36887: fixed a typo
2008-05-27 14:33:08 +03:00
Sven Sandberg
605ba6867f BUG#36826: rpl_slave_status fails sporadically in pushbuild
rpl_slave_status failed on pushbuild. The slave stopped with an
error. Adding sync_slave_with_master fixes the problem. Updated
test case. 

mysql-test/suite/rpl/r/rpl_slave_status.result:
  Updated result file.
mysql-test/suite/rpl/t/rpl_slave_status.test:
  - Added comment explaining what the test does.
  - Added sync_slave_with_master in two places where it was missing. This
    caused sporadic pushbuild errors.
  - Added wait_for_slave_to_{start,stop} after {START,STOP} SLAVE queries.
  - Removed 'drop table if exists' from setup code.
  - Replaced save_master_pos;connection slave;sync_with_master by
    sync_slave_with_master.
  - Replaced 'delete from mysql.user' by 'drop user'.
  - Wrapped 'show slave status' inside query_get_value(), so that only what
    we test is in the output.
2008-05-26 15:06:49 +02:00
Chad MILLER
e3320457e1 Merge from mysql-5.1, which adds metainfo for mailer plugin. 2008-05-23 22:08:22 +02:00
Chad MILLER
9198215ec1 Merge from 5.0 trunk. Adding mailer metainfo. 2008-05-23 20:56:39 +02:00
Chad MILLER
0a0bf2d875 Merged from trunk. 2008-05-23 18:45:04 +02:00
Chad MILLER
3e9c477a60 Merge from bk tree. Resolved addition of same files in both trees. 2008-05-23 18:42:54 +02:00
First_name Last_name mleich@mysql.com
8bd3bcf5a1 Fix for
Bug#36345 Test 'func_misc' fails on RHAS3 x86_64
and a second similar problem within this test found
during experimenting.
2008-05-23 17:23:55 +02:00
Chad MILLER
14aef9781a Merge from 5.0. Update version. 2008-05-23 00:25:21 +02:00
Chad Miller
e981dd6215 Merge metainfo for mailer plugin. 2008-05-22 17:57:41 +02:00
Chad MILLER
636e751f36 Add branch metainfo for mailer plugin. 2008-05-21 18:18:44 -04:00
Kristofer Pettersson
f6b7e7e411 Reverted merging misstake.
mysql-test/r/status.result:
  reverted merging misstake
mysql-test/t/status.test:
  reverted merging misstake
2008-05-21 17:34:14 +02:00
Kristofer Pettersson
5b7566a1d3 Bug#34417 Assertion failure in Diagnostics_area::set_error_status()
The Diagnostic_area caused an assertion failure in debug mode when
the disk was full.
  
By setting the internal error handler to ignore errors caused by
underlying logging methods, the error is avoided.


sql/log.cc:
  MYSQL_QUERY_LOG::write uses IOCACHE for writing data. If writing fails 
  an error is pushed by the procedure my_error which in turn invokes
  the default error handler my_message_sql. When the error is set the
  Diagnostic_area status changes and later trigger an assertion on the
  next consecutive status change which happens by for example the 
  function my_ok(). By intercepting the error handler from the logger
  interface this error can be silenced.
2008-05-21 14:44:30 +02:00
unknown
59a880f951 Raise version number after cloning 5.1.25-rc 2008-05-21 09:59:58 +02:00
Kristofer Pettersson
8d07122aff Bug#32966 main.status fails
The failing test case is depending on unnecessary status variable output
which changes based on build configuration. By reducing the output the test
becomes more stable.

mysql-test/r/status.result:
  Modified test case
mysql-test/t/disabled.def:
  Enabled status.test
mysql-test/t/status.test:
  Modified test case.
2008-05-21 09:50:54 +02:00
unknown
3433706a12 Update test coverage for Bug#27430 "Crash in subquery code when in PS
and table DDL changed after PREPARE" to pass in embedded mode.


mysql-test/r/ps.result:
  Update results (Bug#27430)
mysql-test/r/ps_ddl.result:
  Update results (Bug#27430)
mysql-test/t/ps.test:
  Add a test case for Bug#27430. ps.test is not run in --embedded-server,
  thus it now contains the part of the test for Bug#27430 that
  doesn't work in embedded server.
mysql-test/t/ps_ddl.test:
  Move a part of the test for Bug#27430 that doesn't work
  in embedded server to ps.test, that includes not_embedded.inc.
2008-05-20 22:43:26 +04:00
unknown
7ce32c91ba A number of fixes after a merge from the main 5.1 tree:
the local tree contains a fix for 
Bug#32748 "Inconsistent handling of assignments to 
general_log_file/slow_query_log_file",
which changes output of a number of tests.


mysql-test/r/general_log_file_basic.result:
  Update results (Bug#32748)
mysql-test/r/log_output_basic.result:
  Update the test with results of the fix for Bug#32748
mysql-test/r/slow_query_log_file_basic.result:
  Update the test with results of the fix for Bug#32748
mysql-test/t/general_log_file_basic.test:
  Adjust to take into account the fix for Bug#32748 
  (a port from 6.0-bugteam)
mysql-test/t/log_output_basic.test:
  Adjust to take into account the fix for Bug#32748 
  (a port from 6.0-bugteam)
mysql-test/t/slow_query_log_file_basic.test:
  Adjust to take into account the fix for Bug#32748 
  (a port from 6.0-bugteam)
tests/mysql_client_test.c:
  Fix a compilation warning.
2008-05-20 22:23:58 +04:00
unknown
3587539f22 Bug#27430 "Crash in subquery code when in PS and table DDL changed
after PREPARE"
Update test results after a merge with the main tree: the new minimum for 
the table definition cache is 256.


mysql-test/r/table_definition_cache_basic.result:
  Update test results: the new minimum for table definition cache is 256
2008-05-20 21:07:11 +04:00
unknown
02c901ee5e Bug#27430 "Crash in subquery code when in PS and table DDL changed after
PREPARE", review fixes:
- make the patch follow the specification of WL#4166 and remove  
the new error that was originally introduced.
Now the client never gets an error from reprepare, unless it failed.
I.e. even if the statement at hand returns a completely different
result set, this is not considered a server error.
The C API library, that can not handle this situation, was modified to
return a client error.
Added additional test coverage.


include/errmsg.h:
  Add a new client side error: now when we automatically
  reprepare a statement, the new result set may contain a different
  number of columns.
include/mysql_com.h:
  Add a new server status to be sent to the client if the 
  number of columns in the result set is different.
libmysql/errmsg.c:
  Add a new error message.
libmysql/libmysql.c:
  Make the client library robust against a result set that
  contains a different number of columns from prepare time.
  Previously that could never happen, and we simply had an assert.
  That means in particular that all clients are advised to upgrade
  with transition to 5.1, if they are using prepared statements C API.
  Make mysql_stmt_store_result() and mysql_stmt_execute() robust against 
  "broken" statement handles (those that have an error).
sql/sql_parse.cc:
  Clear transient server status flags at start of statement more 
  systematically.
sql/share/errmsg.txt:
  Remove an error that is unused and is not part of any public release.
sql/sql_prepare.cc:
  Instead of returning an error in case the number of result set columns
  has changed, simply update the client in server status.
  That will allow modern clients automatically recover from an error.
tests/mysql_client_test.c:
  Add additional coverage to the cases when the number of result
  set columns changed as a result of reprepare.
  Cover conversion and truncation of result set columns.
2008-05-20 20:36:26 +04:00
Chad MILLER
78cda882ae Bug#36818: rpl_server_id1 fails expecting slave has stopped
The test is vulnerable because it does not check if slave has stopped at time
of the new session is requested `start slave;'

Fixed with deploying explicitly wait_for_slave_to_stop synchronization macro.
2008-05-20 11:14:03 -04:00
unknown
4175806efc Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.(none):/opt/local/work/mysql-5.1-27430


Makefile.am:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/include/mix1.inc:
  Auto merged
sql/item.cc:
  Auto merged
sql/my_decimal.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
libmysqld/CMakeLists.txt:
  Manual merge.
libmysqld/lib_sql.cc:
  Manual merge.
mysql-test/t/disabled.def:
  Manual merge.
2008-05-20 11:38:17 +04:00
unknown
4b13b5cb34 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-27430
into  bodhi.(none):/opt/local/work/mysql-5.1-27430


sql/sql_base.cc:
  Manual merge.
2008-05-20 11:33:27 +04:00
unknown
37b2c32d95 Bug#27430 "Crash in subquery code when in PS and table DDL changed after
PREPARE": rename members, methods, classes to follow the spec 
(a code review request)


sql/mysql_priv.h:
  enum_metadata_type -> enum_table_ref_type
sql/sp_head.cc:
  Metadata_version_observer -> Reprepare_observer
sql/sql_base.cc:
  metadata -> table_ref
sql/sql_class.cc:
  Replace an abstract interface with a concrete implementation.
sql/sql_class.h:
  enum_metadata_type -> enum_table_ref_type
sql/sql_prepare.cc:
  Move implementation of Execute_observer to sql_class.cc and
  rename the class to Reprepare_observer.
  Use getters instead of direct access to the members.
sql/table.h:
  metadata -> table_ref
2008-05-20 11:29:16 +04:00
unknown
990f1f09ed Bug#27430 Crash in subquery code when in PS and table DDL changed after PREPARE
Add test target to the makefile that will cause all
statements to be re-prepared before execution.


Makefile.am:
  Add test-reprepare target. In combination with the
  --ps-protocol this will cause that every statement
  in the test suite be re-prepared before execution.
sql/sql_base.cc:
  Re-prepare each statement before execution.
2008-05-19 13:39:31 -03:00
unknown
4111616625 Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.1-bugteam
into  mysql.com:/d2/hf/mysql-5.1-bugteam
2008-05-19 11:39:30 +05:00
unknown
ee4e10c7fc disabled.def:
rpl_innodb_bug28430 disabled


mysql-test/suite/rpl/t/disabled.def:
  rpl_innodb_bug28430 disabled
2008-05-19 11:38:53 +05:00
unknown
c5865cfdb6 Merge host.loc:/work/bk/5.0-bugteam
into  host.loc:/work/bk/5.1-bugteam


sql/sql_update.cc:
  Auto merged
2008-05-18 14:27:44 +05:00
unknown
8bc987ab5b Merge host.loc:/work/bugs/5.0-bugteam-36676
into  host.loc:/work/bk/5.0-bugteam
2008-05-18 14:27:17 +05:00
unknown
29e7fa258d Fixed bug#36676: multiupdate using LEFT JOIN updates only
first row or fails with an error:
  ERROR 1022 (23000): Can't write; duplicate key in table ''

The server uses intermediate temporary table to store updated
row data.  The first column of this table contains rowid.
Current server implementation doesn't reset NULL flag of that
column even if the server fills a column with rowid.
To keep each rowid unique, there is an unique index.
An insertion into an unique index takes into account NULL
flag of key value and ignores real data if NULL flag is set.
So, insertion of actually different rowids may lead to two
kind of problems.  Visible effect of each of these problems
depends on an initial engine type of temporary table:

1. If multiupdate initially creates temporary table as
a MyISAM table (a table contains blob columns, and the
create_tmp_table function assumes, that this table is
large), it inserts only one single row and updates
only rows with one corresponding rowid. Other rows are
silently ignored. 

2. If multiupdate initially creates MEMORY temporary
table, fills it with data and reaches size limit for
MEMORY tables (max_heap_table_size), multiupdate
converts MEMORY table into MyISAM table and fails
with an error:
  ERROR 1022 (23000): Can't write; duplicate key in table ''


Multiupdate has been fixed to update the NULL flag of
temporary table rowid columns.



mysql-test/r/multi_update_tiny_hash.result:
  Added test case for bug#36676.
mysql-test/t/multi_update_tiny_hash-master.opt:
  Added test case for bug#36676.
mysql-test/t/multi_update_tiny_hash.test:
  Added test case for bug#36676.
sql/sql_update.cc:
  Fixed bug#36676: multiupdate using LEFT JOIN updates only
                   first row or fails with an error:
    ERROR 1022 (23000): Can't write; duplicate key in table ''
  
  The multi_update::send_data method has been modified to reset null bits of
  fields containing rowids.
2008-05-18 14:21:25 +05:00
unknown
314e6e2551 Merge magare.gmz:/home/kgeorge/mysql/work/mysql-5.0-bugteam
into  magare.gmz:/home/kgeorge/mysql/work/merge-5.1-bugteam


sql/handler.cc:
  Auto merged
configure.in:
  merge 5.0-bugteam to 5.1-bugteam
2008-05-18 11:42:55 +03:00
unknown
1c12291b2f Fix mysql_client_test failure in pushbuild 5.1-27430
(Bug#27430)


sql/sql_prepare.cc:
  Fix a simple coding mistake.
2008-05-18 10:28:36 +04:00
unknown
1cf0b5cb89 Implement some code review fixes for the fix for Bug#27430
"Crash in subquery code when in PS and table DDL changed after PREPARE"


include/my_sys.h:
  Add two new flags for my_error(). These flags help parameterize
  behavoiur of my_message_sql()
sql/item.cc:
  Update comments.
  Fix a typo in Item_param::set_param_type_and_swap_value()
sql/mysqld.cc:
  Implement two additional flags for my_error():
   - if ME_NO_SP_HANDLER is specified, ignore stored procedure continue/
      exit handlers
   - if ME_NO_WARNING_FOR_ERROR is specified, do not push warning
sql/sql_base.cc:
  Update comments.
  Rename a few methods.
sql/sql_class.h:
  Update and improve comments.
sql/sql_prepare.cc:
  Update comments.
  Style changes.
sql/table.h:
  Update comments.
  Style changes.
  Rename a few methods.
tests/mysql_client_test.c:
  Zero the bind array, to follow C API requirements.
2008-05-18 01:51:18 +04:00
unknown
f197f3abb4 Bug #36705 key_buffer_size of >= 2G allocates all availabel virtual memory on 64-bit wondo.
temporary variables of 'long' types were used to store ulong values,
that causes init_key_cache to receive distorted parameters


sql/handler.cc:
  Bug #36705 key_buffer_size of >= 2G allocates all availabel virtual memory on 64-bit wondo.
  
  types of temporary variables changed to match init_key_cache() parameters
2008-05-17 12:53:47 +05:00