Bug #48370 Absolutely wrong calculations with GROUP BY and
decimal fields when using IF
Added the test cases in the above two bugs for regression
testing.
Added additional tests that demonstrate a incomplete fix.
Added a new factory method for Field_new_decimal to
create a field from an (decimal returning) Item.
In the new method made sure that all the precision and
length variables are capped in a proper way.
This is required because Item's can have larger precision
than the decimal fields and thus need to be capped when
creating a field based on an Item type.
Fixed the wrong typecast to Item_decimal.
MySQL manual describes values of the YEAR(2) field type as follows:
values 00 - 69 mean 2000 - 2069 years and values 70 - 99 mean 1970 - 1999
years. MIN/MAX and comparison functions was comparing them as int values
thus producing wrong result.
Now the Arg_comparator class is extended with compare_year function which
performs correct comparison of the YEAR type.
The Item_sum_hybrid class now uses Item_cache and Arg_comparator objects to
correctly calculate its value.
To allow Arg_comparator to use func_name() function for Item_func and Item_sum
objects the func_name declaration is moved to the Item_result_field class.
A helper function is_owner_equal_func is added to the Arg_comparator class.
It checks whether the Arg_comparator object owner is the <=> function or not.
A helper function setup is added to the Item_sum_hybrid class. It sets up
cache item and comparator.
mysql-test/r/func_group.result:
Added a test case for the bug#43668.
mysql-test/t/func_group.test:
Added a test case for the bug#43668.
sql/item.cc:
Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
Now Item_cache_int returns the type of cached item.
sql/item.h:
Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
To allow Arg_comparator to use func_name() function for Item_func and Item_sum
objects the func_name declaration is moved to the Item_result_field class.
sql/item_cmpfunc.cc:
Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
The Arg_comparator class is extended with compare_year function which
performs correct comparison of the YEAR type.
sql/item_cmpfunc.h:
Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
The year_as_datetime variable is added to the Arg_comparator class.
It's set to TRUE when YEAR value should be converted to the
YYYY-00-00 00:00:00 format for correct YEAR-DATETIME comparison.
sql/item_geofunc.cc:
Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
Item_func_spatial_rel::val_int chenged to use Arg_comparator's string
buffers.
sql/item_subselect.h:
Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
Added an implementation of the virtual func_name function.
sql/item_sum.cc:
Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
The Item_sum_hybrid class now uses Item_cache and Arg_comparator objects to
correctly calculate its value.
A helper function setup is added to the Item_sum_hybrid class. It sets up
cache item and comparator.
sql/item_sum.h:
Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
The Item_sum_hybrid class now uses Item_cache and Arg_comparator objects to
correctly calculate its value.
Added an implementation of the virtual func_name function.
The problem was that creating a DECIMAL column from a decimal
value could lead to a failed assertion as decimal values can
have a higher precision than those attached to a table. The
assert could be triggered by creating a table from a decimal
with a large (> 30) scale. Also, there was a problem in
calculating the number of digits in the integral and fractional
parts if both exceeded the maximum number of digits permitted
by the new decimal type.
The solution is to ensure that truncation procedure is executed
when deducing a DECIMAL column from a decimal value of higher
precision. If the integer part is equal to or bigger than the
maximum precision for the DECIMAL type (65), the integer part
is truncated to fit and the fractional becomes zero. Otherwise,
the fractional part is truncated to fit into the space left
after the integer part is copied.
This patch borrows code and ideas from Martin Hansson's patch.
mysql-test/r/type_newdecimal.result:
Add test case result for Bug#45261. Also, update test case to
reflect that an additive operation increases the precision of
the resulting type by 1.
mysql-test/t/type_newdecimal.test:
Add test case for Bug#45261
sql/field.cc:
Added DBUG_ASSERT to ensure object's invariant is maintained.
Implement method to create a field to hold a decimal value
from an item.
sql/field.h:
Explain member variable. Add method to create a new decimal field.
sql/item.cc:
The precision should only be capped when storing the value
on a table. Also, this makes it impossible to calculate the
integer part if Item::decimals (the scale) is larger than the
precision.
sql/item.h:
Simplify calculation of integer part.
sql/item_cmpfunc.cc:
Do not limit the precision. It will be capped later.
sql/item_func.cc:
Use new method for allocating a new decimal field.
Add a specialized method for retrieving the precision
of a user variable item.
sql/item_func.h:
Add method to return the precision of a user variable.
sql/item_sum.cc:
Use new method for allocating a new decimal field.
sql/my_decimal.h:
The integer part could be improperly calculated for a decimal
with 31 digits in the fractional part.
sql/sql_select.cc:
Use new method which truncates the integer or decimal parts
as needed.
sort_buffer_size cannot allocate
The NULL return from tree_insert() (on low memory) was not
checked for in Item_func_group_concat::add(). As a result
on low memory conditions a crash happens.
Fixed by properly checking the return code.
Using DECIMAL constants with more than 65 digits in CREATE
TABLE ... SELECT led to bogus errors in release builds or
assertion failures in debug builds.
The problem was in inconsistency in how DECIMAL constants and
fields are handled internally. We allow arbitrarily long
DECIMAL constants, whereas DECIMAL(M,D) columns are limited to
M<=65 and D<=30. my_decimal_precision_to_length() was used in
both Item and Field code and truncated precision to
DECIMAL_MAX_PRECISION when calculating value length without
adjusting precision and decimals. As a result, a DECIMAL
constant with more than 65 digits ended up having length less
than precision or decimals which led to assertion failures.
Fixed by modifying my_decimal_precision_to_length() so that
precision is truncated to DECIMAL_MAX_PRECISION only for Field
object which is indicated by the new 'truncate' parameter.
Another inconsistency fixed by this patch is how DECIMAL
constants and expressions are handled for CREATE ... SELECT.
create_tmp_field_from_item() (which is used for constants) was
changed as a part of the bugfix for bug #24907 to handle long
DECIMAL constants gracefully. Item_func::tmp_table_field()
(which is used for expressions) on the other hand was still
using a simplistic approach when creating a Field_new_decimal
from a DECIMAL expression.
mysql-test/r/type_newdecimal.result:
Added a test case for bug #45262.
mysql-test/t/type_newdecimal.test:
Added a test case for bug #45262.
sql/item.cc:
Use the new 'truncate' parameter in
my_decimal_precision_to_length().
sql/item_cmpfunc.cc:
Use the new 'truncate' parameter in
my_decimal_precision_to_length().
sql/item_func.cc:
1. Use the new 'truncate' parameter in
my_decimal_precision_to_length().
2. Do not truncate decimal precision to DECIMAL_MAX_PRECISION
for additive expressions involving long DECIMAL constants.
3. Fixed an incosistency in how DECIMAL constants and
expressions are handled for CREATE ... SELECT.
sql/item_func.h:
Use the new 'truncate' parameter in
my_decimal_precision_to_length().
sql/item_sum.cc:
Use the new 'truncate' parameter in
my_decimal_precision_to_length().
sql/my_decimal.h:
Do not truncate precision to DECIMAL_MAX_PRECISION
when calculating length in
my_decimal_precision_to_length() if 'truncate' parameter
is FALSE.
sql/sql_select.cc:
1. Use the new 'truncate' parameter in
my_decimal_precision_to_length().
2. Use a more correct logic when adjusting value's length.
with gcc 4.3.2
Compiling MySQL with gcc 4.3.2 and later produces a number of
warnings, many of which are new with the recent compiler
versions.
This bug will be resolved in more than one patch to limit the
size of changesets. This is the first patch, fixing a number
of the warnings, predominantly "suggest using parentheses
around && in ||", and empty for and while bodies.
with gcc 4.3.2
Compiling MySQL with gcc 4.3.2 and later produces a number of
warnings, many of which are new with the recent compiler
versions.
This bug will be resolved in more than one patch to limit the
size of changesets. This is the first patch, fixing a number
of the warnings, predominantly "suggest using parentheses
around && in ||", and empty for and while bodies.
The copy of the original arguments of a aggregate function was not
initialized until after fix_fields().
Sometimes (e.g. when there's an error processing the statement)
the print() can be called with no corresponding fix_fields() call.
Fixed by adding a check if the Item is fixed before using the arguments
copy.
mysql-test/r/explain.result:
Bug #43354: test case
mysql-test/t/explain.test:
Bug #43354: test case
sql/item_sum.cc:
Bug #43354: use the argument list copy only if it's initialized
Related to operator precedence and associativity.
Make the expressions as explicit as possible.
sql/field.h:
Silence gcc-4.3 warning: be more explicit.
sql/item.cc:
Silence gcc-4.3 warning: be more explicit.
sql/item_sum.cc:
Silence gcc-4.3 warning: be more explicit.
sql/log_event.cc:
Silence gcc-4.3 warning: be more explicit.
sql/spatial.h:
Silence gcc-4.3 warning: be more explicit.
sql/sql_lex.cc:
Silence gcc-4.3 warning: be more explicit.
sql/table.h:
Silence gcc-4.3 warning: be more explicit.
storage/federated/ha_federated.cc:
Fix operator precedence bug.
storage/heap/ha_heap.cc:
Silence gcc-4.3 warning: be more explicit.
crashes server
When creating temporary table that contains aggregate functions a
non-reversible source transformation was performed to redirect aggregate
function arguments towards temporary table columns.
This caused EXPLAIN EXTENDED to fail because it was trying to resolve
references to the (freed) temporary table.
Fixed by preserving the original aggregate function arguments and
using them (instead of the transformed ones) for EXPLAIN EXTENDED.
mysql-test/r/explain.result:
Bug#34773: test case
mysql-test/t/explain.test:
Bug#34773: test case
sql/item.cc:
Bug#34773: use accessor functions instead of public members
sql/item_sum.cc:
Bug#34773:
- Encapsulate the arguments into Item_sum and
provide accessor and mutator methods
- print the orginal arguments (if present)
in EXPLAIN EXTENDED
- preserve the original arguments list.
sql/item_sum.h:
Bug#34773:
- Encapsulate the arguments into Item_sum and
provide accessor and mutator methods
- print the orginal arguments (if present)
in EXPLAIN EXTENDED
- preserve the original arguments list.
sql/opt_range.cc:
Bug#34773: use accessor functions instead of public members
sql/opt_sum.cc:
Bug#34773: use accessor functions instead of public members
sql/sql_select.cc:
Bug#34773: use accessor functions instead of public members
into magare.gmz:/home/kgeorge/mysql/work/B35298-5.1-bugteam
mysql-test/r/func_gconcat.result:
Auto merged
mysql-test/t/func_gconcat.test:
Auto merged
sql/item_sum.cc:
Auto merged
configure.in:
merge 5.0-bugteam to 5.1-bugteam
The bug is a regression introduced by the patch for bug32798.
The code in Item_func_group_concat::clear() relied on the 'distinct'
variable to check if 'unique_filter' was initialized. That, however,
is not always valid because Item_func_group_concat::setup() can do
shortcuts in some cases w/o initializing 'unique_filter'.
Fixed by checking the value of 'unique_filter' instead of 'distinct'
before dereferencing.
mysql-test/r/func_gconcat.result:
Added test cases for bugs #35298 and #36024.
mysql-test/t/func_gconcat.test:
Added test cases for bugs #35298 and #36024.
sql/item_sum.cc:
Check if unique_filter != NULL before dereferencing it. Non-zero value
of distinct does not always mean that unique_filter is initialized
because Item_func_group_concat::setup() can do shortcuts is some cases
into moonbone.local:/work/27219-bug-5.1
sql/item_subselect.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_sum.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_select.cc:
Auto merged
mysql-test/r/group_by.result:
SCCS merged
mysql-test/t/group_by.test:
SCCS merged
sql/item.cc:
SCCS merged
sql/sql_lex.h:
SCCS merged
into moonbone.local:/work/27219-5.0-opt-mysql
sql/item.cc:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_select.cc:
Auto merged
Mixing aggregate functions and non-grouping columns is not allowed in the
ONLY_FULL_GROUP_BY mode. However in some cases the error wasn't thrown because
of insufficient check.
In order to check more thoroughly the new algorithm employs a list of outer
fields used in a sum function and a SELECT_LEX::full_group_by_flag.
Each non-outer field checked to find out whether it's aggregated or not and
the current select is marked accordingly.
All outer fields that are used under an aggregate function are added to the
Item_sum::outer_fields list and later checked by the Item_sum::check_sum_func
function.
mysql-test/t/group_by.test:
Added a test case for the bug#27219: Aggregate functions in ORDER BY.
mysql-test/r/group_by.result:
Added a test case for the bug#27219: Aggregate functions in ORDER BY.
sql/sql_select.cc:
Bug#27219: Aggregate functions in ORDER BY.
Implementation of new check for mixing non aggregated fields and aggregation
function in the ONLY_FULL_GROUP_BY mode.
sql/sql_lex.cc:
Bug#27219: Aggregate functions in ORDER BY.
Initialization of the full_group_by_flag bitmap.
SELECT_LEX::test_limit function doesn't reset ORDER BY
clause anymore.
sql/sql_lex.h:
Bug#27219: Aggregate functions in ORDER BY.
The full_group_by_flag is added to the SELECT_LEX class.
sql/item_sum.h:
Bug#27219: Aggregate functions in ORDER BY.
The outer_fields list is added to the Item_sum class.
sql/mysql_priv.h:
Bug#27219: Aggregate functions in ORDER BY.
Defined a set of constants used in the new check for mixing non aggregated
fields and sum functions in the ONLY_FULL_GROUP_BY_MODE.
sql/item_subselect.cc:
Bug#27219: Aggregate functions in ORDER BY.
The Item_in_subselect::select_in_like_transformer function now drops
ORDER BY clause in all selects in a subquery.
sql/item_sum.cc:
Bug#27219: Aggregate functions in ORDER BY.
Now the Item_sum::check_sum_func function now checks whether fields in the
outer_fields list are aggregated or not and marks selects accordingly.
sql/item.cc:
Bug#27219: Aggregate functions in ORDER BY.
Now the Item_field::fix_fields function checks whether the field is aggregated
or not and marks its select_lex accordingly.
into kaamos.(none):/data/src/opt/bug34512/my51
mysql-test/r/func_group.result:
Auto merged
mysql-test/t/func_group.test:
Auto merged
sql/item_sum.cc:
Auto merged
into kaamos.(none):/data/src/opt/mysql-5.1-opt
client/mysql.cc:
Auto merged
client/mysqldump.c:
Auto merged
configure.in:
Auto merged
include/my_global.h:
Auto merged
libmysql/libmysql.c:
Auto merged
libmysqld/lib_sql.cc:
Auto merged
mysql-test/include/mix1.inc:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/func_str.result:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/innodb_mysql.result:
Auto merged
mysql-test/r/select.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/t/create.test:
Auto merged
mysql-test/t/disabled.def:
Auto merged
sql/filesort.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_sum.cc:
Auto merged
sql/log.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_plugin.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
storage/ndb/src/kernel/blocks/backup/Backup.hpp:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/r/func_time.result:
Manual merge.
mysql-test/r/view.result:
Manual merge.
mysql-test/t/view.test:
Manual merge.
scripts/mysql_config.sh:
Manual merge.
sql-common/client.c:
Manual merge.
sql/sql_parse.cc:
Manual merge.
returns wrong results
Casting AVG() to DECIMAL led to incorrect results when the arguments
had a non-DECIMAL type, because in this case
Item_sum_avg::val_decimal() performed the division by the number of
arguments twice.
Fixed by changing Item_sum_avg::val_decimal() to not rely on
Item_sum_sum::val_decimal(), i.e. calculate sum and divide using
DECIMAL arithmetics for DECIMAL arguments, and utilize val_real() with
subsequent conversion to DECIMAL otherwise.
mysql-test/r/func_group.result:
Added a test case for bug #34512.
mysql-test/t/func_group.test:
Added a test case for bug #34512.
sql/item_sum.cc:
Do not use Item_sum_sum::val_decimal() in Item_sum_avg::val_decimal()
because the first one, depending on the arguments type, may return
either the sum of the arguments, or the average calculated by the
virtual val_real() method of Item_sum_avg. Instead, do our own
calculation based on the arguments type.
into magare.gmz:/home/kgeorge/mysql/work/B34747-5.1-opt
libmysql/libmysql.c:
Auto merged
libmysqld/lib_sql.cc:
Auto merged
mysql-test/r/func_gconcat.result:
Auto merged
mysql-test/t/func_gconcat.test:
Auto merged
sql/item_sum.cc:
Auto merged
sql/log.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/subselect.result:
merged bug 34747 and 33266 5.0-opt->5.1-opt
mysql-test/t/subselect.test:
merged bug 34747 and 33266 5.0-opt->5.1-opt
Was a double-free of the Unique member of Item_func_group_concat.
This was not causing a crash because the Unique is a descendent of
Sql_alloc.
Fixed to free the Unique only if it was allocated for the instance
of Item_func_group_concat it was referenced from
mysql-test/r/func_gconcat.result:
Bug #34747: test case
mysql-test/t/func_gconcat.test:
Bug #34747: test case
sql/item_sum.cc:
Bug #34747: free the Unique only if it was allocated
for this instance of Item_func_group_concat
into kaamos.(none):/data/src/opt/bug33049/my51-bug33790
mysql-test/r/view.result:
Auto merged
sql/item_sum.cc:
Auto merged
mysql-test/t/view.test:
Manual merge.
between 5.0 and 5.1.
The problem was that in the patch for Bug#11986 it was decided
to store original query in UTF8 encoding for the INFORMATION_SCHEMA.
This approach however turned out to be quite difficult to implement
properly. The main problem is to preserve the same IS-output after
dump/restore.
So, the fix is to rollback to the previous functionality, but also
to fix it to support multi-character-set-queries properly. The idea
is to generate INFORMATION_SCHEMA-query from the item-tree after
parsing view declaration. The IS-query should:
- be completely in UTF8;
- not contain character set introducers.
For more information, see WL4052.
mysql-test/include/ddl_i18n.check_views.inc:
Add a test case for Bug#30217.
mysql-test/r/ddl_i18n_koi8r.result:
Update result file.
mysql-test/r/ddl_i18n_utf8.result:
Update result file.
mysql-test/r/information_schema.result:
Update result file.
mysql-test/r/information_schema_db.result:
Update result file.
mysql-test/r/mysqldump.result:
Update result file.
mysql-test/r/show_check.result:
Update result file.
mysql-test/t/ddl_i18n_koi8r.test:
Add a test case for Bug#30217.
mysql-test/t/ddl_i18n_utf8.test:
Add a test case for Bug#30217.
mysql-test/t/mysqldump.test:
Add a test case for Bug#30217.
sql/ha_ndbcluster.cc:
Add a parameter to print().
sql/item.cc:
1. Add a parameter to print().
2. Item_string::print():
- Do not append character set introducer to the text literal
if we're building a query for INFORMATION_SCHEMA;
- Convert text literal to UTF8 if we're building a query
for INFORMATION_SCHEMA.
sql/item.h:
Add a parameter to print().
sql/item_cmpfunc.cc:
Add a parameter to print().
sql/item_cmpfunc.h:
Add a parameter to print().
sql/item_func.cc:
Add a parameter to print().
sql/item_func.h:
Add a parameter to print().
sql/item_geofunc.h:
Add a parameter to print().
sql/item_row.cc:
Add a parameter to print().
sql/item_row.h:
Add a parameter to print().
sql/item_strfunc.cc:
Add a parameter to print().
sql/item_strfunc.h:
Add a parameter to print().
sql/item_subselect.cc:
Add a parameter to print().
sql/item_subselect.h:
Add a parameter to print().
sql/item_sum.cc:
Add a parameter to print().
sql/item_sum.h:
Add a parameter to print().
sql/item_timefunc.cc:
Add a parameter to print().
sql/item_timefunc.h:
Add a parameter to print().
sql/mysql_priv.h:
Add a parameter to print().
sql/sp_head.cc:
Add a parameter to print().
sql/sql_lex.cc:
Add a parameter to print().
sql/sql_lex.h:
Add a parameter to print().
sql/sql_parse.cc:
Add a parameter to print().
sql/sql_select.cc:
Add a parameter to print().
sql/sql_show.cc:
Add a parameter to print().
sql/sql_test.cc:
Add a parameter to print().
sql/sql_view.cc:
Build INFORMATION_SCHEMA query from Item-tree.
sql/sql_yacc.yy:
Build INFORMATION_SCHEMA query from Item-tree.
sql/table.h:
Add a parameter to print().
suite)
Under some circumstances a combination of aggregate functions and
GROUP BY in a SELECT query over a VIEW could lead to incorrect
calculation of the result type of the aggregate function. This in
turn could result in incorrect results, or assertion failures on debug
builds.
Fixed by changing the logic in Item_sum_hybrid::fix_fields() so that
the argument's item is dereferenced before calling its type() method.
mysql-test/r/view.result:
Added a test case for bug #33049.
mysql-test/t/view.test:
Added a test case for bug #33049.
sql/item_sum.cc:
When calculating the result type of an aggregate function, dereference
the argument's item before calling its type() method.
into ramayana.hindu.god:/home/tsmith/m/bk/maint/51
client/mysqldump.c:
Auto merged
configure.in:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_cache.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/handler.cc:
Manual merge
sql/item.cc:
Manual merge
into ramayana.hindu.god:/home/tsmith/m/bk/maint/51
client/mysqldump.c:
Auto merged
configure.in:
Auto merged
sql/field.cc:
Auto merged
sql/filesort.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/log.cc:
Auto merged
sql/repl_failsafe.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/item_sum.cc:
Manual merge.
into ibm.:/home/alik/Documents/MySQL/devel/5.1-rt-merged-5.1
configure.in:
Auto merged
client/mysqldump.c:
Auto merged
sql/item_sum.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/unireg.cc:
Auto merged
w/ Field_date instead of Field_newdate
Field_date was still used in temp table creation.
Fixed by using Field_newdate consistently throughout the server
except when reading tables defined with older MySQL version.
No test suite is possible because both Field_date and Field_newdate
return the same values in all the metadata calls.
mysql-test/r/type_decimal.result:
Bug #33256: removed redundant warnings
sql/field.h:
Bug #33256: Add a constructor similar to Field_date::Field_date()
sql/item.cc:
Bug #33256: Use Field_newdate instead of Field_date
for all temp tables and CREATE .. SELECT
sql/item_sum.cc:
Bug #33256: Use Field_newdate instead of Field_date
for all temp tables and CREATE .. SELECT
sql/item_timefunc.cc:
Bug #33256: Use Field_newdate instead of Field_date
for all temp tables and CREATE .. SELECT
sql/item_timefunc.h:
Bug #33256: Use Field_newdate instead of Field_date
for all temp tables and CREATE .. SELECT
called from a SELECT doesn't cause ROLLBACK of state"
Make private all class handler methods (PSEA API) that may modify
data. Introduce and deploy public ha_* wrappers for these methods in
all sql/.
This necessary to keep track of all data modifications in sql/,
which is in turn necessary to be able to optimize two-phase
commit of those transactions that do not modify data.
sql/ha_partition.cc:
Class ha_partition is no longer a friend of class handler.
Use the public handler interface (handler::ha_ methods) for partition
operations.
Remove unnecessary casts from char[] to const char *.ppзи выафвыаafa
sql/handler.cc:
Function ha_create_table() is no longer a friend of class handler.
Use public handler::change_table_ptr() to access private members.
This fixes a subtle bug (no test case in the test suite) when a
deletion error occurs inside one partition of a partitioned engine.
The old code would crash in handler::print_error() in this case.
Implement the newly introduced public ha_* wrappers of the private
virtual handler methods.
sql/handler.h:
Introduce ha_* wrappers to all class handler methods that may
modify data. This is necessary to be able to keep track of
data modifying operations of class handler and optimize read-only
transactions.
sql/item_sum.cc:
delete_all_rows -> ha_delete_all_rows
sql/sql_base.cc:
Use the new public wrappers.
sql/sql_delete.cc:
delete_all_rows -> ha_delete_all_rows
sql/sql_partition.cc:
Use the new public wrappers.
sql/sql_select.cc:
delete_all_rows -> ha_delete_all_rows
delete_table -> ha_delete_table
disabe_indexes -> ha_disable_idnexes
sql/sql_show.cc:
delete_all_rows -> ha_delete_all_rows
sql/sql_table.cc:
Use the public wrappers for class handler DDL methods.
All methods which may change handler data are now accessed via a public
wrapper.
sql/sql_union.cc:
delete_all_rows -> ha_delete_all_rows
{enable,disable}_indexes -> ha_{enable,disable}_indexes
sql/sql_update.cc:
bulk_update_row -> ha_bulk_update_row
sql/unireg.cc:
create_handler_files -> ha_create_handler_files
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
sql/field.cc:
Auto merged
sql/filesort.cc:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_create.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_geofunc.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/log.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/net_serv.cc:
Auto merged
sql/opt_sum.cc:
Auto merged
sql/protocol.h:
Auto merged
sql/records.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_cache.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.h:
Auto merged
sql/sql_trigger.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/structs.h:
Auto merged
sql/unireg.h:
Auto merged
sql/item.cc:
manual merge
sql/log_event.cc:
manual merge
sql/protocol.cc:
manual merge
sql/sp_head.cc:
manual merge
sql/sql_base.cc:
manual merge
sql/sql_parse.cc:
manual merge
sql/sql_select.cc:
manual merge
into linux-st28.site:/home/martin/mysql/src/bug32798-united/my51-bug32798-united
mysql-test/r/func_gconcat.result:
Auto merged
mysql-test/t/func_gconcat.test:
Auto merged
sql/item_sum.cc:
Manual merge, Field::cmp has argument type const uchar* in 5.1
sql/item_sum.h:
manual merge
with null values
For queries containing GROUP_CONCAT(DISTINCT fields ORDER BY fields), there
was a limitation that the DISTINCT fields had to be the same as ORDER BY
fields, owing to the fact that one single sorted tree was used for keeping
track of tuples, ordering and uniqueness. Fixed by introducing a second
structure to handle uniqueness so that the original structure has only to
order the result.
mysql-test/r/func_gconcat.result:
Bug#32798:
- Wrong test result turned correct after fix.
- Correct test result
mysql-test/t/func_gconcat.test:
Bug#32798: Test case
sql/item_sum.cc:
Bug#32798: Implementation of fix. Dead code removal.
- removed comment describing this bug
- replaced body of function group_concat_key_cmp_with_distinct
- removed function group_concat_key_cmp_with_distinct_and_order
- Added a Unique object to maintain uniqueness of values.
sql/item_sum.h:
Bug#32798: Declarations and comments.
into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
mysql-test/r/func_gconcat.result:
Auto merged
mysql-test/t/func_gconcat.test:
Auto merged
sql/item_sum.cc:
Auto merged
The fix is a copy of Martin Friebe's suggestion.
added testing for no_appended which will be false if anything,
including the empty string is in result
mysql-test/r/func_gconcat.result:
test result
mysql-test/t/func_gconcat.test:
test case
sql/item_sum.cc:
added testing for no_appended which will be False if anything,
including the empty string is in result
into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
client/client_priv.h:
Auto merged
client/mysqldump.c:
Auto merged
include/config-win.h:
Auto merged
libmysql/libmysql.c:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/func_sapdb.result:
Auto merged
mysql-test/r/information_schema.result:
Auto merged
mysql-test/r/variables.result:
Auto merged
mysql-test/t/information_schema.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/field.cc:
Auto merged
sql/ha_partition.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_timefunc.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/protocol.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
storage/innobase/handler/ha_innodb.cc:
Auto merged
storage/myisam/sort.c:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/r/query_cache.result:
manual merge
mysql-test/include/mix1.inc:
manual merge
mysql-test/r/innodb_mysql.result:
manual merge
mysql-test/r/type_datetime.result:
manual merge
mysql-test/r/type_decimal.result:
manual merge
mysql-test/t/query_cache.test:
manual merge
mysql-test/t/type_datetime.test:
manual merge
mysql-test/t/type_decimal.test:
manual merge
sql/item.cc:
manual merge
into mysql.com:/home/gluh/MySQL/Merge/5.0-opt
client/mysqldump.c:
Auto merged
include/config-win.h:
Auto merged
libmysql/libmysql.c:
Auto merged
myisam/sort.c:
Auto merged
mysql-test/r/func_sapdb.result:
Auto merged
mysql-test/r/variables.result:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/field.cc:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_timefunc.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/r/type_datetime.result:
manual merge
mysql-test/r/type_decimal.result:
manual merge
mysql-test/t/type_datetime.test:
manual merge
mysql-test/t/type_decimal.test:
manual merge
sql/item.cc:
manual merge
into mysql.com:/home/ram/work/b31154/b31154.5.1
mysql-test/r/func_gconcat.result:
Auto merged
mysql-test/t/func_gconcat.test:
Auto merged
sql/item_sum.cc:
Auto merged