summaryrefslogtreecommitdiff
path: root/mysql-test/t/select.test
Commit message (Collapse)AuthorAgeFilesLines
* Create 'main' test directory and move 't' and 'r' thereMichael Widenius2018-03-291-4673/+0
|
* Added Max_index_length and Temporary to SHOW TABLE STATUSMonty2018-02-121-1/+1
| | | | | | | | | - Max_index_length is supported by MyISAM and Aria tables. - Temporary is a placeholder to signal that a table is a temporary table. For the moment this is always "N", except "Y" for generated information_schema tables and NULL for views. Full temporary table support will be done in another task. (No reason to have to update a lot of result files twice in a row)
* MDEV-12239 Add Type_handler::Item_sum_{sum|avg|variance}_fix_length_and_dec()Alexander Barkov2017-03-191-0/+1
|
* MDEV-7635: Update tests to adapt to the new default sql_modeNirbhay Choubey2017-02-101-4/+4
|
* MDEV-3929 Add system variable explicit_defaults_for_timestamp for ↵Alexander Barkov2015-09-221-3/+3
| | | | compatibility with MySQL
* Bug #13571700 TINYBLOB NOT NULL, CRASH IN PROTOCOL::NET_STORE_DATASergey Petrunya2014-03-071-0/+8
| | | | - Backport testcase from mysql-5.6
* Bug#45227: Lost HAVING clause led to a wrong result.Sergey Petrunya2014-03-071-0/+24
| | | | - Backport testcase from mysql-5.6
* 10.0-base merge.Sergei Golubchik2013-09-211-1/+121
|\ | | | | | | | | Partitioning/InnoDB changes are *not* merged (they'll come from 5.6) TokuDB does not compile (not updated to 10.0 SE API)
| * 5.5 merge and fixes for compiler/test errorsSergei Golubchik2013-09-181-1/+90
| |\
| | * Merge 5.3->5.5Igor Babaev2013-08-311-0/+23
| | |\
| | | * Fixed bug mdev-4971.Igor Babaev2013-08-291-0/+23
| | | | | | | | | | | | | | | | | | | | The function propagate_new_equalities() did not updated properly the references to inherited multiple equalities.
| | * | Merge 5.3->5.5Igor Babaev2013-08-271-0/+19
| | |\ \ | | | |/
| | | * Fixed bug mdev-4944.Igor Babaev2013-08-261-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch to fix mdev-4418 turned out to be incorrect. At the substitution of single row tables in make_join_statistics() the used multiple equalities may change and references to the new multiple equalities must be updated. The function remove_eq_conds() takes care of it and it should be called right after the substitution of single row tables. Calling it after the call of make_join_statistics was a mistake.
| | * | Merge 5.3->5.5.Igor Babaev2013-08-181-1/+48
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | | | | | In particular: Merged the patch for bug mdev-4418 from 5.3 into 5.5. Fixed a bug in the patch that should be backported to 5.3.
| | | * Fixed bug mdev-4418.Igor Babaev2013-08-161-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | After single row substitutions there might appear new equalities. They should be properly propagated to all AND/OR levels the WHERE condition. It's done now with an additional call of remove_eq_conds().
| | | * Fixed bug mdev-4355.Igor Babaev2013-08-151-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch almost totally revised the patch for bug mdev-4177. The latter had too many defects. In particular, it did not propagate multiple equalities formed when merging a degenerate disjunct into underlying AND formula.
| * | | merge 5.5 -> 10.0-baseunknown2013-08-201-0/+31
| |/ /
* | | MDEV-4865 Change related to --log option/variable was merged partiallySergei Golubchik2013-08-131-4/+4
|/ / | | | | | | | | Complete the merge of magne.mahre@oracle.com-20101102115354-vxcaxminmzglzalk (WL#5185 Remove deprecated 5.1 features)
* | The bugAlexander Barkov2013-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-4489 "Replication of big5, cp932, gbk, sjis strings makes wrong values on slave" has been fixed. Problem: String constants of some Asian charsets (big5,cp932,gbk,sjis) can have backslash '\' (0x5C) in the second byte of multi-byte characters. Replicating of such constants using the standard '\'-escaping is dangerous. Therefore, constants of these charsets are replicated using hex notation: INSERT INTO t1 (a) VALUES (0x815C); However, 0xHHHH constants do not work well in some cases, because they can behave as strings and as numbers, depending on context (for example, depending on the data type of the column in an INSERT statement). This SQL script was not replicated correctly with statement-based replication: SET NAMES gbk; PREPARE STMT FROM 'INSERT INTO t1 (a) VALUES (?)'; SET @a = '1'; EXECUTE STMT USING @a; The INSERT statement was replicated as: INSERT INTO t1 (a) VALUES (0x31); '1' was correctly converted to the number 1 on master. But the 0x31 constant was treated as number 49 on slave. Fix: 1. Binary log now uses X'HHHH' instead of 0xHHHH constants. 2. The X'HHHH' constants now work always as strings, in all contexts. This is the SQL standard compliant behaviour. After the fix, the above statement is replicated as: INSERT INTO t1 (a) VALUES (X'31'); X'31' is treated as string '1' on slave, and is correctly converted to 1. modified: @ mysql-test/r/ctype_cp932_binlog_stm.result @ mysql-test/r/select.result @ mysql-test/r/select_jcl6.result @ mysql-test/r/select_pkeycache.result @ mysql-test/r/user_var-binlog.result @ mysql-test/r/varbinary.result @ mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result @ mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @ mysql-test/suite/rpl/r/rpl_charset_sjis.result @ mysql-test/suite/rpl/r/rpl_mdev382.result @ mysql-test/suite/rpl/t/rpl_charset_sjis.test @ mysql-test/t/ctype_cp932_binlog_stm.test @ mysql-test/t/select.test @ mysql-test/t/varbinary.test Adding and updating tests @ sql/item.cc @ sql/item.h @ sql/sql_yacc.yy @ sql/sql_lex.cc Splitting the implementations of X'HH' and 0xHH constants into two separate classes. Fixing the parser to distinguish the two syntaxes. @ sql/log_event.cc Using X'HH' instead of 0xHH for binary logging for string constants of the "dangerous" charsets. @ sql/sql_string.h Adding a helped method String::append_hex().
* | Merge 5.3->5.5Igor Babaev2013-05-041-0/+37
|\ \ | |/
| * Fixed bug mdev-4274.Igor Babaev2013-04-291-0/+37
| | | | | | | | | | | | | | | | This bug was the result of incompleteness of the patch for bug mdev-4177. When an OR condition is simplified to a single conjunct it is merged into the embedding AND condition. Multiple equalities are also merged, and any field item involved in those equality should acquire a pointer to a the multiple equality formed by this merge.
* | 5.3->5.5 mergeSergei Golubchik2013-03-101-0/+19
|\ \ | |/
| * Fixed bug mdev-4250.Igor Babaev2013-03-081-0/+19
| | | | | | | | | | | | This is a bug in the legacy code. It did not manifest itself because it was masked by other bugs that were fixed by the patches for mdev-4172 and mdev-4177.
* | 5.3 mergeSergei Golubchik2012-10-181-1/+1
|\ \ | |/
| * Fixed LP bug #1058071 (mdev-564).Igor Babaev2012-09-291-1/+1
| | | | | | | | | | | | | | | | In some rare cases when the value of the system variable join_buffer_size was set to a number less than 256 the function JOIN_CACHE::set_constants determined the size of an offset in the join buffer equal to 1 though the minimal join buffer required more than 256 bytes. This could cause a crash of the server when records from the join buffer were read.
* | mysql-5.5 mergeSergei Golubchik2012-06-141-0/+1
|\ \
| * \ Merge from 5.1 to 5.5Chaithra Gopalareddy2012-04-181-0/+32
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/r/select.result: Added test result for Bug#12713907 mysql-test/t/select.test: Added test case for Bug#12713907 sql/sql_select.cc: Remove the call to set_keyread as we do it from access functions 'join_read_first' and 'join_read_last'
* | \ \ 5.3 mergeSergei Golubchik2012-05-211-0/+14
|\ \ \ \ | | |_|/ | |/| |
| * | | LP bug#994275 fix.unknown2012-05-071-0/+15
| | | | | | | | | | | | | | | | | | | | In 5.3 we substitute constants in ref access values it can't be null so we do not need add NOT NULL for early NULL filtering.
* | | | mysql-5.5 mergeSergei Golubchik2012-01-161-0/+16
|\ \ \ \ | | |/ / | |/| |
| * | | Bug#13344643:Format function in view looses locale informationChaithra Gopalareddy2011-12-151-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem description: When a view is created using function FORMAT and if FORMAT function uses locale option,definition of view saved into server doesn't contain that locale information, Ex: create table test2 (bb decimal (10,2)); insert into test2 values (10.32),(10009.2),(12345678.21); create view test3 as select format(bb,1,'sk_SK') as cc from test2; select * from test3; +--------------+ | cc | +--------------+ | 10.3 | | 10,009.2 | | 12,345,678.2 | +--------------+ 3 rows in set (0.02 sec) show create view test3 View: test3 Create View: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3` AS select format(`test2`.`bb`,1) AS `cc` from `test2` character_set_client: latin1 collation_connection: latin1_swedish_ci 1 row in set (0.02 sec) Problem Analysis: The function Item_func_format::print() which prints the query string to create the view does not print the third argument (i.e the locale information). Hence view is created without locale information. Problem Solution: If argument count is more than 2 we now print the third argument onto the query string. Files changed: sql/item_strfunc.cc Function call changes: Item_func_format::print() mysql-test/t/select.test Added test case to test the bug mysql-test/r/select.result Result of the test case appended here
* | | | 5.3 mergeSergei Golubchik2012-01-131-0/+41
|\ \ \ \ | | |/ / | |/| |
| * | | Made join_cache_level == 2 by default.Igor Babaev2011-12-151-0/+8
| | | |
| * | | Made the optimizer switch flags 'outer_join_with_cache', 'semijoin_with_cache'Igor Babaev2011-12-151-0/+5
| | | | | | | | | | | | | | | | set to 'on' by default.
| * | | Merge with 5.2.Michael Widenius2011-12-111-0/+16
| |\ \ \ | | | | | | | | | | | | | | | no_error handling for select (used by INSERT ... SELECT) still needs to be fixed, but I will do that in a separate commit
| | * | | Fix for lp:780425 sql_buffer_result=1 gives wrong result for GROUP BY with a ↵Michael Widenius2011-11-151-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +# constant expression" mysql-test/r/select.result: Test case for lp:780425 mysql-test/r/select_pkeycache.result: lp:780425 mysql-test/t/select.test: lp:780425 sql/sql_select.cc: Added DBUG_ASSERT to be prove some logic and later be able to simplify the code Set implicit_grouping if we delete a GROUP BY to signal do_select() that a grouping needs to be done.
| | * | | Fixed LP bug #702310 / bug #59493.Igor Babaev2011-01-141-0/+33
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | An assertion failure was triggered for a 6-way join query that uses two join buffers. The failure happened because every call of the function flush_cached_records() saved and restored status of all tables before the table join_tab. It must do it only for those of them that follow the last table that uses a join buffer.
* | | | 5.3->5.5 mergeSergei Golubchik2011-11-221-0/+1
|\ \ \ \ | |/ / /
| * | | Fixed a cost estimation bug introduced into in the function best_access_pathIgor Babaev2011-09-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of the 5.3 code line after a merge with 5.2 on 2010-10-28 in order not to allow the cost to access a joined table to be equal to 0 ever. Expanded data sets for many test cases to get the same execution plans as before.
* | | | merge with 5.3Sergei Golubchik2011-10-191-13/+153
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sql/sql_insert.cc: CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. ****** CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. sql/sql_table.cc: small cleanup ****** small cleanup
| * | | lp:822760 Wrong result with view + invalid datesSergei Golubchik2011-08-221-0/+13
| | | | | | | | | | | | | | | | | | | | sql/sql_select.cc: items' cmp_type()'s must match, not result_type()'s
| * | | Set the default to be mrr=off,mrr_sort_keys=off:Sergey Petrunya2011-07-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Set the default - Adjust the testcases so that 'new' tests are run with optimizations turned on. - Pull out relevant tests from "irrelevant" tests and run them with optimizations on. - Run range.test and innodb.test with both mrr=on and mrr=off
| * | | Merge with 5.1-microsecondsMichael Widenius2011-05-281-13/+16
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A lot of small fixes and new test cases. client/mysqlbinlog.cc: Cast removed client/mysqltest.cc: Added missing DBUG_RETURN include/my_pthread.h: set_timespec_time_nsec() now only takes one argument mysql-test/t/date_formats.test: Remove --disable_ps_protocl as now also ps supports microseconds mysys/my_uuid.c: Changed to use my_interval_timer() instead of my_getsystime() mysys/waiting_threads.c: Changed to use my_hrtime() sql/field.h: Added bool special_const_compare() for fields that may convert values before compare (like year) sql/field_conv.cc: Added test to get optimal copying of identical temporal values. sql/item.cc: Return that item_int is equal if it's positive, even if unsigned flag is different. Fixed Item_cache_str::save_in_field() to have identical null check as other similar functions Added proper NULL check to Item_cache_int::save_in_field() sql/item_cmpfunc.cc: Don't call convert_constant_item() if there is nothing that is worth converting. Simplified test when years should be converted sql/item_sum.cc: Mark cache values in Item_sum_hybrid as not constants to ensure they are not replaced by other cache values in compare_datetime() sql/item_timefunc.cc: Changed sec_to_time() to take a my_decimal argument to ensure we don't loose any sub seconds. Added Item_temporal_func::get_time() (This simplifies some things) sql/mysql_priv.h: Added Lazy_string_decimal() sql/mysqld.cc: Added my_decimal constants max_seconds_for_time_type, time_second_part_factor sql/table.cc: Changed expr_arena to be of type CONVENTIONAL_EXECUTION to ensure that we don't loose any items that are created by fix_fields() sql/tztime.cc: TIME_to_gmt_sec() now sets *in_dst_time_gap in case of errors This is needed to be able to detect if timestamp is 0 storage/maria/lockman.c: Changed from my_getsystime() to set_timespec_time_nsec() storage/maria/ma_loghandler.c: Changed from my_getsystime() to my_hrtime() storage/maria/ma_recovery.c: Changed from my_getsystime() to mmicrosecond_interval_timer() storage/maria/unittest/trnman-t.c: Changed from my_getsystime() to mmicrosecond_interval_timer() storage/xtradb/handler/ha_innodb.cc: Added support for new time,datetime and timestamp unittest/mysys/thr_template.c: my_getsystime() -> my_interval_timer() unittest/mysys/waiting_threads-t.c: my_getsystime() -> my_interval_timer()
| | * | | post-review changes 1Sergei Golubchik2011-05-191-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/my_time.h: remove duplicate defines. cast to ulonglong to avoid overflow sql/field.cc: perform sign extension when reading packed TIME values sql/item_cmpfunc.cc: when converting a string to a date for the purpose of comparing it with another date, we should ignore strict sql mode. sql/item_timefunc.cc: better error message sql/item_timefunc.h: limit decimals appropriately sql/share/errmsg.txt: don't refer to an object as a "column" in error messages that are used not only for columns.
| | * | | wl#173 - temporal types with sub-second resolutionSergei Golubchik2011-03-011-1/+1
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and collateral changes. * introduce my_hrtime_t, my_timediff_t, and conversion macros * inroduce TIME_RESULT, but it can only be returned from Item::cmp_type(), never from Item::result_type() * pack_time/unpack_time function for "packed" representation of MYSQL_TIME in a longlong that can be compared * ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values * numbers aren't quoted in EXPLAIN EXTENDED * new column I_S.COLUMNS.DATETIME_PRECISION * date/time values are compares to anything as date/time, not as strings or numbers. * old timestamp(X) is no longer supported * MYSQL_TIME to string conversion functions take precision as an argument * unified the warnings from Field_timestamp/datetime/time/date/newdate store methods * Field_timestamp_hires, Field_datetime_hires, Field_time_hires * Field_temporal * Lazy_string class to pass a value (string, number, time) polymorphically down the stack * make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants * removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead * introduced Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong() * in many cases date/time types are treated like other types, not as special cases * greatly simplified Arg_comparator (regarding date/time/year code) * SEC_TO_TIME is real function, not integer. * microsecond precision in NOW, CURTIME, etc * Item_temporal. All items derived from it only provide get_date, but no val* methods * replication of NOW(6) * Protocol::store(time) now takes the precision as an argument * @@TIMESTAMP is a double client/mysqlbinlog.cc: remove unneded casts include/my_sys.h: introduce my_hrtime_t, my_timediff_t, and conversion macros include/my_time.h: pack_time/unpack_time, etc. convenience functions to work with MYSQL_TIME::second_part libmysql/libmysql.c: str_to_time() is gone. str_to_datetime() does it now. my_TIME_to_str() takes the precision as an argument mysql-test/include/ps_conv.inc: time is not equal to datetime anymore mysql-test/r/distinct.result: a test for an old MySQL bug mysql-test/r/explain.result: numbers aren't quoted in EXPLAIN EXTENDED mysql-test/r/func_default.result: numbers aren't quoted in EXPLAIN EXTENDED mysql-test/r/func_sapdb.result: when decimals=NOT_FIXED_DEC it means "not fixed" indeed mysql-test/r/func_test.result: numbers aren't quoted in EXPLAIN EXTENDED mysql-test/r/func_time.result: ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values mysql-test/r/having.result: numbers aren't quoted in EXPLAIN EXTENDED mysql-test/r/information_schema.result: new column I_S.COLUMNS.DATETIME_PRECISION mysql-test/r/join_outer.result: numbers aren't quoted in EXPLAIN EXTENDED mysql-test/r/metadata.result: TIMESTAMP no longer has zerofill flag mysql-test/r/range.result: invalid datetime is not compared with as a string mysql-test/r/select.result: NO_ZERO_IN_DATE, etc only affect storage - according to the manual numbers aren't quoted in EXPLAIN EXTENDED mysql-test/r/subselect.result: numbers aren't quoted in EXPLAIN EXTENDED mysql-test/r/sysdate_is_now.result: when decimals=NOT_FIXED_DEC it means "not fixed" indeed mysql-test/r/type_blob.result: TIMESTAMP(N) is not deprecated mysql-test/r/type_timestamp.result: old TIMESTAMP(X) semantics is not supported anymore mysql-test/r/union.result: numbers aren't quoted in EXPLAIN EXTENDED mysql-test/r/varbinary.result: numbers aren't quoted in EXPLAIN EXTENDED mysql-test/t/distinct.test: test for an old MySQL bug mysql-test/t/func_time.test: +- INTERVAL now works with TIME values mysql-test/t/select.test: typo mysql-test/t/subselect.test: only one error per statement, please mysql-test/t/system_mysql_db_fix40123.test: old timestamp(X) is no longer supported mysql-test/t/system_mysql_db_fix50030.test: old timestamp(X) is no longer supported mysql-test/t/system_mysql_db_fix50117.test: old timestamp(X) is no longer supported mysql-test/t/type_blob.test: old timestamp(X) is no longer supported mysql-test/t/type_timestamp.test: old timestamp(X) is no longer supported mysys/my_getsystime.c: functions to get the time with microsecond precision mysys/my_init.c: move the my_getsystime.c initialization code to my_getsystime.c mysys/my_static.c: no need to make these variables extern mysys/my_static.h: no need to make these variables extern scripts/mysql_system_tables.sql: old timestamp(X) is no longer supported scripts/mysql_system_tables_fix.sql: old timestamp(X) is no longer supported scripts/mysqlhotcopy.sh: old timestamp(X) is no longer supported sql-common/my_time.c: * call str_to_time from str_to_datetime, as appropriate * date/time to string conversions take precision as an argument * number_to_time() * TIME_to_double() * pack_time() and unpack_time() sql/event_data_objects.cc: cast is not needed my_datetime_to_str() takes precision as an argument sql/event_db_repository.cc: avoid dangerous downcast (because the pointer is not always Field_timestamp, see events_1.test) sql/event_queue.cc: avoid silly double-work for cond_wait (having an endpoint of wait, subtract the current time to get the timeout, and use set_timespec() macro to fill in struct timespec, by adding the current time to the timeout) sql/field.cc: * remove virtual Field::get_time(), everyone should use only Field::get_date() * remove lots of #ifdef WORDS_BIGENDIAN * unified the warnings from Field_timestamp/datetime/time/date/newdate store methods * Field_timestamp_hires, Field_datetime_hires, Field_time_hires * Field_temporal * make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants sql/field.h: * remove virtual Field::get_time(), everyone should use only Field::get_date() * remove lots of #ifdef WORDS_BIGENDIAN * unified the warnings from Field_timestamp/datetime/time/date/newdate store methods * Field_timestamp_hires, Field_datetime_hires, Field_time_hires * Field_temporal * make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants * removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead sql/filesort.cc: TIME_RESULT, cmp_time() sql/item.cc: * numbers aren't quoted in EXPLAIN EXTENDED * Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong() * virtual Item::get_time() is gone * Item_param::field_type() is set correctly * Item_datetime, for a datetime constant * time to anything is compared as a time * Item_cache::print() prints the value is available * bug fixed in Item_cache_int::val_str() sql/item.h: * Item::print_value(), to be used from Item_xxx::print() when needed * Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong() * virtual Item::get_time() is gone * Item_datetime, for a datetime constant * better default for cast_to_int_type() * Item_cache objects now *always* have the field_type() set sql/item_cmpfunc.cc: * get_year_value, get_time_value are gone. get_datetime_value does it all * get_value_a_func, get_value_b_func are gone * can_compare_as_dates() is gone too, TIME_RESULT is used instead * cmp_type() instead or result_type() when doing a comparison * compare_datetime and compate_e_datetime in the comparator_matrix, is_nulls_eq is gone * Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong() sql/item_cmpfunc.h: greatly simplified Arg_comparator sql/item_create.cc: * fix a bug in error messages in CAST sql/item_func.cc: Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong() mention all possibitiles in switch over Item_result values, or use default: sql/item_row.h: overwrite the default cmp_type() for Item_row, as no MYSQL_TYPE_xxx value corresponds to ROW_RESULT sql/item_timefunc.cc: rewrite make_datetime to support precision argument SEC_TO_TIME is real function, not integer. many functions that returned temporal values had duplicate code in val_* methods, some of them did not have get_date() which resulted in unnecessary date->str->date conversions. Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods. many fixes to set decimals (datetime precision) correctly. sql/item_timefunc.h: SEC_TO_TIME is real function, not integer. many functions that returned temporal values had duplicate code in val_* methods, some of them did not have get_date() which resulted in unnecessary date->str->date conversions. Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods. many fixes to set decimals (datetime precision) correctly. sql/log_event.cc: replication of NOW(6) sql/log_event.h: replication of NOW(6) sql/mysql_priv.h: Lazy_string class to pass a value (string, number, time) polymorphically down the stack. make_truncated_value_warning() that uses it. sql/mysqld.cc: datetime in Arg_comparator::comparator_matrix sql/opt_range.cc: cleanup: don't disable warnings before calling save_in_field_no_warnings() sql/protocol.cc: Protocol::store(time) now takes the precision as an argument sql/protocol.h: Protocol::store(time) now takes the precision as an argument sql/rpl_rli.cc: small cleanup sql/set_var.cc: SET TIMESTAMP=double sql/set_var.h: @@TIMESTAMP is a double sql/share/errmsg.txt: precision and scale are unsigned sql/slave.cc: replication of NOW(6) sql/sp_head.cc: cleanup sql/sql_class.cc: support for NOW(6) sql/sql_class.h: support for NOW(6) sql/sql_insert.cc: support for NOW(6) sql/sql_select.cc: use item->cmp_type(). move a comment where it belongs sql/sql_show.cc: new column I_S.COLUMNS.DATETIME_PRECISION sql/sql_yacc.yy: TIME(X), DATETIME(X), cast, NOW(X), CURTIME(X), etc sql/time.cc: fix date_add_interval() to support MYSQL_TIMESTAMP_TIME argument storage/myisam/ha_myisam.cc: TIMESTAMP no longer carries ZEROFIELD flag, still we keep MYI file compatible. strings/my_vsnprintf.c: warnings tests/mysql_client_test.c: old timestamp(X) does not work anymore datetime is no longer equal to time
| * | | Fixed LP bug #776274,Igor Babaev2011-05-031-0/+14
| | | | | | | | | | | | | | | | | | | | The bug was introduced by the patch that fixed bug 717577.
| * | | Fixed LP bug #707555.Igor Babaev2011-01-261-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug was in the code of the patch fixing bug 698882. With improper casting the method store_key_field::change_source_field was called for the elements of the array TABLE_REF::key_copy that were either of a different type or not allocated at all. This caused crashes in some queries.
| * | | Corrected test case for bug 698882 to make it platform independentIgor Babaev2011-01-151-0/+3
| | | |
| * | | MergeIgor Babaev2011-01-151-0/+43
| |\ \ \
| | * | | Fixed LP bug #698882.Igor Babaev2011-01-151-0/+43
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made sure that the optimal fields are used by TABLE_REF objects when building index access keys to joined tables. Fixed a bug in the template function that sorts the elements of a list using the bubble sort algorithm. The bug caused poor performance of the function. Also added an optimization that skips comparison with the most heavy elements that has been already properly placed in the list. Made the comparison of the fields belonging to the same Item_equal more granular: fields belonging to the same table are also ordered according to some rules.