Commit graph

31287 commits

Author SHA1 Message Date
unknown
caedd1992c merge 5.3->5.5 2012-09-06 00:14:33 +03:00
unknown
54bb28d4a1 MDEV-486 LP BUG#1010116 fix.
Link view/derived table fields to a real table to check turning the table record to null row.

Item_direct_view_ref wrapper now checks if table is turned to null row.
2012-09-05 23:23:58 +03:00
Sergei Golubchik
4a8938f6f5 remove the forgotten commented out piece of the old merge 2012-09-01 00:23:30 +02:00
Alexey Botchkov
589c62fefe Bug #1043845 st_distance() results are incorrect depending on variable order.
Autointersections of an object were treated as nodes, so the wrong result.

per-file comments:
  mysql-test/r/gis.result
Bug #1043845 st_distance() results are incorrect depending on variable order.
        test result updated.
  mysql-test/t/gis.test
Bug #1043845 st_distance() results are incorrect depending on variable order.
        test case added.
  sql/item.cc
        small fix to make compilers happy.
  sql/item_geofunc.cc
Bug #1043845 st_distance() results are incorrect depending on variable order.
        Skip intersection points when calculate distance.
2012-08-31 19:50:45 +05:00
Sergei Golubchik
59408093d1 5.3 merge 2012-08-31 14:15:52 +02:00
Sergei Golubchik
a1fd37b1fd MDEV-414 Depending on indexes or execution plans, a warning on incorrect or out of range values in WHERE condition is sometimes produced and sometimes not
use the same method that disables warnings in all relevant places, remove redundant function
2012-08-31 13:03:41 +02:00
Sergei Golubchik
51e14492e9 compilation warning 2012-08-31 12:01:52 +02:00
Sergei Golubchik
57694d52b4 MDEV-395 PR_SET_DUMPABLE set in unreachable code 2012-08-30 11:47:01 +02:00
unknown
10802c4d90 MDEV-381: fdatasync() does not correctly flush growing binlog file.
When we append data to the binlog file, we use fdatasync() to ensure
the data gets to disk so that crash recovery can work.

Unfortunately there seems to be a bug in ext3/ext4 on linux, so that
fdatasync() does not correctly sync all data when the size of a file
is increased. This causes crash recovery to not work correctly (it
loses transactions from the binlog).

As a work-around, use fsync() for the binlog, not fdatasync(). Since
we are increasing the file size, (correct) fdatasync() will most
likely not be faster than fsync() on any file system, and fsync()
does work correctly on ext3/ext4. This avoids the need to try to
detect if we are running on buggy ext3/ext4.
2012-08-30 10:53:49 +02:00
Sergei Golubchik
0536c506ff MDEV-437 Microseconds: In time functions precision is calculated modulo 256
store the precision in uint, not uint8
2012-08-30 09:05:27 +02:00
Sergei Golubchik
2de4f09a75 MDEV-438 Microseconds: Precision is ignored in CURRENT_TIMESTAMP(N) when it is given as a default column value
The syntax for specifying precision in the DEFAULT clause is unintentional and unsupported.
Don't allow it anymore.
2012-08-29 18:36:57 +02:00
Sergei Golubchik
3444e8e925 MDEV-454 Addition of a time interval reduces the resulting value
1. Field_newdate::get_date should refuse to return a date with zeros when
   TIME_NO_ZERO_IN_DATE is set, not when TIME_FUZZY_DATE is unset
2. Item_func_to_days and Item_date_add_interval can only work with valid dates,
   no zeros allowed.
2012-08-29 17:55:59 +02:00
Sergei Golubchik
a44331ab34 MDEV-456 An out-of-range datetime value (with a 5-digit year) can be created and cause troubles
fix Item_func_add_time::get_date() to generate valid dates.
Move the validity check inside get_date_from_daynr()
instead of relying on callers
(5 that had it, and 2 that did not, but should've)
2012-08-29 10:59:51 +02:00
unknown
95ee3fbf30 MDEV-492: fixed incorrect error check. 2012-08-29 11:35:42 +03:00
Michael Widenius
7dad536337 Split ER_NO_SUCH_TABLE into ER_NO_SUCH_TABLE and ER_NO_SUCH_TABLE_IN_ENGINE to be able to distingus if a .frm file is missing or if the table is missing in the engine.
sql/handler.cc:
  Added ER_NO_SUCH_TABLE_IN_ENGINE
sql/rpl_record.cc:
  Fixed wrong printf
sql/share/errmsg-utf8.txt:
  Added ER_NO_SUCH_TABLE_IN_ENGINE
sql/sp.cc:
  Added ER_NO_SUCH_TABLE_IN_ENGINE
sql/sp_head.cc:
  Added ER_NO_SUCH_TABLE_IN_ENGINE
sql/sql_admin.cc:
  Added ER_NO_SUCH_TABLE_IN_ENGINE
sql/sql_base.cc:
  Added ER_NO_SUCH_TABLE_IN_ENGINE
sql/sql_show.cc:
  Added ER_NO_SUCH_TABLE_IN_ENGINE
sql/table.cc:
  Fixed typo
2012-08-28 19:39:49 +03:00
Sergey Petrunya
78497dbf5a Merge 2012-08-28 15:20:37 +04:00
Sergey Petrunya
2d99ea454f MDEV-430: Server crashes in select_describe on EXPLAIN with materialization+semijoin, etc
- Don't do early cleanup of uncorrelated subqueries if we're running an EXPLAIN.
2012-08-28 15:15:05 +04:00
Sergey Petrunya
da3a1c8156 Fix bugs in BatchedKeyAccess that show up when working with a
storage engine in HA_MRR_NO_ASSOCIATION mode.
(there is no testcase because we don't ship any such engines currently)
2012-08-28 13:51:01 +04:00
Sergei Golubchik
9a64d0794c 5.3 merge 2012-08-27 18:13:17 +02:00
unknown
4d2b05b7d7 fix for MDEV-367
The problem was that was_null and null_value variables was reset in each reexecution of IN subquery, but engine rerun only for non-constant subqueries.

Fixed checking constant in Item_equal sort.
Fix constant reporting in Item_subselect.
2012-08-25 09:15:57 +03:00
unknown
b02ad35e94 Merge from 5.2 2012-08-24 19:13:34 +02:00
unknown
caea98a417 Merge from 5.1 2012-08-24 19:12:47 +02:00
unknown
f37610ecb4 Fix compiler warning 2012-08-24 19:11:54 +02:00
unknown
ced3907c02 Merge from 5.3 2012-08-24 15:29:01 +02:00
unknown
4092d08bb8 Merge into latest 5.3 2012-08-24 14:26:23 +02:00
unknown
fc666a0df6 merge from 5.2 2012-08-24 14:02:32 +02:00
unknown
caa535eb9f Merge from 5.3 2012-08-24 13:57:39 +02:00
unknown
e44a800d91 Merge from 5.2 2012-08-24 13:51:16 +02:00
unknown
89e4d23f3b Merge into latest 5.2. 2012-08-24 12:57:19 +02:00
unknown
96703a63da Merge from 5.1. 2012-08-24 12:32:46 +02:00
unknown
4997ddfa9e Merge with latest 5.1. 2012-08-24 10:34:55 +02:00
unknown
cdeabcfd43 MDEV-382: Incorrect quoting
Various places in the server replication code was incorrectly quoting
strings, which could lead to incorrect SQL on the slave/mysqlbinlog.
2012-08-24 10:06:16 +02:00
Sergei Golubchik
8d69a0feaa MDEV-472 mysql-test-run --valgrind main.ps_2myisam gives warning about not initialized memory
Item::get_date() should return 1 unless the value is a valid date.
2012-08-22 18:40:27 +02:00
Michael Widenius
653492fb23 More DBUG_ENTER, to make it easier to find out where free_root(thd->mem_root) is called 2012-08-22 18:03:31 +03:00
Sergei Golubchik
f72a765997 5.2 merge.
two tests still fail:
  main.innodb_icp and main.range_vs_index_merge_innodb
  call records_in_range() with both range ends being open
  (which triggers an assert)
2012-08-22 16:45:25 +02:00
Sergei Golubchik
1fd8150a5b 5.1 merge
increase xtradb verson from 13.0 to 13.01
2012-08-22 16:13:54 +02:00
Sergei Golubchik
cefc30b166 merge with MySQL 5.1.65 2012-08-22 11:40:39 +02:00
Sergey Petrunya
ed06ba3492 Better comments 2012-08-21 22:24:34 +04:00
unknown
80b3f74705 Fix bug mdev-447: Wrong output from the EXPLAIN command of the test case for lp bug #714999
The fix backports from MWL#182: Explain running statements the logic that
saves the original JOIN_TAB array of a query plan after optimization. This
array is later used during EXPLAIN to iterate over the original JOIN plan
nodes in the cases when this plan could be changed by early subquery
execution during the optimization phase of the outer query.
2012-08-21 15:24:43 +03:00
Michael Widenius
a45c451e40 Fix for bug lp:1039277 "Crash in sql_cache.cc".
The crash happend when combining query cache, prepared statements and using a read only cursor.

sql/sql_cache.cc:
  Fixed unlikely error when one adjust query cache size in middle of operation
sql/sql_cursor.cc:
  Disable query cache when using cursors. This fixed lp:1039277
tests/mysql_client_test.c:
  Test case for lp:1039277
2012-08-21 08:46:32 +03:00
Michael Widenius
75e8ce6d73 Ensure we don't assert with debug binaries if SHOW INNODB STATUS returns with an error.
sql/handler.cc:
  SHOW INNODB STATUS sometimes returns 0 even if it has generated an error.
  This code is here to catch it until InnoDB some day is fixed.
storage/innobase/handler/ha_innodb.cc:
  Catch at least one of the possible errors from SHOW INNODB STATUS to provide a correct return code.
storage/xtradb/handler/ha_innodb.cc:
  Catch at least one of the possible errors from SHOW INNODB STATUS to provide a correct return code.
support-files/my-huge.cnf.sh:
  Fixed typo
2012-08-20 22:54:15 +03:00
Michael Widenius
89036b9f8a Fixed compiler warnings
Fixed error in test that caused following tests to fail

extra/yassl/taocrypt/src/dsa.cpp:
  Fixed compiler warning by adding cast
mysql-test/suite/rpl/t/rpl_start_slave_deadlock_sys_vars.test:
  We have to first test for have_debug_sync to not start master wrongly
plugin/auth_pam/auth_pam.c:
  Fixed compiler warning
sql/sys_vars.h:
  Fixed compiler warning (Sys_var_max_user_conn is now signed)
support-files/compiler_warnings.supp:
  Don't give warnings for auth_pam.c (Tried to fix it by changing the code, but could not find an easy way to do that on solaris)
2012-08-17 10:01:19 +03:00
Michael Widenius
a1bc393630 Fixed MDEV-366: Assertion `share->reopen == 1' failed in maria_extra on DROP TABLE which is locked twice
mysql-test/suite/maria/lock.result:
  Added test case
mysql-test/suite/maria/lock.test:
  Added test case
sql/sql_table.cc:
  One can't call HA_EXTRA_FORCE_REOPEN on something that may be opened twice.
  It's safe to remove the call in this case as we will call HA_EXTRA_PREPARE_FOR_DROP for the table anyway.
  (One nice side effect is that drop is a bit faster as we are not flushing the cache to disk before the drop anymore)
2012-08-15 14:37:55 +03:00
Michael Widenius
fbe5ac4e24 Fixed MDEV-365 "Got assertion when doing alter table on a partition"
mysql-test/r/partition.result:
  Added test case
mysql-test/t/partition.test:
  Added test case
sql/sql_partition.cc:
  Do mysql_trans_prepare_alter_copy_data() after all original tables are locked.
  (We don't want to disable transactions for the original tables, that still may be in the cache)
sql/sql_table.cc:
  Fixed two wrong DBUG_ENTER
2012-08-15 13:33:37 +03:00
Michael Widenius
9c1cc61caf automatic merge 2012-08-15 12:07:21 +03:00
Michael Widenius
dd8bd2e4c3 Fixed compiler warnings
sql/item_subselect.cc:
  Added purecov info
sql/sql_select.cc:
  Added cast
storage/innobase/handler/ha_innodb.cc:
  Added cast
storage/xtradb/btr/btr0btr.c:
  Added buf_block_get_frame_fast() to avoid compiler warning
storage/xtradb/handler/ha_innodb.cc:
  Added cast
storage/xtradb/include/buf0buf.h:
  Innodb has buf_block_get_frame(block) defined as (block)->frame.
  Didn't want to do a big change to break xtradb as it may use block_get_frame() differently, so I mad this quick hack to patch one compiler warning.
2012-08-15 09:34:18 +03:00
Igor Babaev
fbee9f5b6e Corrected the pactch for mdev-449 to fix valgrind failures. 2012-08-14 14:25:56 -07:00
Michael Widenius
b886cac712 Fixed compiler errors
Updated test to also work on 32 bit

mysql-test/suite/heap/heap.test:
  Updated test to also work on 32 bit
2012-08-14 19:59:28 +03:00
unknown
47929af5e0 MDEV-450: Deadlock between starting a slave and reading system variables
Starting the SQL thread might deadlock with reading the values of the
replication filtering options.

The deadlock is due to a lock order violation when the variables are
read or set. For example, reading replicate_ignore_table first
acquires LOCK_global_system_variables in sys_var::value_ptr and later
acquires LOCK_active_mi in Sys_var_rpl_filter::global_value_ptr. This
violates the order established when starting a SQL thread, where
LOCK_active_mi is acquired before start_slave, and ends up creating a
thread (handle_slave_sql) that allocates a THD handle whose
constructor acquires LOCK_global_system_variables in THD::init.

The solution is to unlock LOCK_global_system_variables before the
replication filtering options are set or read. This way the lock
order is preserved and the data being read/set is still protected
given that it acquires LOCK_active_mi.
2012-08-14 12:40:40 +02:00
Igor Babaev
d07b179fd2 Fixed bug mdev-449.
The bug could caused a crash when the server executed a query with
ORDER by and sort_buffer_size was set to a small enough number.
It happened because the small sort buffer did not allow to allocate
all merge buffers in it.
Made sure that the allocated sort buffer would be big enough
to contain all possible merge buffers.
2012-08-13 21:13:14 -07:00