Commit graph

32997 commits

Author SHA1 Message Date
Sergei Golubchik
517b1f4fb4 cleanups:
* comments from WL#5602 in sql_acl.cc
* rename global memroots in sql_acl.cc
* remove the second empty lex string constant
2013-12-09 12:38:30 +01:00
Sergei Golubchik
93b1555939 bugfix: incorrect buffer sizes for net_store_length() 2013-12-09 12:38:20 +01:00
Sergei Golubchik
e252af7b7e reuse new safe_net_field_length_ll function where appropriate 2013-12-09 12:38:09 +01:00
Sergei Golubchik
bec1d903d9 Do the partial merge of WL#5602 correctly:
Remove unused code (that should not have been merged)
  Add protocol extension (that should have been merged)
  Fix bugs (see pack.c)
2013-12-09 12:38:02 +01:00
Sergei Golubchik
6ae5f0efea MDEV-5115 RBR from MySQL 5.6 to MariaDB 10.0 does not work
Patially merge WL#5917, to understand v2 row events
2013-12-09 12:37:45 +01:00
Sergei Golubchik
5290811c5c MDEV-5367 Server crashes in acl_authenticate on concurrent thread connection, FLUSH PRIVILEGES
fix a copy-paste error, introduced in role refactoring
2013-12-01 12:16:24 +01:00
Sergei Golubchik
ab3604989c MDEV-4243 [PATCH] Warnings/errors while compiling with clang
fix the code to compile with clang. fix warnings too.

include/probes_mysql_nodtrace.h:
  clang++ doesn't like numeric _constants_ being used in ||
  (it suspects that the intention was | ). Boolean constants are ok.
sql/hostname.cc:
  only used in DBUG_ASSERT
sql/item.cc:
  str_to_time and str_to_datetime return bool, not MYSQL_TIMESTAMP_xxx
sql/item_func.cc:
  str_to_datetime_with_warn() returns bool, not MYSQL_TIMESTAMP_xxx
storage/cassandra/CMakeLists.txt:
  CMAKE_CXX_FLAGS can be empty
storage/connect/odbconn.cpp:
  HWND is void*
storage/connect/user_connect.h:
  deprecated on FreeBSD and unused anyway
storage/connect/value.cpp:
  bad characters inside. unused.
storage/spider/spd_trx.cc:
  clang++ warns that memset will also overwrite vtbl. it might be as well a good idea,
  as it asserts that the object will only be used as a storage.
  silence the warning.
2013-11-28 22:35:59 +01:00
Sergei Golubchik
38c91c067b MDEV-4955 discover of table non-existance on CREATE
when frm file exists, but the table does not.

In recover_from_failed_open(), allow the discovery
to fail without an error, when
open_strategy == TABLE_LIST::OPEN_IF_EXISTS.
2013-11-28 16:39:17 +01:00
Sergei Golubchik
1387e71531 MDEV-5281 Partitioning issue after upgrade from 10.0.3-1 to 10.0.5-1
merged from 5.6:
Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING
Bug#16589511: MYSQL_UPGRADE FAILS TO WRITE OUT ENTIRE ALTER TABLE ... ALGORITHM= ... STATEMENT
Bug#16274455: CAN NOT ACESS PARTITIONED TABLES WHEN DOWNGRADED FROM 5.6.11 TO 5.6.10

plus minor changes from 5.6, mainly comments
2013-11-28 12:10:44 +01:00
Sergei Golubchik
44db9c41b3 typo fix in ha_partition::rnd_pos(), status wasn't updated 2013-11-27 22:30:59 +01:00
Sergei Golubchik
e29c74c201 Fix a first timestamp column in the sql-based table discovery 2013-11-25 15:46:33 +01:00
Sergei Golubchik
f5ba8397e2 unreserve GET keyword 2013-11-21 14:25:28 +01:00
Alexander Barkov
1345a75922 MroongaSE: addint thd_autoinc and thd_error_context plugin services 2013-12-12 19:18:49 +04:00
Alexander Barkov
03f6778d61 MDEV-5298 Illegal mix of collations on timestamp
Fixed.
2013-12-10 13:34:59 +04:00
Alexander Barkov
1f4f425a20 MDEV-5297 TIME(0), TIMESTAMP(0) and DATETIME(0) are self-incompatible during replication (upstream)
Fixed.
2013-12-06 19:02:55 +04:00
Sergey Vojtovich
e5a80a307c MDEV-5277 - Ensure that all MySQL 5.6 options are supported by the
MariaDB 10.0 server
2013-11-25 18:49:40 +04:00
Sergey Vojtovich
1da6d6880b MDEV-5220 - [PATCH] MariaDB 10.0.4 doesn't compile without perfschema
Fixed the following compilation errors and test failures:
- maria SE: "stage_waiting_for_a_resource" wasn't declared w/o PFS
- sql_repl.h: PSI_mutex_key is not available in non-PFS builds
- mysqld.cc: pfs_param is not available in non-PFS builds
- mysqld.cc: init_show_explain_psi_keys() is not available in non-PFS builds
- mysqld.cc: call net_before_header_psi, net_after_header_psi even if PFS
  is not available so that thread enters stage_init at proper time. Fixes
  sp-threads and a few tests in funcs_1.
- myisam_file_io.opt: added missing loose prefix
2013-11-14 18:00:00 +04:00
Alexey Botchkov
b69ed7d621 MDEV-4437 ALTER TABLE .. ADD UNIQUE INDEX IF NOT EXISTS causes syntax error.
Added the IF NOT EXISTS option to the CONSTRAINT keyword.
2013-11-14 14:31:30 +04:00
Sergei Golubchik
4157185f24 10.0-base merge 2013-11-13 23:03:48 +01:00
Sergei Golubchik
bdd883ed9a 5.5. merge 2013-11-13 14:07:58 +01:00
Sergei Golubchik
f3a78f392d 5.3 merge 2013-11-13 13:38:37 +01:00
Sergei Golubchik
b468cd4749 MDEV-5284 Assertion `!(*expr)->fixed' fails in replace_where_subcondition with IN suquery 2013-11-13 12:43:39 +01:00
Sergey Petrunya
86b8ed3eab Merge 2013-11-13 08:29:12 +04:00
Sergey Petrunya
229aa1d4bf MDEV-5056: Wrong result (extra rows) with materialization+semijoin, IN subqueries
Apply fix suggested by Igor:
- When eliminate_item_equal() generates pair-wise equalities from a 
  multi-equality,  do generate a "bridge" equality between the first 
  field inside SJM nest and the field that's first in the overall multi-equality.
2013-11-13 07:40:46 +04:00
Sergei Golubchik
441192bfb0 MDEV-5113 Wrong result (extra row) and valgrind warnings in Item_maxmin_subselect::any_value on 2nd execution of PS with SELECT subquery
When setting Item_func_not_all::test_sum_item or Item_func_not_all::test_sub_item,
reset the other one to NULL - they can never be set both. When a PS is reexecuted,
different executions might be optimized differently and a wrong test_su*_item
might stay set from the previous execution.
2013-11-12 15:02:25 +01:00
Sergey Petrunya
88bf8b9c8f MDEV-5257: MIN/MAX Optimization (Select tables optimized away) does not work for DateTime
- MIN/MAX optimizer does a check whether a "field CMP const" comparison uses a constant 
  that's longer than the field it is compared to.  Make this check only for string columns,
  also compare character lengths, not byte lengths.
2013-11-12 17:37:32 +04:00
Sergey Petrunya
2cba9e0cdc MDEV-407: Print EXPLAIN [ANALYZE] in the slow query log
- Address input from the mail list: change how EXPLAIN is 
  formatted in the slow query log.
2013-11-12 17:13:11 +04:00
Igor Babaev
e0d9a25690 Fixed bug mdev-5160.
The used_tables attribute must be recalculated for the HAVING condition
if the condition is applied to the rows read from a temporary table.
2013-11-11 22:21:39 -08:00
unknown
55de9b0468 merge 10-base->10.0 2013-11-11 23:40:53 +02:00
unknown
3a75900b91 merge 5.5->10.0-base 2013-11-11 22:47:04 +02:00
Alexander Barkov
383de0fd1f Merge 10.0-monty -> 10.0 2013-11-11 22:46:14 +04:00
unknown
dfed447888 merge 5.3->5.5 2013-11-11 20:38:04 +02:00
Sergei Golubchik
1585652862 MDEV-5236 Status variables are not all listed alphabetically
sort Com_ counters. No simple fix for Binlog_ variables.
2013-11-11 17:20:18 +01:00
Alexey Botchkov
06a91b18d7 MDEV-4436 CHANGE COLUMN IF EXISTS does not work and throws wrong warning.
Use sql_field->change parameter as the name of the field.
2013-11-11 19:45:55 +04:00
unknown
c98a054fde MDEV-5153: Server crashes in Item_ref::fix_fields on 2nd execution of PS with LEFT JOIN and MERGE view or SELECT SQ
1. Transformation of row IN subquery made the same as single value.
2. replace_where_subcondition() made working on several layers of OR/AND because it called on expression before fix_fields().
2013-11-11 17:28:14 +02:00
Sergei Golubchik
f486f49e8d MDEV-4824 userstats - wrong user statistics
(and valgrind warnings)

* move thd userstat initialization to the same function
  that was adding thd userstat to global counters.
* initialize thd->start_bytes_received in THD::init
  (when thd->userstat_running is set)
2013-11-11 16:17:32 +01:00
unknown
c85db2c494 MDEV-5103: server crashed on singular Item_equal
Singular Item_equal support added.

The problem was that during constant table substitution Item_equal become containing only one constant which was not supported internally.
2013-11-11 16:40:46 +02:00
Alexey Botchkov
3cf7e283a6 MDEV-4435 Server crashes in my_strcasecmp_utf8 on ADD KEY IF NOT EXISTS with implicit name when the key exists.
Use field name as a key name if the key name wasn't specified.
2013-11-11 18:23:53 +04:00
Alexander Barkov
f76beb080c MDEV-5241: Collation incompatibilities with MySQL-5.6
A clean-up: removing the code catching collation incompatibilities
from handler::check_collation_compatibility(), as the collation IDs
are already replaced at this point by TABLE_SHARE::init_from_binary_frm_image.
2013-11-11 16:21:31 +04:00
Sergei Golubchik
feea10a453 MDEV-5101 INFORMATION_SCHEMA.PROCESSLIST reports an incorrect value for Time for connecting threads
by convention query execution time should be 0 if its start_time is 0
(this was lost when fixing MDEV-4578)
2013-11-11 09:31:17 +01:00
Sergei Golubchik
e10d42d93b MDEV-5022 Strange message or wrong errno on mismatching versions of plugin and server
1. use an appropriate errno code
2. put a comma between the errno and the error message text
2013-11-11 09:31:09 +01:00
Sergei Golubchik
5ffa6904d2 MDEV-4880 Attempt to create a table without columns produces ER_ILLEGAL_HA instead of ER_TABLE_MUST_HAVE_COLUMNS 2013-11-10 17:51:20 +01:00
Sergei Golubchik
1c6394e503 MDEV-4931 Can't use SHUTDOWN in stored programs
keywords that a statement could start from can only be
in the 'keyword' list, never in the 'keyword_sp'
2013-11-10 17:51:06 +01:00
Sergei Golubchik
5e2b5510a4 MDEV-5260 discovery with sql is too restrictive
allow ENGINE=FOOBAR in the discovering create table statement,
as long as the discovering engine is FOOBAR too
2013-11-10 17:51:01 +01:00
Sergei Golubchik
09b63917be MDEV-5238 Server crashes in find_role_grant_pair on SHOW GRANTS for an anonymous user 2013-11-10 17:50:52 +01:00
Michael Widenius
192678e7bf MDEV-5241: Collation incompatibilities with MySQL-5.6
- Character set code & tests from Alexander Barkov
- Integration with ALTER TABLE, REPAIR and open_table from Monty

The problem was that MySQL 5.6 added some croatian and vitanamese character set collations that are incompatible with MariaDB.

The fix is to move the MariaDB conflicting collation numbers out of the region that MySQL is likely to use.
mysql_upgrade, REPAIR TABLE or ALTER TABLE will fix the collations.
If one tries to access and old incompatible table, one will get the error "Table upgrade required...."
After this patch, MariaDB supports all the MySQL character set collations and the old MariaDB croatian collations, which are closer to the latest standard than the MySQL versions.

New character sets:
ucs2_croatian_mysql561_uca_ci
utf8_croatian_mysql561_uca_ci
utf16_croatian_mysql561_uca_ci
utf32_croatian_mysql561_uca_ci
utf8mb4_croatian_mysql561_uca_ci

Other things:
- Fixed some compiler warnings
- mysql_upgrade prints information about repaired tables.
- Increased version number

VERSION:
  Increased VERSION number
client/mysqlcheck.c:
  Print repaired table name when using --verbose
include/m_ctype.h:
  Add new MariaDB collation regions that are not likely to conflict with MySQL
include/my_base.h:
  Added flag to detect if table was opened for ALTER TABLE
mysql-test/r/ctype_ldml.result:
  Updated result
mysql-test/r/ctype_uca.result:
  Updated result
mysql-test/r/ctype_upgrade.result:
  Updated result
mysql-test/r/ctype_utf16_uca.result:
  Updated result
mysql-test/r/ctype_utf32_uca.result:
  Updated result
mysql-test/r/ctype_utf8mb4_uca.result:
  Updated result
mysql-test/std_data/ctype_upgrade:
  Test files for testing upgrading of conflicting collations
mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result:
  New collations added
mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result:
  New collations added
mysql-test/suite/innodb/r/innodb_ctype_ldml.result:
  Updated test result
mysql-test/suite/innodb/t/innodb_ctype_ldml.test:
  Updated test result
mysql-test/suite/plugins/r/show_all_plugins.result:
  Updated version number
mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result:
  Updated version number
mysql-test/t/ctype_ldml.test:
  Updated test
mysql-test/t/ctype_uca.test:
  Testing of new collations
mysql-test/t/ctype_upgrade.test:
  Testing of upgrading tables with old collations
  The test ensures that:
  - We will get an error if we try to open a table with old collations.
  - CHECK TABLE will detect that the table needs to be upgraded.
  - ALTER TABLE and REPAIR will fix the table.
  - mysql_upgrade works as expected
mysql-test/t/ctype_utf16_uca.test:
  Testing of new collations
mysql-test/t/ctype_utf32_uca.test:
  Testing of new collations
mysql-test/t/ctype_utf8mb4_uca.test:
  Testing of new collations
mysys/charset-def.c:
  Added new character sets
mysys/charset.c:
  Always give an error, if requested, if a character set didn't exist
sql/handler.cc:
  - Added upgrade_collation() to check if collation is compatible with old version
  - check_collation_compatibility() checks if we are using an old collation from MariaDB 5.5 or MySQL 5.6
  - ha_check_for_upgrade() returns HA_ADMIN_NEEDS_ALTER if we have an incompatible collation
sql/handler.h:
  Added new prototypes
sql/sql_table.cc:
  - Mark that tables are opened for ALTER TABLE
  - If table needs to be upgraded, ensure we are not using online alter table.
sql/table.cc:
  - If we are using an old incompatible collation, change to use the new one and mark table as incompatible.
  - Give an error if we try to open an incompatible table.
sql/table.h:
  Added error that table needs to be rebuild
storage/connect/ha_connect.cc:
  Fixed compiler warning
strings/ctype-uca.c:
  New character sets
2013-11-09 00:20:07 +02:00
Alexander Barkov
8f0be1ad7c Merge 5.5 -> 10.0-base 2013-11-09 00:16:42 +04:00
Alexander Barkov
ef43b71fd2 Merge 5.3 -> 5.5 2013-11-08 23:14:26 +04:00
Alexander Barkov
542ce5a068 Merge 5.2 -> 5.3 2013-11-08 22:50:01 +04:00
Alexander Barkov
d5cd8cd724 Merge 5.1 -> 5.2 2013-11-08 22:22:25 +04:00