Commit graph

24769 commits

Author SHA1 Message Date
Alexander Barkov
510844e72a #
# Bug#24690 Stored functions: RETURNing UTF8 strings
# do not return UTF8_UNICODE_CI collation
#
# Bug#17903: cast to char results in binary
# Regression. The character set was not being properly initialized
# for CAST() with a type like CHAR(2) BINARY, which resulted in
# incorrect results or even a server crash.
#

Backporting from mysql-6.0-codebase.

mysql-test/r/sp-ucs2.result:
mysql-test/t/sp-ucs2.test:

  Adding tests

sql/mysql_priv.h:
  Adding prototype

sql/sp.cc
  Remember COLLATE clause for non-default collations

sql/sql_parse.cc
  Adding a new helper function

sql/sql_yacc.yy
  - Allow "CHARACTER SET cs COLLATE cl" in
    SP parameters, RETURNS, DECLARE
  - Minor reorganization for "ASCII" and "UNICODE"
    related rules, to make the code more readable,
    also to allow these aliases:
    * "VARCHAR(10) ASCII BINARY"   -> CHARACTER SET latin1 COLLATE latin1_bin
    * "VARCHAR(10) BINARY ASCII"   -> CHARACTER SET latin1 COLLATE latin1_bin
    * "VARCHAR(10) UNICODE BINARY" -> CHARACTER SET ucs2 COLLATE ucs2_bin
    * "VARCHAR(10) BINARY UNICODE" -> CHARACTER SET ucs2 COLLATE ucs2_bin
    Previously these four aliases returned the error
    "This version of MySQL does not yet support return value collation".

Note:

   This patch allows  "VARCHAR(10) CHARACTER SET cs COLLATE cl"
   and the above four aliases.

   "VARCHAR(10) COLLATE cl" is still not allowed
   i.e. when COLLATE is given without CHARACTER SET.
   If we want to support this, we need an architecture decision
   which character set to use by default.
2009-11-09 15:17:10 +04:00
Alexander Barkov
3bb7d3eebf Backporting test for Bug#158 ENUM and SET types does not accept valid cp1251 character 2009-11-09 14:53:49 +04:00
Alexander Barkov
eb852073c3 Backporting Bug#37129 LDML lacks <i> rule 2009-11-09 13:45:40 +04:00
Alexey Botchkov
5de8258b40 merging 2009-11-04 12:55:22 +04:00
Jonathan Perkin
7defb0d1e8 Merge to mysql-next-mr-bugfixing. 2009-11-03 13:59:20 +00:00
Jonathan Perkin
1fd7c1038a Additional change required for bug#46834, find the std_data directory
correctly in RPMs.
2009-11-03 13:56:35 +00: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
Vladislav Vaintroub
40536582fc merge 2009-11-03 01:45:16 +01:00
Vladislav Vaintroub
2f075a1e37 Bug #47423 mtr connects to wrong database
The reason for the bug is that mysqtest as well as other client tools
running in test suite (mysqlbinlog, mysqldump) will first try to connect 
whatever database has created shared memory with default base name 
"MySQL" and use this. (Same effect could be seen on Unix if mtr would
not care to calculate "port" and "socket" parameter).
      
The fix ensures that all client tools and  running in mtr use unique  
per-database shared memory base parameters, so there is no possibility
to clash with already installed one. We use socket name for shared memory 
base (it's known to be unique). This shared-memory-base is written to the
MTR config file to the [client] and [mysqld] sections. Fix made also made 
sure all client tools understand and correctly handle --shared-memory-base.
Prior to this patch  it was not the case for  mysqltest, mysqlbinlog and 
mysql_client_test.
      
All new connections done from mtr scripts via connect() will by default 
set shared-memory-base. And finally, there is a possibility to force 
shared memory or pipe connection and overwrite shared memory/pipe base name
from within mtr scripts via optional PIPE or SHM modifier. This functionality
was manually backported from 6.0
(original patch  http://lists.mysql.com/commits/74749)
2009-11-03 01:19:37 +01:00
Marc Alff
1035de6282 Bug#9801 Views: imperfect error message
Backport for 5.5

The root cause of this bug is that the grammar for GROUP BY clauses,
when using WITH CUBE or WITH ROLLUP, cause conflicts with the grammar
for VIEW, when using WITH CHECK OPTION.

The solution is to implement two token look ahead when parsing a WITH token,
to disambiguate the non standard WITH CUBE and WITH ROLLUP syntaxes.

Patch based on code from Marc Alff and Antony Curtis
2009-11-02 09:31:00 -07:00
Marc Alff
6a67daaa5a Bug#33637 SHOW PROCEDURE CODE/SHOW FUNCTION CODE sp_name gives a syntax error.
Backport for 5.5

In non debug builds, the statements:
- SHOW PROCEDURE CODE
- SHOW FUNCTION CODE
used to fail with a "syntax error", which is misleading.

These statements have been changed to return the following error for non
debug builds:
ERROR HY000: The 'SHOW PROCEDURE|FUNCTION CODE' feature is disabled; you
need MySQL built with '--with-debug' to have it working

For debug builds (./configure --with-debug), nothing is changed.
2009-10-29 10:51:04 -06:00
Alexander Nozdrin
9ac8feeea0 Automerge from mysql-next-mr. 2009-10-29 18:03:30 +03:00
Alexey Botchkov
96f31b3637 mysql_upgrade test fixed
per-file comments:
  mysql-test/r/mysql_upgrade.result
     result updated
  mysql-test/t/mysql_upgrade.test
     --skip-verbose option added to the call
2009-10-29 10:03:16 +04:00
Alexey Botchkov
05ddc34be8 WL#4991 mysql_upgrade --fix-privilege-tables
(backport)
   mysql_upgrade script accepts --upgrade-system-tables option,
   fixing only system tables in this case.

per-file comments:
  client/mysql_upgrade.c
WL#4991 mysql_upgrade --fix-privilege-tables
    --upgrade-system-tables option added.
   if it is set, the tool won't look for the mysqlcheck then
   run_mysqlcheck_fixnames() and run_mysqlcheck_upgrade won't be called.
  mysql-test/r/mysql_upgrade.result
WL#4991 mysql_upgrade --fix-privilege-tables
    test result added
  mysql-test/t/mysql_upgrade.test
WL#4991 mysql_upgrade --fix-privilege-tables
    test case added
2009-10-28 14:02:00 +04:00
Alexander Nozdrin
48c15f0fb0 Automerge from mysql-next-mr. 2009-10-28 10:48:53 +03:00
Alexander Nozdrin
ca1d413360 Automerge from mysql-trunk-bugfixing. 2009-10-27 13:05:40 +03:00
Alexander Nozdrin
436223fbe3 Make rpl_timezone experimental due to Bug#47017. 2009-10-27 13:05:06 +03:00
Alexander Nozdrin
c6aeab8cfe Automerge from mysql-next-mr. 2009-10-27 12:59:09 +03:00
Alexander Nozdrin
273a0a4f97 Automerge from mysql-next-mr. 2009-10-27 12:57:44 +03:00
Dmitry Lenev
b6e5b5e99b Fixed lock_sync.test failure in mysql-next-mr tree in embedded mode.
Disabled execution of this test for embedded server until fix for
bug 41971 'Thread state on embedded server is always "Writing to net"'
is back-ported to this tree.
2009-10-27 12:43:40 +03:00
He Zhenxing
c841979de4 disable rpl_spec_variables due to it fails constantly on HPUX 2009-10-27 16:42:50 +08:00
Alexander Barkov
02fff878cc A postfix for WL#1349
Fixing locale name: en_US.UTF-8 -> en_US.utf8
2009-10-27 08:38:32 +04:00
Dmitry Lenev
dfa2acb141 Fix for bug #45143 "All connections hang on concurrent ALTER TABLE".
Concurrent execution of statements which require non-table-level
write locks on several instances of the same table (such as
SELECT ... FOR UPDATE which uses same InnoDB table twice or a DML
statement which invokes trigger which tries to update same InnoDB
table directly and through stored function) and statements which
required table-level locks on this table (e.g. LOCK TABLE ... WRITE,
ALTER TABLE, ...) might have resulted in a deadlock.

The problem occured when a thread tried to acquire write lock
(TL_WRITE_ALLOW_WRITE) on the table but had to wait since there was
a pending write lock (TL_WRITE, TL_WRITE_ALLOW_READ) on this table
and we failed to detect that this thread already had another instance
of write lock on it (so in fact we were trying to acquire recursive
lock) because there was also another thread holding write lock on the
table (also TL_WRITE_ALLOW_WRITE). When the latter thread released
its lock neither the first thread nor the thread trying to acquire
TL_WRITE/TL_WRITE_ALLOW_READ were woken up (as table was still write
locked by the first thread) so we ended up with a deadlock.

This patch solves this problem by ensuring that thread which
already has write lock on the table won't wait when it tries
to acquire second write lock on the same table.
2009-10-26 22:38:03 +03:00
Alexander Barkov
7a22056abb A postfix for WL#1349: Fixing test failire problems on HP-UX 2009-10-26 16:29:41 +04:00
Sergey Glukhov
c995288a11 Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def"
additional fix(Betony)
2009-10-26 11:35:20 +04:00
Luis Soares
78172f9e21 automerge: mysql-5.1-rep+2-delivery1 --> mysql-5.1-rpl-merge. 2009-10-25 22:58:52 +00:00
Luis Soares
ec9aa90ad9 post-push fixes
Disabled rpl_cross_version (instead of setting it experimental).
Fixed outstanding warning fix in main.debug_sync.
2009-10-23 17:07:45 +01:00
He Zhenxing
42743de67d Auto merge 5.1-rep-semisync to 5.1-rep+2-delivery1 2009-10-23 21:34:07 +08:00
He Zhenxing
f09129c6be Skip semisync test if the plugin-dir is not set to semisync plugin dir 2009-10-23 21:26:17 +08:00
Sergey Glukhov
dbe504ec7a Bug#35427 INFORMATION_SCHEMA.TABLES.TABLE_CATALOG is NULL, should be "def"
backport to betony
2009-10-23 16:02:20 +05:00
Luis Soares
9ef305232f Added rpl_heartbeat_2slaves to experimental list. 2009-10-23 10:33:12 +01:00
Luis Soares
aa12c04656 post-push fix: Preserving warning codes from mysql-next-mr. Updated
result files.

Warnings affected:
 - WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED
 - ER_TOO_LONG_FIELD_COMMENT
2009-10-23 10:29:59 +01:00
Sergey Glukhov
676c12e2d4 Bug#35428 When selecting from INFORMATION_SCHEMA tables, incomplete metadata
backport to Betony
2009-10-23 14:19:54 +05:00
Alexander Barkov
e17d05cdc7 A postfix for WL#1349.
Fixed problems:
- "mtr --mem mysql_locale_posix" could fail because of wrong temporary
  directory name: var/tmp/ -> $MYSQLTEST_VARDIR/tmp/
- "mtr federated_debug" could fail because of not compiled-in
   locale character set.  Always run mysqladmin with latin1.
2009-10-23 13:02:17 +05:00
Sergey Glukhov
0a0f50e4ab Bug#39270 I_S optimization algorithm does not work properly in some cases
backport to Betony
2009-10-23 12:02:55 +05:00
Sergey Glukhov
424af68331 Bug#24062 Incorrect error msg after execute DROP TABLE IF EXISTS on information_schema
backport to Betony
2009-10-23 11:56:30 +05:00
Sergey Glukhov
0c7e9e3f52 Bug#5299 Remove SHOW COLUMN TYPES, backport to Betony 2009-10-23 11:20:44 +05:00
He Zhenxing
b6529a140b Add semi-sync support for Windows 2009-10-23 12:56:30 +08:00
Luis Soares
ea858f1857 post-merge fixes: mysql-5.1-rep+2-delivery1 --> mysql-5.1-rpl-merge
rpl.rpl_heartbeat_basic and rpl.rpl_cross_version set as experimental.
2009-10-22 23:46:04 +01:00
Luis Soares
58e2fde011 manual merge: mysql-5.1-rep+2-delivery1 --> mysql-5.1-rpl-merge
Conflicts
=========

Text conflict in .bzr-mysql/default.conf
Text conflict in libmysqld/CMakeLists.txt
Text conflict in libmysqld/Makefile.am
Text conflict in mysql-test/collections/default.experimental
Text conflict in mysql-test/extra/rpl_tests/rpl_row_sp006.test
Text conflict in mysql-test/suite/binlog/r/binlog_tmp_table.result
Text conflict in mysql-test/suite/rpl/r/rpl_loaddata.result
Text conflict in mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
Text conflict in mysql-test/suite/rpl/r/rpl_row_create_table.result
Text conflict in mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
Text conflict in mysql-test/suite/rpl/r/rpl_stm_log.result
Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result
Text conflict in mysql-test/t/mysqlbinlog.test
Text conflict in sql/CMakeLists.txt
Text conflict in sql/Makefile.am
Text conflict in sql/log_event_old.cc
Text conflict in sql/rpl_rli.cc
Text conflict in sql/slave.cc
Text conflict in sql/sql_binlog.cc
Text conflict in sql/sql_lex.h
21 conflicts encountered.

NOTE
====
 mysql-5.1-rpl-merge has been made a mirror of mysql-next-mr:
 - "mysql-5.1-rpl-merge$ bzr pull ../mysql-next-mr"

 This is the first cset (merge/...) committed after pulling 
 from mysql-next-mr.
2009-10-22 23:30:28 +01:00
Alexander Nozdrin
eca91c6f55 Automerge from mysql-next-mr. 2009-10-23 00:24:32 +04:00
Alexander Nozdrin
d0a10357bb Automerge from mysql-trunk. 2009-10-23 00:24:24 +04:00
Alexander Nozdrin
08ecfb9a8b Automerge from mysql-next-mr. 2009-10-23 00:20:44 +04:00
Alexander Nozdrin
cec638b590 Automerge from mysql-next-mr. 2009-10-22 22:06:01 +04:00
Alexander Nozdrin
dac879a413 Automerge from mysql-trunk. 2009-10-22 22:05:42 +04:00
Jonathan Perkin
d952721c9b Merge to mysql-next-mr-bugfixing. 2009-10-22 16:50:39 +01:00
Jonathan Perkin
1516f6d34f Apply missing patch from bug#46834 to mysql-trunk-bugfixing. 2009-10-22 16:48:52 +01:00
Bjorn Munch
23e557d48a new merge from next-mr 2009-10-22 09:36:39 +02:00
Bjorn Munch
6756d64b81 new merge from trunk 2009-10-22 09:13:44 +02:00
Alexander Nozdrin
7e30baaa71 Merge from mysql-trunk-merge. 2009-10-22 10:07:56 +04:00