In the code that converts IN predicates to EXISTS predicates it is changing
the select list elements to constant 1. Example :
SELECT ... FROM ... WHERE a IN (SELECT c FROM ...)
is transformed to :
SELECT ... FROM ... WHERE EXISTS (SELECT 1 FROM ... HAVING a = c)
However there can be no FROM clause in the IN subquery and it may not be
a simple select : SELECT ... FROM ... WHERE a IN (SELECT f(..) AS
c UNION SELECT ...) This query is transformed to : SELECT ... FROM ...
WHERE EXISTS (SELECT 1 FROM (SELECT f(..) AS c UNION SELECT ...)
x HAVING a = c) In the above query c in the HAVING clause is made to be
an Item_null_helper (a subclass of Item_ref) pointing to the real
Item_field (which is not referenced anywhere else in the query anymore).
This is done because Item_ref_null_helper collects information whether
there are NULL values in the result. This is OK for directly executed
statements, because the Item_field pointed by the Item_null_helper is
already fixed when the transformation is done. But when executed as
a prepared statement all the Item instances are "un-fixed" before the
recompilation of the prepared statement. So when the Item_null_helper
gets fixed it discovers that the Item_field it points to is not fixed
and issues an error. The remedy is to keep the original select list
references when there are no tables in the FROM clause. So the above
becomes : SELECT ... FROM ... WHERE EXISTS (SELECT c FROM (SELECT f(..)
AS c UNION SELECT ...) x HAVING a = c) In this way c is referenced
directly in the select list as well as by reference in the HAVING
clause. So it gets correctly fixed even with prepared statements. And
since the Item_null_helper subclass of Item_ref_null_helper is not used
anywhere else it's taken out.
mysql-test/r/ps_11bugs.result:
Test case for the bug
mysql-test/r/subselect.result:
Explain updated because of the tranformation
mysql-test/t/ps_11bugs.test:
Testcase for the bug
sql/item.cc:
Taking out Item_null_helper as it's no longer needed
sql/item.h:
Taking out Item_null_helper as it's no longer needed
sql/item_subselect.cc:
The described change to the IN->EXISTS transformation
mysql-test/r/cast.result:
Update results
mysql-test/t/cast.test:
Add regression test
sql/item.h:
Cap Item_real::val_int() to LONGLONG_MIN and LONGLONG_MAX.
This fixes the new report for bug #7036
mysql-test/t/cast.test:
Added test for cast(hex-value to signed/unsigned)
sql/item.h:
Ensure that hex strings are used as integers in cast(... signed/unsigned)
include/my_sys.h:
Fixes from review (use version in log_event.cc instead)
mysql-test/r/ctype_cp932.result:
Updated test for bug#11338 (logging of prepared statement w/ blob type)
mysql-test/t/ctype_cp932.test:
udpated test for bug#11338 (logging of prepared statement w/ blob type)
mysys/charset.c:
Fixes from review (use version in log_event.cc instead)
sql/item.cc:
Fixes from review (store character_set_client differently so that
fix can be merged forward to 5.0)
sql/item.h:
Fixes from review
sql/log_event.cc:
Fixes from review, str_to_hex is now used by item.cc
sql/log_event.h:
Added prototype for str_to_hex (now used by item.cc)
sql/sql_prepare.cc:
Fixes from review, store character_set_client differently so that
Item_param::query_val_str can use it.
In cp932, '\' character can be the second byte in a
multi-byte character stream. This makes it difficult to use
mysql_escape_string. Added flag to indicate which languages allow
'\' as second byte of multibyte sequence so that when putting a prepared
statement into the binlog we can decide at runtime whether hex encoding
is really needed.
include/m_ctype.h:
Added bool to indicate character sets which allow '\' as the second
byte of a multibyte character set (currently only cp932). For these
character sets, escaping with '\' is dangerous and leads to corruption
in replication.
include/my_sys.h:
Add function to enocde a string as hex with no prefix (bare)
mysys/charset.c:
Add function to encode string as hex with no prefix (bare).
sql/item.cc:
Check the connection character set to see if escape_string_for_mysql
is safe, or if character set requires unambiguous (hex) encoding
sql/item.h:
Pass thd to query_val_str for access to charset()
sql/sql_prepare.cc:
Pass thd to query_val_str.
strings/ctype-big5.c:
Add escape_with_backslash_is_dangerous flag.
strings/ctype-bin.c:
Add escape_with_backslash_is_dangerous flag
strings/ctype-cp932.c:
Add escape_with_backslash_is_dangerous flag.
strings/ctype-czech.c:
Add escape_with_backslash_is_dangerous flag.
strings/ctype-euc_kr.c:
Add escape_with_backslash_is_dangerous flag.
strings/ctype-extra.c:
Add escape_with_backslash_is_dangerous flag.
strings/ctype-gb2312.c:
Add escape_with_backslash_is_dangerous flag.
strings/ctype-gbk.c:
Added escape_with_backslash_is_dangerous flag.
strings/ctype-latin1.c:
Added escape_with_backslash_is_dangerous flag.
strings/ctype-sjis.c:
Added escape_with_backslash_is_dangerous flag.
strings/ctype-tis620.c:
Added esacpe_with_backslash_character_is_dangerous flag.
strings/ctype-uca.c:
Added escape_with_backslash_is_dangerous flag.
strings/ctype-ucs2.c:
Added escape_with_backslash_is_dangerous.
strings/ctype-ujis.c:
Added escape_with_backslash_is_dangerous flag.
strings/ctype-utf8.c:
Added escape_with_backslash_is_dangerous.
strings/ctype-win1250ch.c:
Added escape_with_backslash_is_dangerous.
mysql-test/r/subselect.result:
testst of IN subqueries with row
mysql-test/t/subselect.test:
tests of ion subqueries with row
sql/item.h:
add method to prevent of removing Item_ref_null_helper from HAVING
sql/item_cmpfunc.h:
Prevented removing of Item_test_isnotnull from HAVING
sql/item_subselect.cc:
fixed converting row IN subqueries
sql/sql_select.cc:
fixed debug print
item.cc:
item.h:
Adding Item_param::safe_charset_converter,
not to return collation mix error if
parameter can be converted into operation
character set.
ctype_utf8.result:
adding test case
ctype_utf8.test:
adding test case
sql/item.h:
Bug #12371 executing prepared statement fails (illegal mix of collations)
Adding Item_param::safe_charset_converter,
not to returm collation mix error if
parameter can be converted into operation
character set.
sql/item.cc:
Bug #12371 executing prepared statement fails (illegal mix of collations)
mysql-test/t/ctype_utf8.test:
adding test case
mysql-test/r/ctype_utf8.result:
adding
Adding test
item_sum.cc:
Adding a call for collation/charset aggregation,
to collect attributes from the arguments. The actual bug fix.
item_func.h, item_func.cc, item.h, item.cc:
- Removing collation aggrgation functions from Item_func class
in item.cc, and adding it as non-class functions in item.cc
to be able to reuse this code for group_concat.
- Adding replacement for these functions into Item_func class
as wrappers for moved functions, to minizize patch size,
sql/item.cc:
- Removing collation aggrgation functions from Item_func class
in item.cc, and adding it as non-class functions in item.cc
to be able to reuse this code for group_concat.
- Adding replacement for these functions into Item_func class
as wrappers for moved functions, to minizize patch size,
sql/item.h:
- Removing collation aggrgation functions from Item_func class
in item.cc, and adding it as non-class functions in item.cc
to be able to reuse this code for group_concat.
- Adding replacement for these functions into Item_func class
as wrappers for moved functions, to minizize patch size,
sql/item_func.cc:
- Removing collation aggrgation functions from Item_func class
in item.cc, and adding it as non-class functions in item.cc
to be able to reuse this code for group_concat.
- Adding replacement for these functions into Item_func class
as wrappers for moved functions, to minizize patch size,
sql/item_func.h:
- Removing collation aggrgation functions from Item_func class
in item.cc, and adding it as non-class functions in item.cc
to be able to reuse this code for group_concat.
- Adding replacement for these functions into Item_func class
as wrappers for moved functions, to minizize patch size,
sql/item_sum.cc:
Adding a call for collation/charset aggregation,
to collect attributes from the arguments. The actual bug fix.
mysql-test/t/func_gconcat.test:
Adding test
mysql-test/r/func_gconcat.result:
Adding test
into mysql.com:/usr/home/bar/mysql-4.1.num-conv
mysql-test/r/ctype_utf8.result:
Auto merged
mysql-test/t/ctype_utf8.test:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/sql_table.cc:
Auto merged
data": remove the fix for another bug (8807) that
added OUTER_REF_TABLE_BIT to all subqueries that used a placeholder
to prevent their evaluation at prepare. As this bit hanged in
Item_subselect::used_tables_cache for ever, a constant subquery with
a placeholder was never evaluated as such, which caused wrong
choice of the execution plan for the statement.
- to fix Bug#8807 backport a better fix from 5.0
- post-review fixes.
mysql-test/r/ps.result:
Bug#11458: test results fixed
mysql-test/t/ps.test:
- add a test case for Bug#11458 "Prepared statement with subselects return
random data"
sql/item.cc:
- remove unnecessary Item_param::fix_fields
- fix Item_param::set_null to set item_type accordingly (safety:
Item_param should behave like a basic constant).
sql/item.h:
Remove Item_param::fix_fields
sql/item_subselect.h:
Remove no more existing friend.
sql/mysql_priv.h:
Add UNCACHEABLE_PREPARE to mark all subqueries as uncacheable if
in statement prepare (backport from 5.0).
sql/sql_lex.h:
Comment fixed.
sql/sql_parse.cc:
If in statement prepare, mark all subqueries as uncacheable (backport
from 5.0)
sql/sql_prepare.cc:
Switch off the uncacheable flag from all subqueries after statement
prepare is done (backport from 5.0)
adding test case
sql_table.cc:
sql_table.cc:
- do not create a new item when charsets are the same
- return ER_INVALID_DEFAULT if default value cannot
be converted into the column character set.
item.cc:
- Allow conversion not only to Unicode,
but also to and from "binary".
- Adding safe_charset_converter() for Item_num
and Item_varbinary, returning a fixed const Item.
sql/item.cc:
- Allow conversion not only to Unicode,
but also to and from "binary".
- Adding safe_charset_converter() for Item_num
and Item_varbinary, returning a fixed const Item.
sql/sql_table.cc:
sql_table.cc:
- do not create a new item when charsets are the same
- return ER_INVALID_DEFAULT if default value cannot
be converted into the column character set.
mysql-test/r/ctype_utf8.result:
adding test case
#9728 'Decreased functionality in "on duplicate key update
#8147 'a column proclaimed ambigous in INSERT ... SELECT .. ON DUPLICATE'
This ensures fields are uniquely qualified and also that one can't update other tables in the ON DUPLICATE KEY UPDATE part
mysql-test/r/insert_select.result:
More tests for bug #9728 and #8147
mysql-test/r/insert_update.result:
Updated tests after changing how INSERT ... SELECT .. ON DUPLICATE KEY works
mysql-test/t/insert_select.test:
More tests for bug #9728 and #8147
mysql-test/t/insert_update.test:
Updated tests after changing how INSERT ... SELECT .. ON DUPLICATE KEY works
mysys/my_access.c:
Cleanup (shorter loop variable names)
sql/ha_ndbcluster.cc:
Indentation fixes
sql/item.cc:
Remove item_flags
sql/item.h:
Remove item_flags
sql/mysql_priv.h:
New arguments to mysql_prepare_insert
sql/sql_base.cc:
Remove old fix for bug #8147
sql/sql_insert.cc:
Extend mysql_prepare_insert() with new field list for tables that can be used in the values port of ON DUPLICATE KEY UPDATE
sql/sql_parse.cc:
Revert fix for #9728
Allow one to use other tables in ON DUPLICATE_KEY for INSERT ... SELECT if there is no GROUP BY clause
sql/sql_prepare.cc:
New arguments to mysql_prepare_insert
sql/sql_yacc.yy:
Revert bug fix for #9728
Fix for fix for bug#9728 decreased functionality in "on duplicate key update"
Have to return false to set flag for whole expression.
sql/item.h:
Fix for fix for bug#9728 decreased functionality in "on duplicate key update"
Have to return false to set flag for whole expression.
Remove changes made by bug fix#8147. They strips list of insert_table_list to
only insert table, which results in error reported in bug #9728.
Added flag to Item to resolve ambigous fields reported in bug #8147.
sql/item.h:
Fix bug#9728 decreased functionality in "on duplicate key update".
sql/item.cc:
Fix bug#9728 decreased functionality in "on duplicate key update"
sql/sql_parse.cc:
Fix bug#9728 decreased functionality in "on duplicate key update"
sql/sql_base.cc:
Fix bug#9728 decreased functionality in "on duplicate key update".
sql/sql_yacc.yy:
Fix bug#9728 decreased functionality in "on duplicate key update"
mysql-test/t/insert_select.test:
Test case for bug#9728 Decreased functionality in "on duplicate key update".
mysql-test/r/insert_select.result:
Test case for bug#9728 Decreased functionality in "on duplicate key update".
Fixed bug #11088: a crash for queries with GROUP BY a BLOB column
+ COUNT(DISTINCT...) due to an attempt to allocate a too large
buffer for the BLOB field.
Now the size of the buffer is limited by max_sort_length.
group_by.test, group_by.result:
Added a test case for bug #11088.
mysql-test/r/group_by.result:
Added a test case for bug #11088.
mysql-test/t/group_by.test:
Added a test case for bug #11088.
sql/item.h:
Fixed bug #11088: a crash for queries with GROUP BY a BLOB column
+ COUNT(DISTINCT...) due to an attempt to allocate a too large
buffer for the BLOB fields.
Now the size of the buffer is limited by max_sort_length.
sql/item_buff.cc:
Fixed bug #11088: a crash for queries with GROUP BY a BLOB column
+ COUNT(DISTINCT...) due to an attempt to allocate a too large
buffer for the BLOB fields.
Now the size of the buffer is limited by max_sort_length.
sql/sql_select.cc:
Fixed bug #11088: a crash for queries with GROUP BY a BLOB column
+ COUNT(DISTINCT...) due to an attempt to allocate a too large
buffer for the BLOB fields.
Now the size of the buffer is limited by max_sort_length.
should return a non empty one"
(see comments for the changed files for details).
mysql-test/r/ps.result:
A test case for Bug#9777: tests results fixed.
mysql-test/t/ps.test:
A test case for Bug#9777
sql/item.cc:
A fix for Bug#9777: when creating a constant item from within
Item_int_with_ref::new_item, create the item by value, not by name.
This should work with prepared statements placeholders.
Item_int_with_ref is a special optimization case used
when we compare datetime constants with datetime value.
Converting the item to integer early is OK as it is in line
with the purpose of Item_int_with_ref - to speed up comparison by
using integers.
Minor cleanups.
sql/item.h:
Declaration for Item_int_with_ref::new_item
- Introduce ifdefs so we can control when to use #pragma interface on cygwin
include/my_global.h:
Turn on use of #pragma implementation and #pragma interface if compiled with GCC and platform != Cygwin
include/raid.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/examples/ha_archive.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/examples/ha_example.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/field.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_berkeley.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_blackhole.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_heap.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_innodb.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_isam.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_isammrg.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_myisam.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_myisammrg.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_ndbcluster.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/handler.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_cmpfunc.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_func.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_geofunc.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_strfunc.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_subselect.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_sum.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_timefunc.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/opt_range.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/procedure.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/protocol.h:
replace __GNUC__ with USE_PRAGMA_IMPLEMENTATION
sql/set_var.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/sql_class.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/sql_list.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/sql_select.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/sql_string.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/sql_udf.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/tztime.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
records if prepared statements is used".
This fix changes equality evaluation method of basic constants from
by-name to by-value, thus effectively enabling use of parameter markers
in some optimizations (constants propagation, evaluation of possible
keys for query).
mysql-test/r/ps.result:
Test results for the test case for Bug#9096
mysql-test/t/ps.test:
A short test case for Bug#9096 "select doesn't return all matched records if
prepared statements is used". The is enough to reproduce the
glitch in update_ref_and_keys causing the bug to occur.
sql/item.cc:
Implement by-value equality evaluation of basic constants.
This is needed to work with Item_param values. Until now
Item_param was compared with other items by its name, which is always "?".
The bug at hand showed up when an integer
constant was created from one parameter marker (with value 200887 and
name "?") and then compared by-name with another parameter marker
(with value 860 and name "?"). True returned by this comparison resulted
in a wrong table access method used to evaluate the query.
Implement Item_param methods needed to emulate "basic constant" mode at
full.
sql/item.h:
Change declaration of basic_const_item(): now it also widens its
argument from const Item * to Item * if the argument is a basic constant.
Declare eq() for all basic constatns, as long as now they
are compared by value, not by name. Each constant needs its own
comparison method.
Declarations of Item_param methods needed to fully emulate
a basic constant when parameter value is set.
sql/item_func.cc:
Fix wrong casts.
Produce warnings of wrong cast of strings to signed/unsigned.
Don't block not resolved IP's if DNS server is down (Bug #8467)
Fix compiler problems with MinGW (Bug #8872)
configure.in:
Fix compiler problems with MinGW (Bug #8872)
include/config-win.h:
Fix compiler problems with MinGW (Bug #8872)
include/my_global.h:
Fix compiler problems with MinGW (Bug #8872)
mysql-test/r/cast.result:
Test for cast to signed/unsigned outside of range (Bug #7036)
mysql-test/t/cast.test:
Test for cast to signed/unsigned outside of range (Bug #7036)
mysys/default.c:
Cleanup (combine identical code).
Done mainly by Jani
sql/field.h:
Added cast_to_int_type() to ensure that enums are casted as numbers
sql/hostname.cc:
Don't block not resolved IP's if DNS server is down (Bug #8467)
sql/item.h:
Added cast_to_int_type() to ensure that enums are casted as numbers
sql/item_func.cc:
CAST(string_argument AS UNSIGNED) didn't work for big integers above the
signed range. (Bug #7036)
Produce warnings of wrong cast of strings to signed/unsigned
sql/item_func.h:
CAST(string_argument AS UNSIGNED) didn't work for big integers above the
signed range. (Bug #7036)
- Add function Item_param::fix_fields which will update any subselect they are part of and indicate that the subsleect is not const during prepare phase, and thus should not be executed during prepare.
mysql-test/include/ps_query.inc:
Adde new test case
mysql-test/r/ps_2myisam.result:
Update test result
mysql-test/r/ps_3innodb.result:
Update test result
mysql-test/r/ps_4heap.result:
Update test result
mysql-test/r/ps_5merge.result:
Update test result
mysql-test/r/ps_6bdb.result:
Update test result
mysql-test/r/ps_7ndb.result:
Update test result
sql/item.cc:
Add function Item_param::fix_fields, which will mark any subselects they are part of as not being a constant expression unless the param value is specified, ie. it will be not be constant during prepare phase.
sql/item.h:
Adde Item_param::fix_fields
sql/item_subselect.h:
Make Item_param::fix_field friend of Item_subselect
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
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
Added a test case for bug #8616.
item.h:
Fixed bug #8616.
Added class Item_null_result used in rollup processing.
sql_select.h, sql_select.cc:
Fixed bug #8616.
Added JOIN::rollup_write_data to cover rollup queries
with DISTINCT. Modified other rollup methods.
sql/sql_select.cc:
Fixed bug #8616.
Added JOIN::rollup_write_data to cover rollup queries
with DISTINCT. Modified other rollup methods.
sql/sql_select.h:
Fixed bug #8616.
Added JOIN::rollup_write_data to cover rollup queries
with DISTINCT. Modified other rollup methods.
sql/item.h:
Fixed bug #8616.
Added class Item_null_result used in rollup processing.
mysql-test/t/olap.test:
Added a test case for bug #8616.
mysql-test/r/olap.result:
Added a test case for bug #8616.
fixing test results accordingly.
func_system.test:
New test that illegal mix of collations does not happen anymore.
item_strfunc.h:
safe_charset_converter() was added for system constants.
item_strfunc.cc:
safe_charset_converter() was added for system constants.
item_func.cc, item.h, item.cc:
Bug#8291: Illegal collation mix with USER() function.
After discussion with PeterG and Serge, a new coercibility
level for "system constants" was introduced, between
COERRIBLE and IMPLICIT. Thus:
SELECT col1 = USER() FROM t1; - is done according to col1 collation.
SELECT 'string' = USER(); - is done according to USER() collation.
At the same time, "nagg" and "strong" members were removed as unused.
item_create.cc:
Version is a system constant too.
sql/item.cc:
Bug#8291: Illegal collation mix with USER() function.
After discussion with PeterG and Serge, a new coercibility
level for "system constants" was introduced, between
COERRIBLE and IMPLICIT. Thus:
SELECT col1 = USER() FROM t1; - is done according to col1 collation.
SELECT 'string' = USER(); - is done according to USER() collation.
At the same time, "nagg" and "strong" members were removed as unused.
sql/item.h:
Bug#8291: Illegal collation mix with USER() function.
After discussion with PeterG and Serge, a new coercibility
level for "system constants" was introduced, between
COERRIBLE and IMPLICIT. Thus:
SELECT col1 = USER() FROM t1; - is done according to col1 collation.
SELECT 'string' = USER(); - is done according to USER() collation.
At the same time, "nagg" and "strong" members were removed as unused.
sql/item_create.cc:
Version is a system constant too.
sql/item_func.cc:
Bug#8291: Illegal collation mix with USER() function.
After discussion with PeterG and Serge, a new coercibility
level for "system constants" was introduced, between
COERRIBLE and IMPLICIT. Thus:
SELECT col1 = USER() FROM t1; - is done according to col1 collation.
SELECT 'string' = USER(); - is done according to USER() collation.
At the same time, "nagg" and "strong" members were removed as unused.
sql/item_strfunc.cc:
safe_charset_converter() was added for system constants.
sql/item_strfunc.h:
safe_charset_converter() was added for system constants.
mysql-test/t/func_system.test:
New test that illegal mix of collations does not happen anymore.
mysql-test/r/ctype_collate.result:
fixing test results accordingly.
mysql-test/r/func_str.result:
fixing test results accordingly.
mysql-test/r/func_system.result:
fixing test results accordingly.
mysql-test/r/type_blob.result:
fixing test results accordingly.
depending on ref->unsigned_flag. Item_int_with_ref can refer to both signed and
unsigned integers.
mysql-test/r/bigint.result:
Test case for BUG#8562
mysql-test/t/bigint.test:
Test case for BUG#8562
Change string->float conversion to delay division as long as possible.
This gives us more exact integer->float conversion for numbers of type '123.45E+02' (Bug #7740)
client/mysql.cc:
Fix wront usage of charset (found during review of pushed code)
include/m_string.h:
Backported my_strtod() from 5.0
mysql-test/mysql-test-run.sh:
Run also mysql_client_test with --debug
mysql-test/r/ps_1general.result:
Safety fix (if mysql_client_test.test fails)
mysql-test/r/type_float.result:
More test
mysql-test/t/mysql_client_test.test:
Comments for what to do if this test fails
mysql-test/t/ps_1general.test:
Safety fix (if mysql_client_test.test fails)
mysql-test/t/type_float.test:
More test to better test new strtod() function
Test also bug #7740 (wrong comparsion between integer and float-in-integer-range)
sql/field.cc:
Backport my_strntod() from 5.0
sql/item.cc:
Backport my_strntod() from 5.0
sql/item.h:
Backport my_strntod() from 5.0
sql/item_func.h:
Backport my_strntod() from 5.0
sql/item_strfunc.cc:
Backport my_strntod() from 5.0
sql/item_sum.cc:
Backport my_strntod() from 5.0
sql/item_sum.h:
Backport my_strntod() from 5.0
sql/procedure.h:
Backport my_strntod() from 5.0
strings/ctype-simple.c:
Backport my_strntod() from 5.0
strings/ctype-ucs2.c:
Backport my_strntod() from 5.0
strings/strtod.c:
Backport my_strntod() from 5.0
Change conversion to delay division as long as possible.
This gives us more exact integer-> float conversion for numbers of type '123.45E+02'
Revised the fix for bug #7098.
Corrected the method Item_string::new_item.
sql_select.cc:
Revised the fix for bug #7098.
Aborted the previous modifications.
sql/sql_select.cc:
Revised the fix for bug #7098.
Aborted the previous modifications.
sql/item.h:
Revised the fix for bug #7098.
Corrected the method Item_string::new_item.
delete is declared. As we don't use exceptions placement delete is never
called and the fix only affects numerous warnings when
compiling with MS Visual C++.
For more info see http://www.gotw.ca/gotw/010.htm.
sql/item.h:
Fix the signature of placement operator delete for class Item.
sql/sql_class.cc:
Add placement delete operator to suppress a warning under Windows.
sql/sql_lex.h:
Fix the signature of placement operator delete for class LEX
sql/sql_list.h:
Fix the signature of placement operator delete for class Sql_alloc
sql/sql_string.h:
Fix the signature of placement operator delete for class Sql_string
Ensure that references in HAVING, ORDER BY or GROUP BY are calculated after fields in SELECT.
This will ensure that any reference to these has a valid value.
Generalized the code for split_sum_func()
BitKeeper/etc/ignore:
added support-files/ndb-config-2-node.ini
mysql-test/r/group_by.result:
More complicated test to assure that rand() is only calulated once
mysql-test/r/user_var.result:
Back to old results :( (ok but not perfect)
mysql-test/t/group_by.test:
More complicated test to assure that rand() is only calulated once
sql/item.cc:
Better bugfix for "HAVING when refering to RAND()"
This will ensure that when refering to things like RAND() in HAVING through an alias we will not recalculate that rand() value in the HAVING part but use the value in the row
Generalize split_sum_func()
sql/item.h:
Better bugfix for "HAVING when refering to RAND()"
T
sql/item_cmpfunc.cc:
Better bugfix for "HAVING when refering to RAND()"
Use generalized split_sum_func2() function
sql/item_func.cc:
Better bugfix for "HAVING when refering to RAND()"
Use generalized split_sum_func2() function
sql/item_row.cc:
Better bugfix for "HAVING when refering to RAND()"
Use generalized split_sum_func2() function
sql/item_strfunc.cc:
Better bugfix for "HAVING when refering to RAND()"
Use generalized split_sum_func2() function
sql/sql_list.h:
Add functions to concatenate lists
sql/sql_select.cc:
Better bugfix for "HAVING when refering to RAND()"
Ensure that references in HAVING, ORDER BY or GROUP BY are calculated after fields in SELECT.
This will ensure that any reference to these has a valid value.
bug#7833: Wrong datatype of aggregate column is returned
mysql-test/r/func_group.result:
Test case for bug 7833: Wrong datatype of aggregate column is returned
mysql-test/r/union.result:
Test case for bug 6931: Date Type column problem when using UNION-Table.
mysql-test/t/func_group.test:
Test case for bug 7833: Wrong datatype of aggregate column is returned
mysql-test/t/union.test:
Test case for bug 6931: Date Type column problem when using UNION-Table.
sql/item.h:
A quick fix for bug #7257: Crash in default tests: 'subselect'
We have to pass &item instead of &store to the Item_ref_null_helper()
then set ref.
* Backport of safety measures from 5.0: make numeorous replaces:
s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/item.cc:
* More comments
* Backport of safety measures from 5.0: make numeorous replaces:
s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/item.h:
Assert added
sql/item_cmpfunc.cc:
Backport of safety measures from 5.0: make numeorous replaces:
s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/item_func.cc:
Backport of safety measures from 5.0: make numeorous replaces:
s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/item_strfunc.h:
Backport of safety measures from 5.0: make numeorous replaces:
s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/item_subselect.cc:
Backport of safety measures from 5.0: make numeorous replaces:
s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/item_sum.cc:
Backport of safety measures from 5.0: make numeorous replaces:
s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/set_var.cc:
Backport of safety measures from 5.0: make numeorous replaces:
s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/sql_base.cc:
Backport of safety measures from 5.0: make numeorous replaces:
s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/sql_handler.cc:
Backport of safety measures from 5.0: make numeorous replaces:
s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/sql_help.cc:
Backport of safety measures from 5.0: make numeorous replaces:
s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/sql_select.cc:
Backport of safety measures from 5.0: make numeorous replaces:
s/item->fix_fields()/if (!item->fixed) item->fix_fields()
* Added Item_ref::set_properties
* Item_ref::Item_ref now expects to get in *item either
NULL - then fix_fields() will be called later or
ptr to Item it will refer to - then an equivalent of fix_fields() call is performed
sql/item.cc:
Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0
* Added Item_ref::set_properties
* Adjusted Item_ref::Item_ref calls to match new calling convention
sql/item.h:
Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0
* Added Item_ref::set_properties
* Item_ref::Item_ref now expects to get in *item either
NULL - then fix_fields() will be called later or
ptr to Item it will refer to - then an equivalent of fix_fields() call is performed
sql/item_cmpfunc.cc:
Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0
* Adjusted Item_ref::Item_ref calls to match new calling convention
sql/item_func.cc:
Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0
* Added Item_ref::set_properties
* Adjusted Item_ref::Item_ref calls to match new calling convention
sql/item_row.cc:
Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0
* Added Item_ref::set_properties
* Adjusted Item_ref::Item_ref calls to match new calling convention
sql/item_strfunc.cc:
Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0
* Added Item_ref::set_properties
* Adjusted Item_ref::Item_ref calls to match new calling convention
The problem in 4.1 was the same as in 4.0 - fix_fields() not called for created Item_ref.
The fix is similar too - initialize Item_refs in ctor (but don't interfere with cases when
Item_ref is used by subselects).
sql/item.cc:
Fix for BUG#6976 ported from 4.0
sql/item_cmpfunc.cc:
Fix for BUG#6976 ported from 4.0
sql/item_func.cc:
Fix for BUG#6976 ported from 4.0
sql/item_row.cc:
Fix for BUG#6976 ported from 4.0
sql/item_strfunc.cc:
Fix for BUG#6976 ported from 4.0
refernces if subqueri is not in HAVING clause (BUG#7079)
and the same used for subquery transformetion
mysql-test/r/subselect.result:
reference on changable fields from subquery
mysql-test/t/subselect.test:
reference on changable fields from subquery
sql/item.cc:
new reference which refer to current value not to result used
sql/item.h:
new reference which refer to current value not to result used
sql/item_subselect.cc:
new reference which refer to current value not to result used