Commit graph

68672 commits

Author SHA1 Message Date
Mayank Prasad
b879731f1d merge from mysql5.1 for bug#11760210 2011-03-11 17:01:19 +05:30
Mayank Prasad
d2e36e4258 BUG #11760210: 52596: SSL_CIPHER_LIST NOT SET OR RETURNED FOR "SHOW STATUS LIKE 'SSL_CIPHER_LIST'"
Issue:
      SSL_CIPHER set to a specific CIPHER name was not getting picked up by SHOW STATUS Command.

Solution:
      If specific cipher name is specified, avoid overwriting of Cipher List with default Cipher names.


extra/yassl/src/yassl_int.cpp:
  If user specified Cipher name is there, avoid populating default
  cipher names' list.
mysql-test/r/ssl_cipher.result:
  Expected file for ssl_cipher.test test case
mysql-test/t/ssl_cipher-master.opt:
  Server option file for ssl_cipher.test test case.
mysql-test/t/ssl_cipher.test:
  Test case to verify that user specified SSL cipher name is shown in SHOW STATUS Command.
2011-03-11 16:16:34 +05:30
Marc Alff
258e3bfc30 Test cleanup 2011-03-11 11:45:16 +01:00
Marc Alff
70fd13346d Reworked the test case to be more robust. 2011-03-10 13:02:28 +01:00
Marc Alff
c5f0889670 Local merge 2011-03-10 09:47:53 +01:00
Marc Alff
3f2d2fe7b5 Local merge 2011-03-10 09:43:55 +01:00
Alexander Nozdrin
5653a71d3e Patch for Bug#11765684 (58674: SP-cache does not detect changes in
pre-locking list caused by triggers).

The thing is that CREATE TRIGGER / DROP TRIGGER may actually
change pre-locking list of (some) stored routines.

The SP-cache does not detect such changes. Thus if sp_head-instance
is cached in SP-cache, subsequent executions of the cached
sp_head will use inaccurate pre-locking list.

The patch is to invalidate SP-cache on CREATE TRIGGER / DROP TRIGGER.
2011-03-10 11:07:57 +03:00
Marc Alff
caee7f416f Implemented code review comments,
improved the result file readability.
2011-03-10 09:00:43 +01:00
Anitha Gopi
0b7e6f81af Skip tests in disabled-daily.list 2011-03-10 09:57:14 +05:30
Anitha Gopi
f561c9507b Skip the tests listed in disabled-weekly.list 2011-03-10 09:54:16 +05:30
Anitha Gopi
b7caa09215 Bug11817185# : Disabled MAIN.ARCHIVE-BIG.TEST 2011-03-10 09:47:49 +05:30
Mattias Jonsson
d3ca484f46 merge 2011-03-09 18:41:16 +01:00
Mattias Jonsson
ba85e3cf54 Merge of Bug#11766232 - bug#59297 2011-03-09 18:12:23 +01:00
Georgi Kodinov
01f218e896 merge mysql-5.1->mysql-5.5 2011-03-09 16:04:50 +02:00
Georgi Kodinov
dc1c65b618 merge mysql-5.0->mysql-5.1 2011-03-09 14:59:34 +02:00
Georgi Kodinov
54e3e6d34e merge mysql-5.0-secrutiy-fixed -> mysql-5.0 2011-03-09 14:48:23 +02:00
Marc Alff
d1cbc64c38 Bug#11830755 - UNIT TESTS PFS_INSTR AND PFS_INSTR_CLASS CRASH IN MUTEX CALLS ON WINDOWS
Before this fix, two performance schema unit tests crashed on windows.

The problem was a missing initialization to PFS_atomics,
which caused the crash only for platform not compiled with native atomics.

This fix adds the missing initialization in the unit tests.
No production code was changed, this is a unit test bug only.
2011-03-08 13:42:00 +01:00
Jon Olav Hauglid
0db0e64f33 Bug #11755431 (former 47205)
MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR ENGINES NOT
SUPPORTING NATIVE REPAIR

Executing 'mysqlcheck --check-upgrade --auto-repair ...' will first issue
'CHECK TABLE FOR UPGRADE' for all tables in the database in order to check if the
tables are compatible with the current version of MySQL. Any tables that are
found incompatible are then upgraded using 'REPAIR TABLE'.

The problem was that some engines (e.g. InnoDB) do not support 'REPAIR TABLE'.
This caused any such tables to be left incompatible. As a result such tables were
not properly fixed by the mysql_upgrade tool.

This patch fixes the problem by first changing 'CHECK TABLE FOR UPGRADE' to return
a different error message if the engine does not support REPAIR. Instead of
"Table upgrade required. Please do "REPAIR TABLE ..." it will report
"Table rebuild required. Please do "ALTER TABLE ... FORCE ..."

Second, the patch changes mysqlcheck to do 'ALTER TABLE ... FORCE' instead of
'REPAIR TABLE' in these cases.

This patch also fixes 'ALTER TABLE ... FORCE' to actually rebuild the table.
This change should be reflected in the documentation. Before this patch,
'ALTER TABLE ... FORCE' was unused (See Bug#11746162)

Test case added to mysqlcheck.test


client/mysqlcheck.c:
  Changed mysqlcheck to do 'ALTER TABLE ... FORCE' if
  'CHECK TABLE FOR UPGRADE' reports ER_TABLE_NEEDS_REBUILD
  and not ER_TABLE_NEEDS_UPGRADE.
mysql-test/r/mysqlcheck.result:
  Added regression test.
mysql-test/std_data/bug47205.frm:
  InnoDB 5.0 FRM which contains a varchar primary key using
  utf8_general_ci. This is an incompatible FRM for 5.5.
mysql-test/t/mysqlcheck.test:
  Added regression test.
sql/handler.h:
  Added new HA_CAN_REPAIR flag.
sql/share/errmsg-utf8.txt:
  Added new error message ER_TABLE_NEEDS_REBUILD
sql/sql_admin.cc:
  Changed 'CHECK TABLE FOR UPDATE' to give ER_TABLE_NEEDS_REBUILD
  instead of ER_TABLE_NEEDS_UPGRADE if the engine does not support
  REPAIR (as indicated by the new HA_CAN_REPAIR flag).
sql/sql_lex.h:
  Remove unused ALTER_FORCE flag.
sql/sql_yacc.yy:
  Make sure ALTER TABLE ... FORCE recreates the table
  by setting the ALTER_RECREATE flag as the ALTER_FORCE
  flag was unused.
storage/archive/ha_archive.h:
  Added new HA_CAN_REPAIR flag to Archive
storage/csv/ha_tina.h:
  Added new HA_CAN_REPAIR flag to CSV
storage/federated/ha_federated.h:
  Added new HA_CAN_REPAIR flag to Federated
storage/myisam/ha_myisam.cc:
  Added new HA_CAN_REPAIR flag to MyISAM
2011-03-08 09:41:57 +01:00
Jon Olav Hauglid
5e32755e4c Bug #11784056 ENABLE CONCURRENT READS WHILE CREATING
NON-PRIMARY UNIQUE INDEX USING INNODB

This patch adds the HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE
capability flag to InnoDB, indicating that concurrent reads
can be allowed while non-primary unique indexes are created.

This is an follow-up to Bug #11751388 which enabled concurrent
reads when creating non-primary non-unique indexes.

Test case added to innodb_mysql_sync.test.
2011-03-07 14:30:49 +01:00
Jon Olav Hauglid
bafe24035d Bug #11764779 (former 57649)
FLUSH TABLES under FLUSH TABLES <list> WITH READ LOCK leads 
to assert failure.

This assert was triggered if a statement tried up upgrade a metadata
lock with an active FLUSH TABLE <list> WITH READ LOCK. The assert 
checks that the connection already holds a global intention exclusive
metadata lock. However, FLUSH TABLE <list> WITH READ LOCK does not
acquire this lock in order to be compatible with FLUSH TABLES WITH
READ LOCK. Therefore any metadata lock upgrade caused the assert to
be triggered.

This patch fixes the problem by preventing metadata lock upgrade
if the connection has an active FLUSH TABLE <list> WITH READ LOCK.
ER_TABLE_NOT_LOCKED_FOR_WRITE will instead be reported to the client.

Test case added to flush.test.
2011-03-07 10:08:10 +01:00
Alexander Barkov
b326b9a3a0 Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters
@ mysql-test/r/ctype_latin1.result
  @ mysql-test/r/ctype_utf8.result
  @ mysql-test/t/ctype_latin1.test
  @ mysql-test/t/ctype_utf8.test
  Adding tests

  @ sql/mysqld.h
  @ sql/item.cc
  @ sql/sql_parse.cc
  @ sql/sql_view.cc

  Refactoring (thanks to Guilhem for the idea):

  Item_string::print() was hard to understand because of the different
  QT_ constants: in "query_type==QT_x", QT_x is explicitely included
  but the other two QT_ are implicitely excluded. The combinations
  with '||' and '&&' make this even harder.
  - logic is now more "explicit" by changing QT_ constants to a bitmap of flags:
    QT_ORDINARY: no change,
    QT_IS -> QT_TO_SYSTEM_CHARSET | QT_WITHOUT_INTRODUCERS,
    QT_EXPLAIN -> QT_TO_SYSTEM_CHARSET
    (QT_EXPLAIN was introduced in the first version of the Bug#57341 patch)
  - Item_string::print() is rewritten using those flags

  Bugfix itself:

  When QT_TO_SYSTEM_CHARSET is used alone (with no QT_WITHOUT_INTRODUCERS),
  we print string literals as follows:

  - display introducers if they were in the original query
  - print ASCII characters as is
  - print non-ASCII characters using hex-escape
  Note: as "EXPLAIN" output is only for human readability purposes
  and does not need to be a pasrable SQL, so using hex-escape is Ok.
  ErrConvString class perfectly suites for hex escaping purposes.
2011-03-04 18:43:28 +03:00
Nirbhay Choubey
7e6d938f57 BUG#11766219 : 59280: $MYSQL_HOME IS NOT USED FOR THE
CLIENT CONFIGURATION.

At startup, MySQL server/client programs do not read
configuration file pointed by MYSQL_HOME environment
variable.

This happened as, this environment variable was
handled by a different variable (DEFAULT_HOME_ENV)
in the code, which was ne'er initialized.

Fixed by changing it to MYSQL_HOME.


mysys/default.c:
  BUG 11766219 : 59280: $MYSQL_HOME IS NOT USED FOR THE
                 CLIENT CONFIGURATION.
  
  In the current build environment, the variable
  DEFAULT_HOME_ENV is no more found being initialized
  to MYSQL_HOME (as was the case earlier). Changed the
  variable name to MYSQL_HOME.
2011-03-04 21:03:39 +05:30
Jorgen Loland
4015719c01 BUG#11766317: FIND_IN_SET won't work normaly after upgrade
from 5.1 to 5.5

(Former 59405)

In this bug, args[0] in an Item_func_find_in_set stored an 
Item_func_weekday that was constant. In 
Item_func_find_in_set::fix_length_and_dec(), args[0]->val_str() 
was called. Later, when Item_func_find_in_set::val_int() was 
called, args[0]->null_value was checked. However, the 
Item_func_weekday in args[0] had now been replaced with an 
Item_cache. No val_*() calls had been made to this Item_cache,
thus null_value was incorrectly 'true', resulting in missing 
rows in the result set.

enum_value gets a value in fix_length_and_dec() iff args[0]
is both constant and non-null. It is therefore unnecessary 
to check the null_value of args[0] in val_int().

An alternative fix would be to call args[0]->val_int() inside 
Item_func_find_in_set::val_int(). This would ensure
args[0]->null_value was set correctly (always false in this case), 
but that would have to be done for every record this const value 
is checked against.


mysql-test/r/func_set.result:
  Add test for BUG#59405
mysql-test/t/func_set.test:
  Add test for BUG#59405
2011-03-04 15:46:17 +01:00
MySQL Build Team
a471109971 Implementing Bug #57175 MySQL source tarballs should include generated spec file 2011-03-03 22:46:12 +01:00
unknown
d2ac3542f2 Merge from mysql-5.1.56-release 2011-03-03 21:11:47 +01:00
Alexander Barkov
1a48afc1c6 Merging from mysql-5.1 2011-03-03 18:46:30 +03:00
Alexander Barkov
a1e9be8e8b Bug 11766519 - 59648: MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED.
Part 2. Function QUOTE() was not multi-byte safe.

  @ mysql-test/r/ctype_ucs.result
  @ mysql-test/t/ctype_ucs.test
  Adding tests

  @ sql/item_strfunc.cc
  Fixing Item_func_quote::val_str to be multi-byte safe.

  @ sql/item_strfunc.h
  Multiple size needed for quote characters to mbmaxlen
2011-03-03 18:39:26 +03:00
Alexander Barkov
cb018d83d7 Merging from 5.1 2011-03-03 15:27:36 +03:00
Alexander Barkov
1bc5e76efb BUG#11766519 (bug#59648): MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED
Problem: wrong character set pointer was passed to my_strtoll10_mb2,
which led to DBUG_ASSERT failure in some cases.

  @ mysql-test/r/func_encrypt_ucs2.result
  @ mysql-test/t/func_encrypt_ucs2.test
  @ mysql-test/r/ctype_ucs.result
  @ mysql-test/t/ctype_ucs.test
  Adding tests

  @ sql/item_func.cc
  "cs" initialization was wrong (res does not necessarily point to &str_value)

  @ sql/item_strfunc.cc
  Item_func_dec_encrypt::val_str() and Item_func_des_descrypt::val_str()
  did not set character set for tmp_value (the returned value),
  so the old value, which was previously copied from args[1]->val_str(),
  was incorrectly returned with tmp_value.
2011-03-03 15:04:04 +03:00
Alexander Barkov
ce5ab13578 NULL-merge from mysql-5.1 2011-03-03 11:30:41 +03:00
Alexander Barkov
165660fd29 An after-fix for
Bug#11765108 - Bug#58036: CLIENT UTF32, UTF16, UCS2 SHOULD BE DISALLOWED, THEY CRASH SERVER 

Fixing wrong usage of DBUG_ASSERT.
In non-debug version thd_init_client_charset
was not executed at all.
2011-03-03 11:25:37 +03:00
Anitha Gopi
c5426a140f Bug#11769332 : These tests crash on windows which leads to cdb hang. This results in very long runtime. Disable till the bug is fixed 2011-03-03 12:18:04 +05:30
Anitha Gopi
8b7882d4a7 Bug#11769332 : Disable in daily runs till the bug is fixed. These tests crash the server abd can lead to cdb hang on windows 2011-03-03 11:52:52 +05:30
Davi Arnaut
234543258f Bug#51817: incorrect assumption: thd->query at 0x2ab2a8360360 is an invalid pointer
Post-merge fix: equal sign is now meaningless, the
string being printed was already preceded by a colon.
2011-03-02 20:04:54 -03:00
Marc Alff
5ee9001844 Bug#11766528 PERFORMANCE_SCHEMA TRACKS BOTH BINARY AND RELAY LOGS IN THE SAME EVENTS
Before this fix, all the performance schema instrumentation for both the binary log
and the relay log would use the following instruments:
- wait/io/file/sql/binlog
- wait/io/file/sql/binlog_index
- wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index
- wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond

This instrumentation is too general and can be more specific.

With this fix, the binlog instrumentation is identical,
and the relay log instrumentation is changed to:
- wait/io/file/sql/relaylog
- wait/io/file/sql/relaylog_index
- wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index
- wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond

With this change, the performance instrumentation for the binary log and the relay log,
which share the same structure but have different uses, is more detailed.
This is especially important for hosts in the middle of a replication chain,
that are both masters (binlog) and slaves (relaylog).
2011-03-01 17:39:28 +01:00
Vinay Fisrekar
be386ebb7e merge from mysql-5.1 -> mysql-5.5 2011-03-01 21:33:00 +05:30
Vinay Fisrekar
845e36e1a9 Bug#11766165 - 59211: SELECT RETURNS DIFFERENT VALUE FOR MIN(YEAR) FUNCTION
Result File Correction For Bug Fix
2011-03-01 21:26:24 +05:30
Alexander Barkov
561738dc10 Merging from mysql-5.1 2011-03-01 17:42:37 +03:00
Magne Mahre
a4481d3222 Post-push cleanup, for Bug#11763065 et al. 2011-03-01 14:36:47 +01:00
Alexander Barkov
fd1e3b03ff Bug#11766725 (Bug#59901) EXTRACTVALUE STILL BROKEN AFTER FIX FOR BUG #44332
Problem: a byte behind the end of input string was read
in case of a broken XML not having a quote or doublequote
character closing a string value.

Fix: changing condition not to read behind the end of input string

  @ mysql-test/r/xml.result
  @ mysql-test/t/xml.test
  Adding tests

  @ strings/xml.c
  When checking if the closing quote/doublequote was found,
  using p->cur[0] us unsafe, as p->cur can point to the byte after the value.
  Comparing p->cur to p->beg instead.
2011-03-01 15:30:18 +03:00
Alexander Barkov
14263b222a Bug#11753363 (bug#44793) CHARACTER SETS: CASE CLAUSE, UCS2 OR UTF32, FAILURE
Problem: in case of string CASE/WHEN arguments with different
character sets, Item_func_case::find_item() called comparator
cmp_items[x] on mixed character set Items, so a 8-bit value could
be errouneously referenced to as being utf16/utf32 value,
which led to crash on DBUG_ASSERT() because of wrong value length.
This was wrong, as string comparator expects arguments in the same
character set.

Fix: modify Item_func_case's argument list after calling
agg_arg_charsets_for_comparison() - put the Items in "agg" array
back to "args", because some of the Items in the "agg" array might
have been changed to character set converters:
- to Item_func_conv_charset for non-constant items
- to Item_string for constant items

In other words, perform the same substitution which is done in
all other operations string comparison or string result operations:

Replace
  CASE         latin1_item              WHEN utf16_item THEN ... END
to
  CASE CONVERT(latin1_item USING utf16) WHEN utf16_item THEN ... END

Replace
  CASE utf16_item WHEN         latin1_item              THEN ... END
to
  CASE utf16_item WHEN CONVERT(latin1_item USING utf16) THEN ... END


  @ mysql-test/r/ctype_utf16.result
  @ mysql-test/r/ctype_utf32.result
  @ mysql-test/t/ctype_utf16.test
  @ mysql-test/t/ctype_utf32.test
  Adding tests

  @ sql/item_cmpfunc.cc
  Put "agg" back to "args".

  @ sql/sql_string.cc
  Backporting a fix for String::set_or_copy_aligned() from 5.6,
  for better test coverage:
  "SELECT _utf16 0x61" should expand the string to 0x0061 rather
  than to 0x000061.
  This fix was made in 5.6 under terms of "WL#4616 Implement UTF16-LE".
2011-03-01 15:09:37 +03:00
Magne Mahre
c4715a8076 Bug#11765237 - 58179: CANNOT START MYSQLD WITH APP VERIFIER
Bug#11763065 - 55730: KILL_SERVER() CALLS SETEVENT ON A NULL 
               HANDLE, SMEM_EVENT_CONNECT_REQUEST
      
Application Verifier is a Microsoft tool used for
detecting certain classes of programming errors.
In particular, MS Windows OS resource usage is
monitored for wrong usage (handles, thread local
storage, critical sections, ...)
      
In MySQL 5.5.x, an error was introduced where an
object on thread local storage was used before the
TLS and the object was created.
      
The fix has been to move the mysys initialization
to an earlier stage in the boot process when built for
Windows.  For non-win builds, the init already happens
early.

Some un-tangling of calls to my_init(), my_basic_init()
and my_thread_global_init() was done.  There is no
longer a need to do init in steps, so the full my_init()
is called instead of my_init_basic().
      
In addition,  Bug#11763065 was fixed.  The event handle
'smem_event_connect_request' is only created if
'opt_enable_shared_memory' is set.  When killing the
server, an event was flagged on the handle
unconditionally.  Added a test, so it will only be
flagged if created.


include/my_pthread.h:
  my_thread_basic_global_init is no longer
  necessary, and the my_thread_basic_global_reinit 
  function is renamed to reflect that it now
  reinits mutexes and condvars originating from
  my_thread_global_init
mysys/my_thr_init.c:
  Reorganized code.
2011-03-01 13:03:31 +01:00
Dmitry Lenev
901226b66a Fix for bug #11765505 - "58480: LARGE_TESTS.LOCK_TABLES_BIG
IS FAILING".

The problem was that large_tests.lock_tables_big test was
failing due to exceeding open files limit on platforms where
this limit was set too low (this test simultaneously opens
approx. 6000 files).

This patch solves this issue by ensuring that this test is
skipped on such platforms.
2011-03-01 14:47:04 +03:00
Serge Kozlov
507e4fa718 Bug#54820. Remove test cases from experimental 2011-02-27 23:23:44 +03:00
Tor Didriksen
69b8293759 Bug #11747102 30771: LOG MORE INFO ABOUT THREADS KILL'D AND SORT ABORTED MESSAGES
mysql-test/r/filesort_debug.result:
  New test case.
mysql-test/t/filesort_debug.test:
  New test case.
sql/filesort.cc:
  thd->killed does not imply thd->is_error(), so test for that separately.
2011-02-24 08:00:12 +01:00
Vasil Dimov
19372f1094 Merge mysql-5.5-innodb -> mysql-5.5 2011-02-23 19:33:41 +02:00
Vasil Dimov
9f699b39f8 Fix the failing sys_vars.all_vars on behalf of Sunny 2011-02-23 16:39:54 +02:00
Jon Olav Hauglid
0c9dde5c70 Bug #11752069 (former bug 43152)
Assertion `bitmap_is_set_all(&table->s->all_set)' failed in
handler::ha_reset

Post-push fix for unit test compilation error on Windows.
2011-02-23 14:50:59 +01:00
Sunny Bains
f91ce0413b Revert the max value of innodb_purge_batch_size to 5000. 2011-02-23 17:56:37 +11:00
Sunny Bains
e9678ae8e7 Add ut0bh.h and ut0bh.c. 2011-02-23 17:48:15 +11:00