Commit graph

68861 commits

Author SHA1 Message Date
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
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
e988c4dde6 MDEV-336 oqgraph 5.5 crashes in buildbot
force -fno-strict-aliasing for oqgraph
2012-08-24 23:43:18 +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
f090677383 Merge from 5.2. 2012-08-24 15:39:34 +02:00
unknown
c64afe8d94 Merge from 5.1. 2012-08-24 15:37:39 +02:00
unknown
077e453f9f Fix compiler warnings 2012-08-24 15:32:44 +02:00
Vladislav Vaintroub
f024e0d5e9 MDEV-484 : allow compilation/packaging on Windows with newly released VS2012 2012-08-24 15:30:05 +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
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
4201939d57 remove mysql-5.1 assert that is already absent in mysql-5.5 2012-08-23 13:52:36 +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
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
115a296756 merge with XtraDB as of Percona-Server-5.1.63-rel13.4 2012-08-22 16:10:31 +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
Igor Babaev
fbee9f5b6e Corrected the pactch for mdev-449 to fix valgrind failures. 2012-08-14 14:25:56 -07: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
Elena Stepanova
4f3674c8c0 MDEV-369 (Mismatches in MySQL engines test suite)
Following reasons caused mismatches:
  - different handling of invalid values;
  - different CAST results with fractional seconds;
  - microseconds support in MariaDB;
  - different algorithm of comparing temporal values;
  - differences in error and warning texts and codes;
  - different approach to truncating datetime values to time;
  - additional collations;
  - different record order for queries without ORDER BY;
  - MySQL bug#66034.
More details in MDEV-369 comments.
2012-08-02 00:58:13 +04:00
Elena Stepanova
d1a90e852b MDEV-369 (Mismatches in MySQL engines test suite)
Following reasons caused mismatches:
  - different handling of invalid values;
  - different CAST results with fractional seconds;
  - microseconds support in MariaDB;
  - different algorithm of comparing temporal values;
  - differences in error and warning texts and codes;
  - different approach to truncating datetime values to time;
  - additional collations;
  - different record order for queries without ORDER BY;
  - MySQL bug#66034.
More details in MDEV-369 comments.
2012-07-30 04:16:49 +04:00
Elena Stepanova
3ca3b44dbb Result files were wrong due to MySQL bug#66034 2012-07-26 23:31:08 +04:00
Sergey Petrunya
7e6bec87c1 MDEV-398: Sergv related to spacial queries
- index_merge/intersection is unable to work on GIS indexes, because:
  1. index scans have no Rowid-Ordered-Retrieval property
  2. When one does an index-only read over a GIS index, they do not 
     get the index tuple, because index only contains bounding box of the geometry.
     This is why key_copy() call crashed.
This patch fixes #1, which makes the problem go away. Theoretically, it would 
be nice to check #2, too, but SE API semantics is not sufficiently precise to do it.
2012-07-18 15:03:05 +04:00
Bjorn Munch
1713550775 Merge unpushed changes from 5.1.64-release 2012-07-12 10:00:14 +02:00
unknown
dfa0093096 2012-07-10 18:55:07 +05:30
Andrei Elkin
cd0912a4ca merge from 5.1 repo. 2012-07-10 13:51:50 +03:00
Andrei Elkin
eca29d5f33 merge from 5.1 repo. 2012-07-10 13:00:03 +03:00
Bjorn Munch
8647617947 mysql_client_fw.c was not included in make dist 2012-07-10 11:57:24 +02:00
Andrei Elkin
5be435dee3 merge from 5.1 repo. 2012-07-10 12:48:23 +03:00
Sujatha Sivakumar
13f7f00288 BUG#11762670:MY_B_WRITE RETURN VALUE IGNORED
Problem:
=======
The return value from my_b_write is ignored by: `my_b_write_quoted',
`my_b_write_bit',`Query_log_event::print_query_header'

Most callers of `my_b_printf' ignore the return value. `log_event.cc' 
has many calls to it. 

Analysis:
========
`my_b_write' is used to write data into a file. If the write fails it
sets appropriate error number and error message through my_error()
function call and sets the IO_CACHE::error == -1.
`my_b_printf' function is also used to write data into a file, it
internally invokes my_b_write to do the write operation. Upon
success it returns number of characters written to file and on error
it returns -1 and sets the error through my_error() and also sets
IO_CACHE::error == -1.  Most of the event specific print functions
for example `Create_file_log_event::print', `Execute_load_log_event::print'
etc are the ones which make several calls to the above two functions and
they do not check for the return value after the 'print' call. All the above 
mentioned abuse cases deal with the client side.

Fix:
===
As part of bug fix a check for IO_CACHE::error == -1 has been added at 
a very high level after the call to the 'print' function.  There are 
few more places where the return value of "my_b_write" is ignored
those are mentioned below.

+++ mysys/mf_iocache2.c    2012-06-04 07:03:15 +0000
@@ -430,7 +430,8 @@
           memset(buffz, '0', minimum_width - length2);
         else
           memset(buffz, ' ', minimum_width - length2);
-        my_b_write(info, buffz, minimum_width - length2);

+++ sql/log.cc	2012-06-08 09:04:46 +0000
@@ -2388,7 +2388,12 @@
     {
       end= strxmov(buff, "# administrator command: ", NullS);
       buff_len= (ulong) (end - buff);
-      my_b_write(&log_file, (uchar*) buff, buff_len);

At these places appropriate return value handlers have been added.

client/mysqlbinlog.cc:
  check for IO_CACHE::error == -1 has been added after the call to
  the event specific print functions
mysys/mf_iocache2.c:
  Added handler to check the written value of `my_b_write'
sql/log.cc:
  Added handler to check the written value of `my_b_write'
sql/log_event.cc:
  Added error simulation statements in `Create_file_log_event::print`
  and `Execute_load_query_log_event::print'
sql/rpl_utility.h:
  Removed the extra ';'
2012-07-10 14:23:17 +05:30
Bjorn Munch
b21319483f mysql_client_test did not build within limbysqld/examples 2012-07-10 10:04:57 +02:00
Bjorn Munch
aacb690bd5 Fixed compile error in mysql_client_test using gcc 2012-07-09 16:36:50 +02:00
Bjorn Munch
a1425b1032 Refactor mysql_client_test.c into a framework part and a test part 2012-07-09 15:10:07 +02:00
Andrei Elkin
e3c8fb4a1c Bug#14275000
Fixes for BUG11761686 left a flaw that managed to slip away from testing.
Only effective filtering branch was actually tested with a regression test
added to rpl_filter_tables_not_exist.
The reason of the failure is destuction of too early mem-root-allocated memory 
at the end of the deferred User-var's do_apply_event().

Fixed with bypassing free_root() in the deferred execution branch.
Deallocation of created in do_apply_event() items is done by the base code
through THD::cleanup_after_query() -> free_items() that the parent Query
can't miss.



sql/log_event.cc:
  Do not call free_root() in case the deferred User-var event.
  Necessary methods to the User-var class are added, do_apply_event() refined.
sql/log_event.h:
  Necessary methods to avoid destoying mem-root-based memory at
  User-var applying are defined.
2012-07-05 14:37:48 +03:00
Georgi Kodinov
048577429f Bug #13889741: HANDLE_FATAL_SIGNAL IN _DB_ENTER_ |
HANDLE_FATAL_SIGNAL IN STRNLEN

Fixed the following bounds checking problems :
1. in check_if_legal_filename() make sure the null terminated
string is long enough before accessing the bytes in it.
Prevents pottential read-past-buffer-end
2. in my_wc_mb_filename() of the filename charset check
for the end of the destination buffer before sending single
byte characters into it.
Prevents write-past-end-of-buffer (and garbaling stack in
the cases reported here) errors.

Added test cases.
2012-07-05 13:41:16 +03:00
Rohit Kalhans
91c8e79fcd BUG#11762667:MYSQLBINLOG IGNORES ERRORS WHILE WRITING OUTPUT
This is a followup patch for the bug enabling the test
i_binlog.binlog_mysqlbinlog_file_write.test
this was disabled in mysql trunk and mysql 5.5 as in the release
build mysqlbinlog was not debug compiled whereas the mysqld was.
Since have_debug.inc script checks only for mysqld to be debug
compiled, the test was not being skipped on release builds.

We resolve this problem by creating a new inc file 
mysqlbinlog_have_debug.inc which checks exclusively for mysqlbinlog
to be debug compiled. if not it skips the test.
 

mysql-test/include/mysqlbinlog_have_debug.inc:
  new inc file to check if mysqlbinlog is debug compiled.
2012-07-03 18:00:21 +05:30
Gleb Shchepa
521deaf36f minor update to make MSVS happy 2012-06-29 18:24:43 +04:00
Georgi Kodinov
107c894a54 Bug #13708485: malformed resultset packet crashes client
Several fixes :

* sql-common/client.c
Added a validity check of the fields metadata packet sent 
by the server.
Now libmysql will check if the length of the data sent by
the server matches what's expected by the protocol before
using the data.

* client/mysqltest.cc
Fixed the error handling code in mysqltest to avoid sending
new commands when the reading the result set failed (and 
there are unread data in the pipe).

* sql_common.h + libmysql/libmysql.c + sql-common/client.c
unpack_fields() now generates a proper error when it fails.
Added a new argument to this function to support the error 
generation.

* sql/protocol.cc
Added a debug trigger to cause the server to send a NULL
insted of the packet expected by the client for testing 
purposes.
2012-06-28 18:38:55 +03:00