summaryrefslogtreecommitdiff
path: root/sql
Commit message (Collapse)AuthorAgeFilesLines
* Merge of mysql-5.1-bugteam into mysql-trunk-merge.Davi Arnaut2010-06-1030-339/+402
|\
| * Bug#42733: Type-punning warnings when compiling MySQL --Davi Arnaut2010-06-1024-207/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strict aliasing violations. One somewhat major source of strict-aliasing violations and related warnings is the SQL_LIST structure. For example, consider its member function `link_in_list` which takes a pointer to pointer of type T (any type) as a pointer to pointer to unsigned char. Dereferencing this pointer, which is done to reset the next field, violates strict-aliasing rules and might cause problems for surrounding code that uses the next field of the object being added to the list. The solution is to use templates to parametrize the SQL_LIST structure in order to deference the pointers with compatible types. As a side bonus, it becomes possible to remove quite a few casts related to acessing data members of SQL_LIST.
| * Bug#42733: Type-punning warnings when compiling MySQL --Davi Arnaut2010-06-104-517/+618
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strict aliasing violations. Essentially, the problem is that large parts of the server were developed in simpler times (last decades, pre C99 standard) when strict aliasing and compilers supporting such optimizations were rare to non-existent. Thus, when compiling the server with a modern compiler that uses strict aliasing rules to perform optimizations, there are several places in the code that might trigger undefined behavior. As evinced by some recent bugs, GCC does a somewhat good of job misoptimizing such code, but on the other hand also gives warnings about suspicious code. One problem is that the warnings aren't always accurate, yet we can't afford to just shut them off as we might miss real cases. False-positive cases are aggravated mostly by casts that are likely to trigger undefined behavior. The solution is to start a cleanup process focused on fixing and reducing the amount of strict-aliasing related warnings produced by GCC and others compilers. A good deal of noise reduction can be achieved by just removing useless casts that are product of historical cruft and are likely to trigger undefined behavior if dereferenced.
* | mergeGeorgi Kodinov2010-06-092-1/+11
|\ \ | |/
| * MergeGeorgi Kodinov2010-06-092-1/+11
| |\
| | * Bug #52512: Assertion `! is_set()' in Diagnostics_area::set_ok_status Georgi Kodinov2010-04-072-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on LOAD DATA Two problems : 1. LOAD DATA was not checking for SQL errors and was sending an OK packet even when there were errors reported already. Fixed to check for SQL errors in addition to the error conditions already detected. 2. There was an over-ambitious assert() on the server to check if the protocol is always followed by the client. This can cause crashes on debug servers by clients not completing the protocol exchange for some reason (e.g. --send command in mysqltest). Fixed by keeping the assert only on client side, since the server always completes the protocol exchange.
| * | automergeKristofer Pettersson2010-06-081-2/+2
| |\ \
* | \ \ AutomergeKristofer Pettersson2010-06-082-3/+2
|\ \ \ \
| * | | | Addendum to merge of Bug#52315 to mysql-trunk-merge : Georgi Kodinov2010-06-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed the failing sys_vars.timestamp_basic.test by not re-calculating the value of the system variable at check time.
| * | | | 5.1-bugteam->trunk-merge mergeSergey Glukhov2010-06-081-2/+2
| |\ \ \ \ | | | |/ / | | |/| |
| | * | | 5.0-bugteam->5.1-bugteam mergeSergey Glukhov2010-06-081-2/+2
| | |\ \ \
| | | * | | Bug#53933 crash when using uncacheable subquery in the having clause of ↵Sergey Glukhov2010-06-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | outer query The problem is in the Item_func_isnull::update_used_tables() function, bracket is at the wrong place. Because of that isnull item erroneously is treated as const item. The fix is to set brackets in the right place.
* | | | | | merge 5.1-bugteam => trunk-mergeKristofer Pettersson2010-06-081-4/+30
|\ \ \ \ \ \ | |/ / / / / |/| | | / / | | |_|/ / | |/| | |
| * | | | Bug#53191 Lock_time in slow log is negative when logging stored routinesKristofer Pettersson2010-06-081-8/+37
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Logging slow stored procedures caused the slow log to write very large lock times. The lock times was a result of a negative number being cast to an unsigned integer. The reason the lock time appeard negative was because one of the measurements points was reset after execution causing it to change order with the start time of the statement. This bug is related to bug 47905 which in turn was introduced because of a joint fix for 12480,12481,12482 and 11587. The fix is to only reset the start_time before any statement execution in a SP while not resetting start_utime or utime_after_lock which are used for measuring the performance of the SP. Start_time is used to set the timestamp on the replication event which controlls how the slave interprets time functions like NOW().
* | | | merge and typo fixGeorgi Kodinov2010-06-072-4/+7
|\ \ \ \ | |/ / /
| * | | mergeGeorgi Kodinov2010-06-071-2/+5
| |\ \ \ | | |/ /
| | * | Addendum to the fix for bug #52315: need to set a proper shutdown typeGeorgi Kodinov2010-06-071-2/+6
| | | | | | | | | | | | | | | | when an out-of-supported-range date is detected.
* | | | Manual merge from mysql-trunk-bugfixing.Alexander Nozdrin2010-06-0771-950/+1160
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: - BUILD/SETUP.sh - mysql-test/mysql-test-run.pl - mysql-test/r/partition_error.result - mysql-test/t/disabled.def - mysql-test/t/partition_error.test - sql/share/errmsg-utf8.txt
| * | | | Post-merge fix: header is used by the client API. Obvious in retrospect.Davi Arnaut2010-06-051-2/+9
| | | | | | | | | | | | | | | Also, update a few cases missed by the initial patch.
| * | | | Bug#53445: Build with -Wall and fix warnings that it generatesDavi Arnaut2010-05-3118-75/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix various mismatches between function's language linkage. Any particular function that is declared in C++ but should be callable from C must have C linkage. Note that function types with different linkages are also distinct. Thus, if a function type is declared in C code, it will have C linkage (same if declared in a extern "C" block).
| * | | | Bug#52520 Difference in tinytext utf column metadataAlexander Barkov2010-06-024-8/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problems: - regression (compating to version 5.1) in metadata for BLOB types - inconsistency between length metadata in server and embedded for BLOB types - wrong max_length calculation in items derived from BLOB columns @ libmysqld/lib_sql.cc Calculating length metadata in embedded similary to server version, using new function char_to_byte_length_safe(). @ mysql-test/r/ctype_utf16.result Adding tests @ mysql-test/r/ctype_utf32.result Adding tests @ mysql-test/r/ctype_utf8.result Adding tests @ mysql-test/r/ctype_utf8mb4.result Adding tests @ mysql-test/t/ctype_utf16.test Adding tests @ mysql-test/t/ctype_utf32.test Adding tests @ mysql-test/t/ctype_utf8.test Adding tests @ mysql-test/t/ctype_utf8mb4.test Adding tests @ sql/field.cc Overriding char_length() for Field_blob: unlike in generic Item::char_length() we don't divide to mbmaxlen for BLOBs. @ sql/field.h - Making Field::char_length() virtual - Adding prototype for Field_blob::char_length() @ sql/item.h - Adding new helper function char_to_byte_length_safe() - Using new function @ sql/protocol.cc Using new function char_to_byte_length_safe(). modified: libmysqld/lib_sql.cc mysql-test/r/ctype_utf16.result mysql-test/r/ctype_utf32.result mysql-test/r/ctype_utf8.result mysql-test/r/ctype_utf8mb4.result mysql-test/t/ctype_utf16.test mysql-test/t/ctype_utf32.test mysql-test/t/ctype_utf8.test mysql-test/t/ctype_utf8mb4.test sql/field.cc sql/field.h sql/item.h sql/protocol.cc
| * | | | Merge trunk-bug53983 -> trunk-bugfixingMagnus Blåudd2010-06-021-3/+13
| |\ \ \ \
| | * | | | Bug#53983 Placeholder for MASTER_BIND in master.infoMagnus Blåudd2010-06-021-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Reserve line 17 in master.info for master_bind which has been added in MySQL Cluster 6.3 - move the line for "list of server id for ignorable servers" to line 18
| * | | | | BUG#50479 DDL stmt on row-only/stmt-only tables generate spurious binlog_formatAlfranio Correia2010-06-026-87/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | errors In the fix of BUG#39934 in 5.1-rep+3, errors are generated when binlog_format=row and a statement modifies a table restricted to statement-logging (ER_BINLOG_ROW_MODE_AND_STMT_ENGINE); or if binlog_format=statement and a statement modifies a table restricted to row-logging (ER_BINLOG_STMT_MODE_AND_ROW_ENGINE). However, some DDL statements that lock tables (e.g. ALTER TABLE, CREATE INDEX and CREATE TRIGGER) were causing spurious errors, although no row might be inserted into the binary log. To fix the problem, we tagged statements that may generate rows into the binary log and thence the warning messages are only printed out when the appropriate conditions hold and rows might be changed.
| * | | | | auto-merge mysql-trunk-bugfixing (local) --> mysql-trunk-bugfixing.mergeAlfranio Correia2010-06-011-0/+4
| |\ \ \ \ \
| | * | | | | BUG#53421 Part of transaction not written in binlog after deadlock, replicationAlfranio Correia2010-06-011-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | breaks When a "CREATE TEMPORARY TABLE SELECT * FROM" was executed the OPTION_KEEP_LOG was not set into the thd->variables.option_bits. For that reason, if the transaction had updated only transactional engines and was rolled back at the end (.e.g due to a deadlock) the changes were not written to the binary log, including the creation of the temporary table. To fix the problem, we have set the OPTION_KEEP_LOG into the thd->variables.option_bits when a "CREATE TEMPORARY TABLE SELECT * FROM" is executed.
| * | | | | | auto-merge mysql-trunk-bugfixing (local) --> mysql-trunk-bugfixing.merge Alfranio Correia2010-06-015-15/+82
| |\ \ \ \ \ \ | | |/ / / / / | |/| | | | |
| | * | | | | BUG#53437 @@session.sql_bin_log support in substatements is incorrectAlfranio Correia2010-05-275-15/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The thd->variables.option_bits & OPTION_BIN_LOG is currently abused: it's both a system variable and an implementation switch. The current approach to this option bit breaks the session variable encapsulation. Besides it is allowed to change @@session.sql_bin_log within a transaction what may lead to not correctly logging a transaction. To fix the problems, we created a thd->variables variable to represent the "sql_log_bin" and prohibited its update inside a transaction or sub-statement.
| * | | | | | Patch for Bug#54123 (Build failure on HPUX).Alexander Nozdrin2010-06-011-0/+2
| | | | | | |
| * | | | | | Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BYGleb Shchepa2010-05-312-2/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when it should use index Sometimes the LEFT/RIGHT JOIN with an empty table caused an unnecessary filesort. Sample query, where t1.i1 is indexed and t3 is empty: SELECT t1.*, t2.* FROM t1 JOIN t2 ON t1.i1 = t2.i2 LEFT JOIN t3 ON t2.i2 = t3.i3 ORDER BY t1.i1 LIMIT 5; The server erroneously used an item of empty outer-joined table as a common constant of a Item_equal (multi-equivalence expression). By the fix for the bug 16590 the constant status of such an item has been propagated to st_table::const_key_parts map bits related to other Item_equal argument-related key parts (those are obviously not constant in our case). As far as test_if_skip_sort_order function skips constant prefixes of testing keys, this caused an ignorance of available indices, since some prefixes were marked as constant by mistake.
| * | | | | | Bug #49829 Many "hides virtual function" warnings with SunStudioTor Didriksen2010-05-315-31/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport from mysql-pe (of those parts which have not been upmerged from 5.1)
| * | | | | | Backport: remove dead code.Davi Arnaut2010-05-282-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reorganize function to reflect that it does not actually uses curses and that there is no curses variant.
| * | | | | | Backport: Remove unused and ancient files, functions, and facilities.Davi Arnaut2010-05-289-73/+4
| | | | | | |
| * | | | | | Backport a old cleanup patch.Davi Arnaut2010-05-282-139/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Formatting cleanup: removing tabs and trailing spaces to conform to MySQL Internals Coding Guidelines.
| * | | | | | Bug#52168 decimal casting catastrophes: crashes and valgrind errors on ↵oystein.grovlen@sun.com2010-05-282-18/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | simple casts The problem is that if a NULL is stored in an Item_cache_decimal object, the associated my_decimal object is not initialized. However, it is still accessed when val_int() is called. The fix is to check for null_value within val_int(), and return without accessing the my_decimal object when the cached value is NULL. Bug#52122 reports the same issue for val_real(), and this patch also includes fixes for val_real() and val_str() and corresponding test cases from that bug report. Also, NULL is returned from val_decimal() when value is null. This will avoid that callers access an uninitialized my_decimal object. Made similar changes to all other Item_cache classes. Now all val_* methods should return a well defined value when actual value is NULL.
| * | | | | | Auto-merge from mysql-trunk.Alexander Nozdrin2010-05-2857-588/+1051
| |\ \ \ \ \ \
| * | | | | | | Bug#52430 Incorrect key in the error message for duplicate key error ↵Sergey Glukhov2010-05-271-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | involving BINARY type For BINARY(N) strip trailing zeroes to make the error message nice-looking
| * | | | | | | Bug#52856 concurrent show columns or show full columns causes a crash!!!1Sergey Glukhov2010-05-271-34/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should avoid any SHARE fields assignments as this is shared structure and assignments may affect other therads. To avoid this copy of SHARE struct is created and stored into TABLE struct which is used in get_schema_coulumns_record later.
| * | | | | | | Bug #53445 Build with -Wall and fix warnings that it generatesTor Didriksen2010-05-269-40/+36
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Add -Wall to gcc/g++ Fix most warnings reported in dbg and opt mode.
| * | | | | | mergeMattias Jonsson2010-05-251-4/+5
| |\ \ \ \ \ \
| | * | | | | | Bug#39338: Fieldnames in INFORMATIONSCHEMA.PARTITIONS.PARTITION_EXPRESSIONMattias Jonsson2009-02-181-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | become unescaped Problem was only with the print out of the KEY partitioning list of fields, it did not include quotes, even if it was needed. Fixed by always add quotes if needed.
| * | | | | | | mergeMattias Jonsson2010-05-251-14/+26
| |\ \ \ \ \ \ \
| | * | | | | | | Bug#42954: SQL MODE 'NO_DIR_IN_CREATE' does not work with subpartitionsMattias Jonsson2010-03-111-14/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was no check for DATA/INDEX DIRECTORY for subpartitions Added the same check as for partitions.
| * | | | | | | | mergeMattias Jonsson2010-05-2516-257/+110
| |\ \ \ \ \ \ \ \
| | * \ \ \ \ \ \ \ Merge of bug#51851.Mattias Jonsson2010-05-2416-257/+110
| | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Also moved HA_DATA_PARTITION from ha_partition.cc to table.h.
| | | * | | | | | | | Bug#51851: Server with SBR locks mutex twice on LOAD DATAMattias Jonsson2010-03-3015-248/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into partitioned MyISAM table Problem was that the ha_data structure was introduced in 5.1 and only used for partitioning first, but with the intention of be of use for others engines as well, and when used by other engines it would clash if it also was partitioned. Solution is to move the partitioning specific data to a separate structure, with its own mutex (which is used for auto_increment). Also did rename PARTITION_INFO to PARTITION_STATS since there already exist a class named partition_info, also cleaned up some related variables.
| * | | | | | | | | | mergeMattias Jonsson2010-05-241-5/+8
| |\ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / | |/| | | | | | | | |
| | * | | | | | | | | Bug#52815: LIST COLUMNS doesn't insert rows in correctMattias Jonsson2010-04-211-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | partition if muliple columns used Problem was that range scanning through the sorted array of the column list values did not use a correct index calculation. Fixed by also taking the number of columns in the calculation.
| * | | | | | | | | | merge from mysql-trunk-runtimeJon Olav Hauglid2010-05-2127-147/+333
| |\ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|/ / / / | |/| | | | | | | | |
| | * | | | | | | | | Follow-up for the fix for bug #46947 "Embedded SELECT without Dmitry Lenev2010-05-211-20/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FOR UPDATE is causing a lock". This patch tries to address problems which were exposed during backporting of original patch to 5.1 tree. - It ensures that we don't change locking behavior of simple SELECT statements on InnoDB tables when they are executed under LOCK TABLES ... READ and with @@innodb_table_locks=0. Also we no longer pass TL_READ_DEFAULT/TL_WRITE_DEFAULT lock types, which are supposed to be parser-only, to handler::start_stmt() method. - It makes check_/no_concurrent_insert.inc auxiliary scripts more robust against changes in test cases that use them and also ensures that they don't unnecessarily change environment of caller.