Commit graph

85154 commits

Author SHA1 Message Date
Sergey Petrunya
c6de45584a Merge 2014-01-24 23:44:52 +04:00
Sergey Petrunya
e1f94a6985 MDEV-5337: Wrong result in mariadb 5.5.32 with ORDER BY + LIMIT when index_condition_pushdown=on
- in test_if_skip_sort_order(), correct the condition under which
  we have the code that restores the previously pushed index condition.
2014-01-24 23:40:48 +04:00
Michael Widenius
4d83f579da Fixed Mageia Bug 12355: mariadb produces warning messages while loading timezone information
- Warnings about wrong symlink messages or non-timezone files with '.tab' are now only given if run with --verbose
- Added long option handling
- Added --help, --verbose and --version options


sql/tztime.cc:
  Add usage of my_getopt, to get long options
2014-01-24 19:44:13 +02:00
Michael Widenius
d15b3386db Fix for MDEV-5531: double call procedure in one session - hard shutdown the server
Main fix was to not cache derivied tables as they may be temporary tables that are deleted before the next query.
This was a bit tricky as Item_field::fix_fields depended on cached_tables to be set to resolve some columns.



mysql-test/r/sp-bugs.result:
  Added test case
mysql-test/t/sp-bugs.test:
  Added test case
sql/item.cc:
  Fixed fix_outer_field to handle case where found field did not have in cached_table
  Idea is that if cached_table is not avaliable, use from_field->table->pos_in_table_list instead
sql/records.cc:
  Also accept INTERNAL_TMP_TABLE for memmap
sql/sql_base.cc:
  More DBUG_PRINT
  Fixed that setup_natural_join_row_types() is not run twice.
  Original code modified context->first_name_resolution_table also for second executions.
  This was wrong as this could give wrong results if some joins had been optimized away between calls.
sql/sql_derived.cc:
  Mark derived tables as internal temporary tables (INTERNAL_TMP_TABLE), not as NON_TRANSACTIONAL_TMP_TABLE.
  This is more correct as the tables are not visible by the end user.
sql/sql_insert.cc:
  Reset pos_in_table_list before calling fix_fields.
  One of the consequences of the change of not caching all generated tables in Item_ident is that
  pos_in_table_list needs to be correct in calls to fix_fields.
sql/sql_lex.cc:
  More DBUG_PRINT
sql/sql_parse.cc:
  Don't cache derivied tables as they may be temporary tables that are deleted before the next query
sql/sql_select.cc:
  Reset table_vector. This was required as some code checked the vector to see if temporary tables had already been created.
sql/table.cc:
  Mark tables with field translations as cacheable (as these will not disapper between stmt executions.
2014-01-24 14:50:18 +02:00
Michael Widenius
7335c6f2a4 Fixed failures in tokudb test cases
storage/tokudb/mysql-test/tokudb_bugs/r/5733_innodb.result:
  Speed up test
storage/tokudb/mysql-test/tokudb_bugs/r/5733_tokudb.result:
  Speed up test
  Fix results
storage/tokudb/mysql-test/tokudb_bugs/r/xa-6.result:
  Ensure that mysql.proc is properly closed
storage/tokudb/mysql-test/tokudb_bugs/t/5733_innodb.test:
  Speed up test
storage/tokudb/mysql-test/tokudb_bugs/t/5733_tokudb.test:
  Speed up test
  Accept both index and range scan for one query
storage/tokudb/mysql-test/tokudb_bugs/t/xa-6.test:
  Ensure that mysql.proc is properly closed
2014-01-24 14:30:19 +02:00
Alexey Botchkov
5a7ae59305 MDEV-5419 no audit events for warnings converted to errors in the strict mode.
small fix in the --replace_regex template.
2014-01-24 06:07:22 +04:00
Alexey Botchkov
8f3e1bfc92 MDEV-5419 no audit events for warnings converted to errors in the strict mode.
Plugins get error notifications only when my_message_sql() is called.
        But errors are launched with THD::raise_condition() calls in other
        places. These are push_warning(), implementations of SIGNAL and
        RESIGNAL commands.
        So it makes sence to notify plugins there in THD::raise_condition().
2014-01-23 22:21:02 +04:00
Sergey Petrunya
eb88c905e6 Merge 2014-01-23 21:12:37 +04:00
Sergey Petrunya
f0fa66a26d MDEV-5368: Server crashes in Item_in_subselect::optimize on ...
- convert_subq_to_sj() must connect child select's tables into 
  parent select's TABLE_LIST::next_local chain.  
- The problem was that it took child's leaf_tables.head() which
  is different. This could cause certain tables (in this bug's case,
  child select's non-merged semi-join) not to be present in 
  TABLE_LIST::next_local chain.  Which would cause non-merged semi-join
  not to be initialized in setup_tables(), which would lead to 
  NULL pointer dereference.
2014-01-23 15:41:51 +04:00
Sergei Golubchik
2ff76f6750 MDEV-5406 add index to an innodb table with a uniqueness violation crashes mysqld
After table->file->add_index() in mysql_alter_table() the table in the engine
has the intermediate temporary structure, it's neither the original nor the
final table structure (it'll be final after successful table->file->drop_index()
call). So, when add_index() fails with a unique key violation, we cannot simply
get the failed key number and easily map it to the key name and key structure via
table->key_info[key_no].

For now we'll create this "intermediate temporary structure", emulating InnoDB
internal rules.

This bug and the fix will go away in 10.0 that uses completely different online
alter table code.

mysql-test/t/alter_table_trans.test:
  mdev:5406
2014-01-23 11:04:59 +01:00
Sergei Golubchik
0cdf1573b6 MDEV-5421 Assertion `! is_set()' fails on INSERT IGNORE when a table has no partition for a value
make print_no_partition_found() to respect MYF(errflag)

mysql-test/suite/parts/t/insert_ignore-5421.test:
  mdev:5421
2014-01-23 00:03:05 +01:00
Sergei Golubchik
8d2fba9331 MDEV-5550 Invalid cmake variable in mysql-test/CMakeLists.txt 2014-01-23 00:02:52 +01:00
Sergei Golubchik
4fadce7ec6 Change our INSTALL_DEBUG_SYMBOLS cmake function to be less picky
and support MySQL CMakeLists.txt files
2014-01-23 00:02:37 +01:00
Sergei Golubchik
b85ab1d464 update debian patches to match the current code state 2014-01-23 00:02:22 +01:00
Sergei Golubchik
3b5f66dbf9 fix XtraDB to compile on Windows 2014-01-23 00:02:08 +01:00
Sergei Golubchik
c7a5314cb2 update test results, broken by MDEV-5547 fix 2014-01-22 23:59:21 +01:00
Sergei Golubchik
ec34edd9c3 Percona-Server-5.5.35-rel33.0.tar.gz 2014-01-22 15:35:42 +01:00
Sergei Golubchik
37d240ecf9 MySQL-5.5.35 merge 2014-01-22 15:29:36 +01:00
Sergei Golubchik
15b4441dcb Percona-Server-5.5.35-rel33.0.tar.gz 2014-01-22 10:03:32 +01:00
Sergei Golubchik
e8f6f40292 clarify plugin-load usage in tokudb.cnf file 2014-01-21 17:20:51 +01:00
Sergei Golubchik
e3d9076910 remove an unused error message 2014-01-21 17:20:44 +01:00
Michael Widenius
04bee0af2e Fix for MDEV-5547: Bad error message when moving very old .frm files to MariaDB 5.5.
mysql_upgrade --help now also prints out --default options and variable values.
mysql_upgrade now prints permission errors.
mysql_upgrade doesn't print some non essential info if --silent is used.
Added handler error message about incompatible versions
Fixed that mysqlbug and mysql_install_db have the executable flag set.
Removed executable flag for some non executable files.
Changed in mysql_install_db askmonty.org to mariadb.com.
Ensured that all client executables prints --default options the same way.
Allow REPAIR ... USE_FRM for old .frm files if the are still compatible.
Extended shown error for storage engine messages.


client/mysql.cc:
  print_defaults() should be first (as in all other programs)
client/mysql_upgrade.c:
  --help now also prints out --default options and variable values
  Print out error if wrong permissions
  Don't print info if --silent
client/mysqladmin.cc:
  print_defaults() should be first (as in all other programs)
client/mysqlbinlog.cc:
  Added print_defaults() to --help
client/mysqlcheck.c:
  Added empty line in --help
client/mysqlimport.c:
  Added empty line in --help
client/mysqlshow.c:
  Made --help compatible
client/mysqlslap.c:
  Made --help compatible
client/mysqltest.cc:
  Added print_defaults() to --help
include/handler_ername.h:
  Added handler error message
include/my_base.h:
  Added handler error message
mysql-test/r/mysql_upgrade.result:
  Updated results
mysql-test/r/repair.result:
  Added test case for better error messages
mysql-test/std_data/host_old.MYD:
  Added test case for better error messages
mysql-test/std_data/host_old.MYI:
  Added test case for better error messages
mysql-test/std_data/host_old.frm:
  Added test case for better error messages
mysql-test/t/repair.test:
  Added test case for better error messages
mysys/my_handler_errors.h:
  Added handler error message
scripts/CMakeLists.txt:
  Fixed that mysqlbug and mysql_install_db have the executable flag set
scripts/mysql_install_db.sh:
  askmonty.org -> mariadb.com
sql/ha_partition.cc:
  Sometimes table_type() can be called for errors even if partition didn't manage to open any files
sql/handler.cc:
  Write clear text for not handled, but defined error messages.
sql/share/errmsg-utf8.txt:
  Extended shown error for storage engine messages
sql/sql_admin.cc:
  Allow REPAIR ... USE_FRM for old .frm files if the are still compatible
storage/myisam/ha_myisam.cc:
  Use new error message
2014-01-22 15:16:57 +02:00
Sergey Petrunya
5e02635eb8 MDEV-4974: memory leak in 5.5.32-MariaDB-1~wheezy-log
- When a JOIN has both "optimization tabs" (JOIN_TABs used to 
  read the base tables and do the join operation) and also
  has "execution tabs" (a JOIN_TAB that is to produce result set 
  that is sent to the client), do not forget to call JOIN_TAB::cleanup()
  for the execution JOIN_TAB.
2014-01-21 17:27:36 +04:00
unknown
b0aaf5c6f5 Merge 5.3->5.5 2014-01-15 16:07:50 +02:00
unknown
3aa370bb69 MDEV-5515: 2nd execution of a prepared statement returns wrong results
update_used_tables() should be called after handling derived tables in any case.
2014-01-13 21:30:42 +02:00
Michael Widenius
4e9a2d5469 Don't writing entries to slave log about binlog_checksum not existing on master if log_warnings is <=1.
This solves the issue of getting a lot of unnecessary errors logged on the slave when connecting to MySQL or an old MariaDB version.


sql/slave.cc:
  Don't write that binlog_checksum doesn't exists on the master if log_warnings <= 1
2014-01-05 15:21:58 +02:00
Michael Widenius
c050b5fdf9 Fixed MDEV-5424: SELECT using ORDER BY DESC and LIMIT produces unexpected results (InnoDB/XtraDB)
This only happend when using an ORDER BY on a primary key part, where all other key parts where constant.
Remove of duplicated expressions in ORDER BY (as the old code did this in some strange cases)


mysql-test/r/group_by.result:
  Fixed results to take into account that duplicate order by parts are now deleted
mysql-test/r/group_by_innodb.result:
  Ensure extended keys are on
mysql-test/r/innodb_ext_key.result:
  More tests
mysql-test/r/order_by.result:
  More tests
mysql-test/t/group_by.test:
  Fixed results to take into account that duplicate order by parts are now deleted
mysql-test/t/group_by_innodb.test:
  Ensure extended keys are on
mysql-test/t/innodb_ext_key.test:
  More tests
mysql-test/t/order_by.test:
  More tests
sql/sql_select.cc:
  Fixed bug where we looked at extended key parts when we shouldn't
  Remove of duplicated expressions in ORDER BY
sql/table.cc:
  Indentation fixes
2014-01-02 15:51:02 +02:00
Sergey Petrunya
f8c7e3477f MDEV-5349: Test main.subselect_sj_jcl6 fails sporadically due to insufficient ordering
- Add --sorted_result to the query
2013-12-30 20:30:29 +04:00
unknown
57400ee681 MDEV-5414: RAND() in a subselect : different behavior in MariaDB and MySQL
Materialization forced in case if rand() used in view or derived table to avoud several calls of rand for gting value of a field.

Fixed set variable uncachable flag from - it shouldbe a side effect not a random value.
2013-12-18 15:59:51 +02:00
Sergei Golubchik
50808b30d2 MDEV-5396 Assertion `Handlerton: r==0 ' failed (errno=0) on EXPLAIN with TokuDB tables
Fix EXPLAIN and CREATE SELECT to join_free() (and, thus, ha_index_end())
before ha_commit_trans().
2013-12-17 17:26:54 +01:00
Alexander Barkov
dc407270a1 MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP
Fixed a wrong assertion.
2013-12-17 15:19:26 +04:00
Sergei Golubchik
39a8d7965d don't run tokudb tests for --embedded by default 2013-12-15 15:55:15 +01:00
Sergei Golubchik
47b615d84b Fix tokudb.hotindex-insert-bigchar failure in buildbot.
This test needs at least 320M for tokudb-max-lock-memory.
Normally tokudb-max-lock-memory is auto-sized to be 1/16th
of the available RAM size, and many our test VMs have 4G of RAM.
2013-12-15 11:31:57 +01:00
Sergei Golubchik
e68bccc743 5.3 merge 2013-12-13 13:00:38 +01:00
Igor Babaev
3ec4296ec4 Fixed bug mdev-5410.
The fix for bug #27937 was incomplete: it did not handle correctly the queries
containing UNION with global ORDER BY in subselects.
2013-12-12 13:55:33 -08:00
Sergei Golubchik
ca083a764f my_addr_resolve: don't resolve unknown addresses to ??:0(??), but return an error instead
(better to have an address in the output than ??:0)
2013-12-12 18:14:14 +01:00
Sergei Golubchik
c47dd98f90 backport from 10.0: "bugfix: MYSQL_THDVAR_STR plugins with PLUGIN_VAR_MEMALLOC didn't work
(PLUGIN_VAR_MEMALLOC is 0x8000 and cannot be saved in a char as such)"
2013-12-12 18:14:08 +01:00
Sergei Golubchik
5313e00199 fix tokudb tests that fail in --ps-protocol
https://github.com/Tokutek/ft-engine/issues/153
2013-12-12 14:58:44 +01:00
Sergei Golubchik
976e242c78 update tokudb version. mask tests that are broken there. 2013-12-12 11:42:00 +01:00
Igor Babaev
fde2777b27 Another attempt to fix the memory leak of mdev-5400. 2013-12-11 10:13:08 -08:00
Sergei Golubchik
70f6ac10b3 MDEV-5323 Ctrl-C not working under Ubuntu
don't reset interrupted_query after sending the KILL signal, otherwise
the client won't know it has to stop fetching and printing the data.
2013-12-11 17:42:33 +01:00
Igor Babaev
d5262a63fc Fixed bug mdev-5400:
a memory leak in save_index() first seen in the test case for mdev-5382.
2013-12-07 07:51:02 -08:00
Sergei Golubchik
fe38576064 install embedded_priv.h in ${INSTALL_INCLUDEDIR}/private 2013-12-06 15:29:25 +01:00
Igor Babaev
21d0d8c5bf Merge 2013-12-05 12:40:04 -08:00
Igor Babaev
ccf5871d7b Fixed bug mdev-5382
When marking used columns the function find_field_in_table_ref() erroneously
called the walk method for the real item behind a view/derived table field
with the second parameter set to TRUE.
This erroneous code was introduced in 2006.
2013-12-05 11:13:20 -08:00
unknown
b78f721460 MDEV-5353: server crash on subselect if WHERE applied to some result field
Correct processing of view/derived with no tables added.
2013-12-04 16:54:33 +02:00
Alexander Barkov
62e959437e MDEV-5374 main.func_time fails with valgrind warning
"Conditional jump or move depends on uninitialised"
in Item_time_typecast::get_date.

Adding "null_value" into the debug assert condition.
2013-12-03 15:08:43 +04:00
Sergei Golubchik
a3b99778fc 5.2 merge 2013-12-02 12:32:43 +01:00
Alexander Barkov
b97b9536c7 MDEV-4857 Wrong result of HOUR('1 00:00:00')
modified:
  mysql-test/r/func_time.result
  mysql-test/t/func_time.test
  sql-common/my_time.c
  sql/item_func.h
  sql/item_timefunc.cc
  sql/mysql_priv.h
  sql/time.cc
2013-12-02 15:09:34 +04:00
Sergei Golubchik
7e431dc379 5.1 merge 2013-12-01 20:12:19 +01:00