compilation error in mysys/my_getsystime.c fixed
some redundant code removed
sec_to_time, time_to_sec, from_unixtime, unix_timestamp, @@timestamp now
use decimal, not double for numbers with a fractional part.
purge_master_logs_before_date() fixed
many bugs in corner cases fixed
mysys/my_getsystime.c:
compilation failure fixed
sql/sql_parse.cc:
don't cut corners. it backfires.
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
The problem is that Item_direct_view_ref which is inherited
from Item_ident updates orig_table_name and table_name with
the same values. The fix is introduction of new constructor
into Item_ident and up which updates orig_table_name and
table_name separately.
mysql-test/r/metadata.result:
test case
mysql-test/t/metadata.test:
test case
sql/item.cc:
new constructor which updates
orig_table_name and table_name
separately.
sql/item.h:
new constructor which updates
orig_table_name and table_name
separately.
sql/table.cc:
used new constructor
with COALESCE and JOIN
The server returned to a client the VARBINARY column type
instead of the DATE type for a result of the COALESCE,
IFNULL, IF, CASE, GREATEST or LEAST functions if that result
was filesorted in an anonymous temporary table during
the query execution.
For example:
SELECT COALESCE(t1.date1, t2.date2) AS result
FROM t1 JOIN t2 ON t1.id = t2.id ORDER BY result;
To create a column of various date/time types in a
temporary table the create_tmp_field_from_item() function
uses the Item::tmp_table_field_from_field_type() method
call. However, fields of the MYSQL_TYPE_NEWDATE type were
missed there, and the VARBINARY columns were created
by default.
Necessary condition has been added.
mysql-test/r/metadata.result:
Added test case for bug #39283.
mysql-test/t/metadata.test:
Added test case for bug #39283.
sql/sql_select.cc:
Bug #39283: Date returned as VARBINARY to client for queries
with COALESCE and JOIN
To create a column of various date/time types in a
temporary table the create_tmp_field_from_item() function
uses the Item::tmp_table_field_from_field_type() method
call. However, fields of the MYSQL_TYPE_NEWDATE type were
missed there, and the VARBINARY columns were created
by default.
Necessary condition has been added.
Send_field.org_col_name has broken value on secondary execution.
It happens when result field is created from the field which belongs to view
due to forgotten assignment of some Send_field attributes.
The fix:
set Send_field.org_col_name,org_table_name with correct value during Send_field intialization.
mysql-test/r/metadata.result:
result fix
The result file was changed because now forgotten attributes are properly set.
mysql-test/r/sp.result:
test result
mysql-test/t/sp.test:
test case
sql/item.cc:
Send_field.org_col_name has broken value on secondary execution.
It happens when result field is created from the field which belongs to view
due to forgotten assignment of some Send_field attributes.
The fix:
set Send_field.org_col_name,org_table_name with correct value during Send_field intialization.
tests/mysql_client_test.c:
test case fix
The test was changed because now forgotten attributes are properly set.
command and reported to a client.
The fact that a timestamp field will be set to NO on UPDATE wasn't shown
by the SHOW COMMAND and reported to a client through connectors. This led to
problems in the ODBC connector and might lead to a user confusion.
A new filed flag called ON_UPDATE_NOW_FLAG is added.
Constructors of the Field_timestamp set it when a field should be set to NOW
on UPDATE.
The get_schema_column_record function now reports whether a timestamp field
will be set to NOW on UPDATE.
mysql-test/t/information_schema.test:
A test case adjusted after fixing the bug#30081.
mysql-test/r/type_timestamp.result:
Adjusted a test case after fixing bug#30081.
mysql-test/r/type_ranges.result:
Adjusted a test case after fixing bug#30081.
mysql-test/r/show_check.result:
Adjusted a test case after fixing bug#30081.
mysql-test/r/ps_5merge.result:
Adjusted a test case after fixing bug#30081.
mysql-test/r/ps_4heap.result:
Adjusted a test case after fixing bug#30081.
mysql-test/r/ps_3innodb.result:
Adjusted a test case after fixing bug#30081.
mysql-test/r/ps_2myisam.result:
Adjusted a test case after fixing bug#30081.
mysql-test/r/metadata.result:
Adjusted a test case after fixing bug#30081.
mysql-test/r/log_tables.result:
Adjusted a test case after fixing bug#30081.
mysql-test/r/information_schema.result:
A test case adjusted after fixing the bug#30081.
mysql-test/r/grant.result:
Adjusted a test case after fixing bug#30081.
tests/mysql_client_test.c:
A test case adjusted after fixing the bug#30081.
sql/sql_show.cc:
Bug#30081: "ON UPDATE CURRENT_TIMESTAMP" wasn't shown by the SHOW FIELDS
command and reported to a client.
The get_schema_column_record function now reports whether a timestamp field
will be set to NOW on UPDATE.
sql/field.cc:
Bug#30081: "ON UPDATE CURRENT_TIMESTAMP" wasn't shown by the SHOW FIELDS
command and reported to a client.
Constructors of the Field_timestamp set the ON_UPDATE_NOW_FLAG on a field when
it should be set to NOW on UPDATE.
include/mysql_com.h:
Bug#30081: "ON UPDATE CURRENT_TIMESTAMP" wasn't shown by the SHOW FIELDS
command and reported to a client.
A new filed flag called ON_UPDATE_NOW_FLAG is added.
client/mysql.cc:
Bug#30081: "ON UPDATE CURRENT_TIMESTAMP" wasn't shown by the SHOW FIELDS
command and reported to a client.
The fieldflag2str function is adjusted to print the ON_UPDATE_NOW_FLAG.
Updated test case for bug #28898. Additional cleanup.
mysql-test/t/metadata.test:
Updated test case for bug #28898. Additional cleanup.
mysql-test/r/metadata.result:
Updated test case for bug #28898. Additional cleanup.
For a join query with GROUP BY and/or ORDER BY and a view reference
in the FROM list the metadata erroneously showed empty table aliases
and database names for the view columns.
sql/item.h:
Fixed bug #28898.
Body of Item_ref::get_tmp_table_item method has been moved
to item.cc file.
mysql-test/t/metadata.test:
Updated test case for bug #28898.
sql/item.cc:
Fixed bug #28898.
The Item_ref::get_tmp_table_item method has been modified
to copy pointers to the table alias and database name to the new
Item_field object created for a field stored in the temporary
table.
mysql-test/r/metadata.result:
Updated test case for bug #28898.
sql/sql_select.cc:
Fixed bug #28898.
The change_to_use_tmp_fields function has been modified to
to copy pointers to the table alias and database name from
the Item_ref objects to the new Item_field objects created
for fields stored in the temporary table.
Integer values with 10 digits may or may not fit into an int column
(e.g. 2147483647 vs 6147483647).
Thus when creating a temp table column for such an int we must
use bigint instead.
Fixed to use bigint.
Also subsituted a "magic number" with a named constant.
mysql-test/r/analyse.result:
Bug #28492: Adjusted the results after having fixed the bug
mysql-test/r/metadata.result:
Bug #28492: test case
mysql-test/r/olap.result:
Bug #28492: Adjusted the results after having fixed the bug
mysql-test/r/sp.result:
Bug #28492: Adjusted the results after having fixed the bug
mysql-test/r/view.result:
Bug #28492: Adjusted the results after having fixed the bug
mysql-test/t/metadata.test:
Bug #28492: test case
sql/field.h:
Bug #28492: Replaced a magic number with a constant
sql/sql_select.cc:
Bug #28492: Treat integers with 10 and more digits as
bigint.
When compiling GROUP BY Item_ref instances are dereferenced in
setup_copy_fields(), i.e. replaced with the corresponding Item_field
(if they point to one) or Item_copy_string for the other cases.
Since the Item_ref (in the Item_field case) is no longer used the information
about the aliases stored in it is lost.
Fixed by preserving the column, table and DB alias on dereferencing Item_ref
mysql-test/r/metadata.result:
Bug #20191: getTableName gives wrong or inconsistent result when using VIEWs
- test case
mysql-test/t/metadata.test:
Bug #20191: getTableName gives wrong or inconsistent result when using VIEWs
- test case
sql/item.cc:
Bug #20191: getTableName gives wrong or inconsistent result when using VIEWs
- use the table and db name to fill up the metadata for columns
sql/sql_select.cc:
Bug #20191: getTableName gives wrong or inconsistent result when using VIEWs
- preserve the field, table and DB name on dereferencing an Item_ref
procedure variable
Second version, after review.
Keep the unsigned_flag in Item_decimal updated. Note that this also changed
the result of several old test results - creating tables from decimal
templates now gives unsigned columns and different sizes. (Several tests
had Length > Max_length before.)
mysql-test/r/case.result:
Updated result (after fixing BUG#12589).
mysql-test/r/metadata.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_2myisam.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_3innodb.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_4heap.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_5merge.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_6bdb.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_7ndb.result:
Updated result (after fixing BUG#12589).
mysql-test/r/sp.result:
New test case for BUG#12589.
mysql-test/r/type_newdecimal.result:
Updated result (after fixing BUG#12589).
mysql-test/t/sp.test:
New test case for BUG#12589.
sql/item.cc:
Keep the unsigned_flag updated in Item_splocal and Item_decimal.
into mysql.com:/home/jimw/my/mysql-5.0-clean
myisam/myisampack.c:
Auto merged
mysql-test/r/metadata.result:
Auto merged
mysys/list.c:
Auto merged
mysys/thr_lock.c:
Auto merged
sql-common/client.c:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_test.cc:
Auto merged
sql/mysqld.cc:
SCCS merged
query that mixed statements that do and do not return info. (Bug #11688)
mysql-test/r/metadata.result:
Add new results
mysql-test/t/metadata.test:
Add new regression test
sql-common/client.c:
Clear mysql->info in free_old_query()
mysql-test/r/case.result:
test result fixed
mysql-test/r/create.result:
test result fixed
mysql-test/r/distinct.result:
test result fixed
mysql-test/r/func_group.result:
test result fixed
mysql-test/r/func_op.result:
test result fixed
mysql-test/r/group_by.result:
test result fixed
mysql-test/r/metadata.result:
test result fixed
mysql-test/r/olap.result:
test result fixed
mysql-test/r/ps_2myisam.result:
test result fixed
mysql-test/r/ps_3innodb.result:
test result fixed
mysql-test/r/ps_4heap.result:
test result fixed
mysql-test/r/ps_5merge.result:
test result fixed
mysql-test/r/ps_6bdb.result:
test result fixed
mysql-test/r/ps_7ndb.result:
test result fixed
mysql-test/r/select.result:
test result fixed
mysql-test/r/sp.result:
test result fixed
mysql-test/r/type_decimal.result:
test result fixed
mysql-test/r/type_newdecimal.result:
test result fixed
mysql-test/r/union.result:
test result fixed
mysql-test/r/variables.result:
test result fixed
mysql-test/t/func_group.test:
test modified
mysql-test/t/olap.test:
test modified
mysql-test/t/type_decimal.test:
test modified
mysql-test/r/group_by.result:
Auto merged
mysql-test/r/metadata.result:
Auto merged
mysql-test/r/union.result:
Auto merged
mysql-test/t/union.test:
Auto merged
sql/item.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
support-files/mysql.server.sh:
Auto merged
mysql-test/r/metadata.result:
Auto merged
sql/item.h:
Auto merged
sql/item_func.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_union.cc:
Auto merged
mysql-test/r/union.result:
SCCS merged
mysql-test/t/union.test:
SCCS merged
client/mysqltest.c:
Auto merged
BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003:
Auto merged
myisam/mi_create.c:
Auto merged
mysql-test/r/grant2.result:
Auto merged
mysql-test/r/metadata.result:
Auto merged
mysql-test/r/ps_1general.result:
Auto merged
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
mysql-test/r/ps_6bdb.result:
Auto merged
mysql-test/r/type_enum.result:
Auto merged
mysql-test/t/grant2.test:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
ndb/src/kernel/blocks/dbacc/Dbacc.hpp:
SCCS merged
ndb/src/kernel/blocks/dbacc/DbaccMain.cpp:
SCCS merged
sql/sql_union.cc:
DBUG_ASSERT(TRUE) is useless so assume opposite
corrected number of fields for --enable_metadata
sql/sql_union.cc
fixed a apparent typo in assert
client/mysqltest.c:
corrected number of fields for --enable_metadata
mysql-test/r/metadata.result:
corrected number of fields for --enable_metadata
mysql-test/r/ps_1general.result:
corrected number of fields for --enable_metadata
mysql-test/r/ps_2myisam.result:
corrected number of fields for --enable_metadata
mysql-test/r/ps_3innodb.result:
corrected number of fields for --enable_metadata
mysql-test/r/ps_4heap.result:
corrected number of fields for --enable_metadata
mysql-test/r/ps_5merge.result:
corrected number of fields for --enable_metadata
mysql-test/r/type_enum.result:
corrected number of fields for --enable_metadata
sql/sql_union.cc:
fixed a apparent typo in assert
mysql-test/r/func_group.result:
new result
mysql-test/r/metadata.result:
new result
test of metadata of variables, unions and derived tables
mysql-test/r/union.result:
new results
test of union of enum
mysql-test/t/metadata.test:
test of metadata of variables, unions and derived tables
mysql-test/t/union.test:
test of union of enum
sql/field.cc:
Field type merging rules added
Fixed table name/alias returting for field made from temporary tables
sql/field.h:
removed unned field type reporting
sql/item.cc:
fixed bug in NEW_DATE type field creartion
replaced mechanism of merging types of UNION
sql/item.h:
replaced mechanism of merging types of UNION
sql/item_func.h:
new item type to make correct field type detection possible
sql/item_subselect.cc:
added table name parameter to prepare() to show right table alias for derived tables
sql/sql_derived.cc:
added table name parameter to prepare() to show right table alias for derived tables
sql/sql_lex.h:
added table name parameter to prepare() to show right table alias for derived tables
sql/sql_parse.cc:
made function for enum/set pack length calculation
sql/sql_prepare.cc:
added table name parameter to prepare() to show right table alias for derived tables
sql/sql_select.cc:
new temporary table field creation by Item_type_holder
fixed table alias for temporary table
sql/sql_union.cc:
added table name parameter to prepare() to show right table alias for derived tables
not default_charset_into. It fixes the
problem that in some cases numbers where
treated as CHAR(N), not as BINARY(N), e.g.
wrong 'charsetnr' when sent to the client side.
2. IFNULL didn't aggregate argument charsets
and collations, so IFNULL(1,'a') produced
a CHAR(N). Now produces a BINARY(N).
3. SELECT PROCEDURE ANALIZE now returns
BINARY columns, which is much better than it worked
previously: CHAR with the default character set.
But in the future it's worth to fix the fields
'Field_name' and 'Optimal_fieldtype' to use UTF8,
and 'Min_value' and 'Max_value' to inherit their charsets
from the original items. But it is not important,
and BINARY(N) is OK for now.
4. Tests were fixed accordingly. No new tests were
made, as the old onces cover everything.
mysql-test/r/analyse.result:
SELECT PROCEDURE ANALIZE now returns
BINARY columns, which is much better than it worked
previously: CHAR with the default character set.
But in the future it's worth to fix the fields
'Field_name' and 'Optimal_fieldtype' to use UTF8,
and 'Min_value' and 'Max_value' to inherit their charsets
from the original items. But it is not important,
and BINARY(N) is OK for now.
mysql-test/r/case.result:
Test fix according to the changes
mysql-test/r/metadata.result:
Test fix according to the changes
mysql-test/r/ps_1general.result:
Test fix according to the changes
mysql-test/r/ps_2myisam.result:
Test fix according to the changes
mysql-test/r/ps_3innodb.result:
Test fix according to the changes
mysql-test/r/ps_4heap.result:
Test fix according to the changes
mysql-test/r/ps_5merge.result:
Test fix according to the changes
mysql-test/r/ps_6bdb.result:
Test fix according to the changes
mysql-test/r/ps_7ndb.result:
Test fix according to the changes
mysql-test/r/union.result:
Test fix according to the changes
sql/item.cc:
Item is now BINARY by default
sql/item_cmpfunc.cc:
IFNULL now collects arguments collations/charsets
like other functions do.
BitKeeper/etc/ignore:
auto-union
BitKeeper/etc/logging_ok:
auto-union
Build-tools/Do-compile:
Auto merged
VC++Files/sql/mysqld.dsp:
Auto merged
client/Makefile.am:
Auto merged
client/mysql.cc:
Auto merged
BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003:
Auto merged
client/mysqltest.c:
Auto merged
include/my_base.h:
Auto merged
innobase/dict/dict0dict.c:
Auto merged
innobase/dict/dict0load.c:
Auto merged
innobase/include/dict0dict.h:
Auto merged
innobase/include/row0mysql.h:
Auto merged
innobase/os/os0file.c:
Auto merged
innobase/srv/srv0srv.c:
Auto merged
libmysql/libmysql.c:
Auto merged
myisam/mi_check.c:
Auto merged
myisam/mi_rnext_same.c:
Auto merged
myisam/mi_write.c:
Auto merged
myisam/sort.c:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/r/ctype_ujis.result:
Auto merged
mysql-test/r/gis-rtree.result:
Auto merged
mysql-test/r/group_by.result:
Auto merged
mysql-test/r/merge.result:
Auto merged
mysql-test/r/metadata.result:
Auto merged
mysql-test/r/ndb_alter_table.result:
Auto merged
mysql-test/r/ps_1general.result:
Auto merged
mysql-test/r/insert_update.result:
Auto merged
mysql-test/r/timezone2.result:
Auto merged
mysql-test/r/type_enum.result:
Auto merged
mysql-test/r/variables.result:
Auto merged
mysql-test/t/ctype_ucs.test:
Auto merged
mysql-test/t/merge.test:
Auto merged
mysql-test/t/ps_1general.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/system_mysql_db_fix.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
ndb/include/ndbapi/NdbConnection.hpp:
Auto merged
ndb/include/ndbapi/NdbDictionary.hpp:
Auto merged
ndb/src/common/util/version.c:
Auto merged
ndb/src/kernel/blocks/dbacc/DbaccInit.cpp:
Auto merged
ndb/src/kernel/blocks/dbacc/Makefile.am:
Auto merged
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Auto merged
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
Auto merged
ndb/src/kernel/blocks/dblqh/DblqhInit.cpp:
Auto merged
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
Auto merged
ndb/src/kernel/blocks/dbtux/Dbtux.hpp:
Auto merged
ndb/src/ndbapi/NdbBlob.cpp:
Auto merged
ndb/src/ndbapi/NdbConnection.cpp:
Auto merged
ndb/src/ndbapi/NdbDictionary.cpp:
Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Auto merged
ndb/src/ndbapi/NdbOperationExec.cpp:
Auto merged
ndb/src/ndbapi/NdbScanOperation.cpp:
Auto merged
ndb/test/ndbapi/Makefile.am:
Auto merged
scripts/make_win_src_distribution.sh:
Auto merged
scripts/mysql_install_db.sh:
Auto merged
sql/field.cc:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/ha_ndbcluster.h:
Auto merged
sql/handler.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_create.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_geofunc.cc:
Auto merged
sql/item_row.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_sum.h:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/net_serv.cc:
Auto merged
sql/password.c:
Auto merged
sql/protocol.cc:
Auto merged
sql/repl_failsafe.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_cache.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_derived.cc:
Auto merged
sql/sql_do.cc:
Auto merged
sql/sql_handler.cc:
Auto merged
sql/sql_help.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_repl.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_union.cc:
Auto merged
sql/examples/ha_archive.cc:
Auto merged
sql/strfunc.cc:
Auto merged
sql/table.cc:
Auto merged
sql/table.h:
Auto merged
sql/tztime.h:
Auto merged
sql/udf_example.cc:
Auto merged
sql/unireg.cc:
Auto merged
Makefile.am:
Simple merge
client/mysqldump.c:
Simple merge
configure.in:
Simple merge
libmysqld/lib_sql.cc:
Automatic merge
mysql-test/r/func_str.result:
Automatic merge
mysql-test/r/grant.result:
simple merge
mysql-test/r/multi_update.result:
automatc merge
mysql-test/r/ps.result:
automatic merge
mysql-test/r/ps_2myisam.result:
Automatic merge
mysql-test/r/ps_3innodb.result:
Automatic merge
mysql-test/r/ps_4heap.result:
Automatic merge
mysql-test/r/ps_5merge.result:
Automatic merge
mysql-test/r/ps_6bdb.result:
Automatic merge
mysql-test/r/ps_7ndb.result:
Automatic merge
mysql-test/r/show_check.result:
Automatic merge
mysql-test/r/subselect.result:
Automatic merge
mysql-test/t/grant.test:
Automatic merge
mysql-test/t/multi_update.test:
Automatic merge
mysql-test/t/ps.test:
Automatic merge
mysql-test/t/show_check.test:
Automatic merge
ndb/docs/wl2077.txt:
merge
ndb/src/mgmsrv/main.cpp:
merge
scripts/mysql_fix_privilege_tables.sh:
merge
sql/item.cc:
Merge (difficult)
sql/item.h:
simple merge
sql/item_cmpfunc.h:
Automatic merge
sql/item_subselect.cc:
Simple merge
sql/item_subselect.h:
Automatic merge
sql/mysql_priv.h:
Simple merge
sql/slave.h:
Automatic merge
sql/sql_base.cc:
Removed code that was backported to 4.1
sql/sql_class.h:
Merge (some code moved to sql_insert.cc)
sql/sql_db.cc:
simple merge
sql/sql_insert.cc:
Merge (difficult as logic had changed both in 4.1 and 5.0)
Some coded moved here from sql_class.h
sql/sql_parse.cc:
Merge (difficult)
sql/sql_prepare.cc:
Simple merge
sql/sql_select.cc:
Automatic merge
sql/sql_table.cc:
Simple merge
sql/sql_update.cc:
Difficult merge because of different logic for multi-updates
sql/sql_yacc.yy:
Simple merge
tests/client_test.c:
Simple merge
For numeric constants we only need to add, since the parser doesn't produce
negative numbers.
For strings we only add (we actually could substract 1 if given string is a constant
and it has '-number' form but we're not doing that because
* we set max_length bigger then necessary in other cases as well.
* the current solution is simpler and safer (bigger max_length is better then cutting out)
mysql-test/r/func_concat.result:
Test for BUG#6825
mysql-test/r/metadata.result:
Ajusted results according to fix of bug BUG#6825:length(-1) = 2 , not 1
mysql-test/t/func_concat.test:
Test for BUG#6825
Fixed compiler warnings
String results in CREATE ... SELECT are now created as CHAR(0), VARCHAR(X) or TEXT() depending on item->max_length
myisam/myisampack.c:
Indentation cleanup
mysql-test/r/analyse.result:
Update results for new varchar handling
mysql-test/r/case.result:
Update results for new varchar handling
mysql-test/r/cast.result:
Update results for new varchar handling
mysql-test/r/create.result:
Update results for new varchar handling
mysql-test/r/ctype_mb.result:
Update results for new varchar handling
mysql-test/r/ctype_ucs.result:
Update results for new varchar handling
mysql-test/r/ctype_utf8.result:
Update results for new varchar handling
mysql-test/r/func_group.result:
Update results for new varchar handling
mysql-test/r/func_str.result:
Update results for new varchar handling
mysql-test/r/func_system.result:
Update results for new varchar handling
mysql-test/r/heap.result:
Update results for new varchar handling
mysql-test/r/heap_hash.result:
Update results for new varchar handling
mysql-test/r/information_schema.result:
Update results for new varchar handling
mysql-test/r/metadata.result:
Update results for new varchar handling
mysql-test/r/null.result:
Update results for new varchar handling
mysql-test/r/ps_2myisam.result:
Update results for new varchar handling
mysql-test/r/ps_3innodb.result:
Update results for new varchar handling
mysql-test/r/ps_4heap.result:
Update results for new varchar handling
mysql-test/r/ps_5merge.result:
Update results for new varchar handling
mysql-test/r/ps_6bdb.result:
Update results for new varchar handling
mysql-test/r/subselect.result:
Update results for new varchar handling
mysql-test/r/type_ranges.result:
Update results for new varchar handling
mysql-test/r/union.result:
Update results for new varchar handling
mysql-test/t/heap.test:
Update results for new varchar handling
mysql-test/t/type_ranges.test:
Added extra test to test generated type for string functions
sql/field.cc:
Update results for new varchar handling
sql/field.h:
Update results for new varchar handling
We have to use orig_table instead of table as 'table' may point to a new field in the created table
sql/field_conv.cc:
Update results for new varchar handling
sql/ha_heap.cc:
Indentation fixes
sql/ha_innodb.cc:
Update results for new varchar handling
sql/item.cc:
Update results for new varchar handling
Remove compiler warnings
String results in CREATE ... SELECT are now created as CHAR(0), VARCHAR(X) or TEXT() depending on item->max_length
sql/item.h:
Update results for new varchar handling
sql/item_func.cc:
Update results for new varchar handling
String results in CREATE ... SELECT are now created as CHAR(0), VARCHAR(X) or TEXT() depending on item->max_length
sql/item_func.h:
ANALYZE now return VARCHAR columns
sql/procedure.h:
Update results for new varchar handling
sql/sql_acl.cc:
After merge fixes
sql/sql_select.cc:
Update results for new varchar handling
String results in temporary tables are now created as CHAR(0), VARCHAR(X) or TEXT() depending on item->max_length
sql/sql_show.cc:
After merge fixes
sql/sql_table.cc:
After merge fixes
strings/ctype-tis620.c:
After merge fixes
tests/client_test.c:
Fixed results, as in MySQL 5.0 strings in CREATE ... SELECT are creates VARCHAR columns
the result takes its charset/collation
attributes from the character string,
e.g. SELECT func(NULL, _latin2'string')
now returns a latin2 result. This is
done by introducing a new derivation
(aka coercibility) level DERIVATION_IGNORABLE,
which is used with Item_null.
2. 'Pure' NULL is now BINARY(0), not CHAR(0).
I.e. NULL is now more typeless.
mysql-test/r/metadata.result:
Fixing test results:
CHAR(0) -> BINARY(0) for NULLs
mysql-test/r/null.result:
Testing mixing NULL with a character string with a number of functions.
mysql-test/r/ps_2myisam.result:
Fixing test results:
CHAR(0) -> BINARY(0) for NULLs
mysql-test/r/ps_3innodb.result:
Fixing test results:
CHAR(0) -> BINARY(0) for NULLs
mysql-test/r/ps_4heap.result:
Fixing test results:
CHAR(0) -> BINARY(0) for NULLs
mysql-test/r/ps_5merge.result:
Fixing test results:
CHAR(0) -> BINARY(0) for NULLs
mysql-test/r/ps_6bdb.result:
Fixing test results:
CHAR(0) -> BINARY(0) for NULLs
mysql-test/r/ps_7ndb.result:
Fixing test results:
CHAR(0) -> BINARY(0) for NULLs
mysql-test/t/null.test:
Testing mixing NULL with a character string with a number of functions.
sql/item.cc:
New derivation level.
sql/item.h:
New derivation level.
TIMESTAMP columns should be unsigned to preserve compatibility with 4.0
(Or else InnoDB will return different internal TIMESTAMP values when user upgrades to 4.1).
Altough this fix will introduce problems with early 4.1 -> 4.1 upgrades (tables with
TIMESTAMP field should be reloaded using mysqldump) it will allow easy 4.0 -> 4.1
upgrade (which is more important since 4.1 is still beta).
mysql-test/r/metadata.result:
TIMESTAMP should be UNSIGNED as in 4.0.
mysql-test/r/ps_2myisam.result:
TIMESTAMP should be UNSIGNED as in 4.0.
mysql-test/r/ps_3innodb.result:
TIMESTAMP should be UNSIGNED as in 4.0.
mysql-test/r/ps_4heap.result:
TIMESTAMP should be UNSIGNED as in 4.0.
mysql-test/r/ps_5merge.result:
TIMESTAMP should be UNSIGNED as in 4.0.
sql/field.cc:
TIMESTAMP should be UNSIGNED to preserve compatiblity with 4.0.
(Or else InnoDB will return different internal TIMESTAMP values when user upgrades to 4.1).
client/mysqltest.c:
Added support for --enable_metadata
mysql-test/t/order_by.test:
Improved comment
scripts/mysqlaccess.sh:
CGI is required (Bug #2988)
sql/field.cc:
Fix to get correct metadata when using temporary tables to create result
sql/field.h:
Fix to get correct metadata when using temporary tables to create result
sql/sql_insert.cc:
Fix to get correct metadata when using temporary tables to create result