An error occurred fetching the project authors.
- 07 Nov, 2006 1 commit
-
-
unknown authored
sql/field.cc: datatime length is 19, not 12
-
- 06 Nov, 2006 1 commit
-
-
unknown authored
include/my_time.h: we need to use it outside the my_time.cc mysql-test/r/gis-rtree.result: result fixed sql-common/my_time.c: 'static' removed sql/field.cc: checks for invalid datetimes added
-
- 25 Oct, 2006 1 commit
-
-
unknown authored
mysql-test/r/type_datetime.result: result fixed mysql-test/r/type_newdecimal.result: result fixed mysql-test/t/type_datetime.test: testcase mysql-test/t/type_newdecimal.test: testcase sql/field.cc: Field_new_decimal::store_time implemented sql/field.h: Field_new_decimal::store_time added sql/item.cc: auxiliary methods implemented to operate with datatimes sql/item.h: auxiliary methods declared in Item to operate with datatimes sql/item_timefunc.cc: Item_date::save_in_field old implementation removed sql/item_timefunc.h: my_decimal and save_in_field methods implemented for datetime items sql/my_decimal.cc: date2my_decimal implemented sql/my_decimal.h: date2my_decimal declared
-
- 29 Sep, 2006 1 commit
-
-
unknown authored
Problem: for character sets having mbmaxlen==2, any ALTER TABLE changed TEXT column type to MEDIUMTEXT, due to wrong "internal length to create length" formula. Fix: removing rounding code introduced in early 4.1 time, which is not correct anymore. mysql-test/r/ctype_gbk.result: Adding test case mysql-test/t/ctype_gbk.test: Adding test case sql/field.cc: Fixing "internal length to create length" formula.
-
- 28 Sep, 2006 1 commit
-
-
unknown authored
Using wrong filling value may cause unneeded extra bit rewriting. Fix: use proper value to fill uneven bits. mysql-test/r/type_bit.result: Fix for bug #22271: data casting may affect data stored in the next column(s?) - test case. mysql-test/t/type_bit.test: Fix for bug #22271: data casting may affect data stored in the next column(s?) - test result. sql/field.cc: Fix for bug #22271: data casting may affect data stored in the next column(s?) - use ((1 << bit_len) - 1) instead of 0xff to fill uneven bits in order not to change other's bits.
-
- 27 Sep, 2006 1 commit
-
-
unknown authored
The function receives an exactly-sized buffer (not a C NUL-terminated string) and passes it into a printf function to be interpreted with "%s". Instead, create an intermediate String object, and copy the data into it, and pass in a pointer to the String's NUL-terminated buffer. mysql-test/r/warnings.result: Test that warnings do not read outside its intended memory space. mysql-test/t/warnings.test: Test that warnings do not read outside its intended memory space. sql/field.cc: Create a new String object and use a pointer to its data instead of the exactly-sized buffer to be interpreted as a C string deep within the errmsg.txt list via printf.
-
- 29 Aug, 2006 1 commit
-
-
unknown authored
doesn't find the column" When a user was using 4.1 tables with VARCHAR column and 5.0 server and a query that used a temporary table to resolve itself, the table metadata for the varchar column sent to client was incorrect: MYSQL_FIELD::table member was empty. The bug was caused by implicit "upgrade" from old VARCHAR to new VARCHAR hard-coded in Field::new_field, which did not preserve the information about the original table. Thus, the field metadata of the "upgraded" field pointed to an auxiliary temporary table created for query execution. The fix is to copy the pointer to the original table to the new field. mysql-test/r/type_varchar.result: Update test results (Bug#14897) mysql-test/t/type_varchar.test: Add a test case for Bug#14897 "ResultSet.getString("table.column") sometimes doesn't find the column" sql/field.cc: Preserve the original table name when converting fields from old VARCHAR to new VARCHAR. mysql-test/std_data/14897.frm: New BitKeeper file ``mysql-test/std_data/14897.frm''
-
- 15 Aug, 2006 1 commit
-
-
unknown authored
-
- 14 Aug, 2006 1 commit
-
-
unknown authored
Fix for bug#20648 We introduce a new field method for knowing "real size", and we now in archive null unused bits of a row to null before writing. sql/field.cc: data_length for field needs to be calculated directly. sql/field.h: The new method data_length() returns the "real" length of the field. sql/ha_archive.cc: Before a write_row() archive nulls space beyond the size of the row in varchars to make sure that compression only sees NULL.
-
- 21 Jul, 2006 1 commit
-
-
unknown authored
The Item::tmp_table_field_from_field_type() function creates Field_datetime object instead of Field_timestamp object for timestamp field thus always changing data type is a tmp table is used. The Field_blob object constructor which is used in the Item::tmp_table_field_from_field_type() is always setting packlength field of newly created blob to 4. This leads to changing fields data type for example from the blob to the longblob if a temporary table is used. The Item::make_string_field() function always converts Field_string objects to Field_varstring objects. This leads to changing data type from the char/binary to varchar/varbinary. Added appropriate Field_timestamp object constructor for using in the Item::tmp_table_field_from_field_type() function. Added Field_blob object constructor which sets pack length according to max_length argument. The Item::tmp_table_field_from_field_type() function now creates Field_timestamp object for a timestamp field. The Item_type_holder::display_length() now returns correct NULL length NULL length. The Item::make_string_field() function now doesn't change Field_string to Field_varstring in the case of Item_type_holder. The Item::tmp_table_field_from_field_type() function now uses the Field_blob constructor which sets packlength according to max_length. mysql-test/t/union.test: Added test case for bug#12185: Data type aggregation may produce wrong result Corrected test case after fix for bug#12185 mysql-test/t/innodb.test: Corrected test case after fix for bug#12185 mysql-test/r/union.result: Added test case for bug#12185: Data type aggregation may produce wrong result Corrected test case after fix for bug#12185 mysql-test/r/innodb.result: Corrected test case after fix for bug#12185 mysql-test/r/create.result: Corrected the test case after fixing bug#12185 sql/field.h: Fixed bug#12185: Data type aggregation may produce wrong result Added Field_blob object constructor which sets packlength according to max_length argument. sql/item.cc: Fixed bug#12185: Data type aggregation may produce wrong result The Item::make_string_field() function now doesn't change Field_string to Field_varstring in the case of Item_type_holder. The Item::tmp_table_field_from_field_type() function now creates Field_timestamp object for a timestamp field. The Item::tmp_table_field_from_field_type() function now uses the Field_blob constructor which sets packlength according to max_length. The Item_type_holder::display_length() now returns correct NULL length NULL length. sql/field.cc: Fixed bug#12185: Data type aggregation may produce wrong result Added appropriate Field_timestamp object constructor for using in the Item::tmp_table_field_from_field_type() function.
-
- 20 Jul, 2006 1 commit
-
-
unknown authored
The problem was that when converting a string to an exact number, rounding didn't work, because conversion didn't understand approximate numbers notation. Fix: a new function for string-to-number conversion was implemented, which is aware of approxinate number notation (with decimal point and exponent, e.g. -19.55e-1) include/m_ctype.h: Adding new function into MY_CHARSET_HANDLER Adding prototypes for 8bit and ucs2 functions. mysql-test/r/loaddata.result: Fixing results mysql-test/r/ps_2myisam.result: Fixing results mysql-test/r/ps_3innodb.result: Fixing results mysql-test/r/ps_4heap.result: Fixing results mysql-test/r/ps_5merge.result: Fixing results mysql-test/r/ps_6bdb.result: Fixing results mysql-test/r/rpl_rewrite_db.result: Fixing results mysql-test/r/select.result: Fixing results mysql-test/r/sp-vars.result: Fixing results mysql-test/r/strict.result: Fixing results mysql-test/r/view.result: Fixing results mysql-test/r/warnings.result: Fixing results mysql-test/t/strict.test: Fixing results sql/field.cc: Using new function strings/ctype-big5.c: Adding new function into the MY_CHARSET_HANDLER structure strings/ctype-bin.c: Adding new function into the MY_CHARSET_HANDLER structure strings/ctype-cp932.c: Adding new function into the MY_CHARSET_HANDLER structure strings/ctype-euc_kr.c: Adding new function into the MY_CHARSET_HANDLER structure strings/ctype-eucjpms.c: Adding new function into the MY_CHARSET_HANDLER structure strings/ctype-gb2312.c: Adding new function into the MY_CHARSET_HANDLER structure strings/ctype-gbk.c: Adding new function into the MY_CHARSET_HANDLER structure strings/ctype-latin1.c: Adding new function into the MY_CHARSET_HANDLER structure strings/ctype-simple.c: Implementing my_strntoull10_8bit Adding new function into MY_CHARSET_HANDLER strings/ctype-sjis.c: Adding new function into the MY_CHARSET_HANDLER structure strings/ctype-tis620.c: Adding new function into the MY_CHARSET_HANDLER structure strings/ctype-ucs2.c: Implementing UCS2 wrapper for 8bit version Adding new function into the MY_CHARSET_HANDLER structure strings/ctype-ujis.c: Adding new function into the MY_CHARSET_HANDLER structure strings/ctype-utf8.c: Adding new function into the MY_CHARSET_HANDLER structure mysql-test/r/round.result: New BitKeeper file ``mysql-test/r/round.result'' mysql-test/t/round.test: New BitKeeper file ``mysql-test/t/round.test''
-
- 19 Jul, 2006 1 commit
-
-
unknown authored
- backport patch from 5.0 - "table" can be NULL in temporary fields used for type conversion sql/field.cc: table can be NULL in temporary fields used for type conversion. Store value in field as if db_low_byte_first was set. sql/field.h: table can be NULL in temporary fields used for type conversion. Store value in field as if db_low_byte_first was set.
-
- 18 Jul, 2006 1 commit
-
-
unknown authored
When a default of '' was specified for TEXT/BLOB columns, the specification was silently ignored. This is presumably to be nice to applications (or people) who generate their column definitions in a not-very-clever fashion. For clarity, doing this now results in a warning, or an error in strict mode. mysql-test/r/federated.result: Update results mysql-test/r/fulltext_distinct.result: Update results mysql-test/r/fulltext_update.result: Update results mysql-test/r/gis-rtree.result: Update results mysql-test/r/gis.result: Update results mysql-test/r/join_outer.result: Update results mysql-test/r/order_by.result: Update results mysql-test/r/type_blob.result: Add new results mysql-test/r/type_ranges.result: Update results mysql-test/t/type_blob.test: Add new test sql/field.cc: Issue a warning when setting '' as the default on a BLOB/TEXT column, and make it an error in strict mode. Also, clarify comments about when NO_DEFAULT_VALUE_FLAG is set.
-
- 12 Jul, 2006 1 commit
-
-
unknown authored
The Federated storage engine used Field methods that had arbitrary limits on the amount of data they could process, which caused problems with data over that limit (4K). By removing those Field methods and just using features of the String class, we can avoid this problem. mysql-test/r/federated.result: Add new results mysql-test/t/federated.test: Add new regression test sql/field.cc: Remove unnecessary methods sql/field.h: Remove unnecessary methods sql/ha_federated.cc: Remove use of quote_data, use String::print() to get escaping of strings, and don't bother with needs_quotes, just always quote values.
-
- 26 Jun, 2006 1 commit
-
-
unknown authored
Bug#17294 - INSERT DELAYED puting an \n before data Bug#16611 - INSERT DELAYED corrupts data Bug#13707 - Server crash with INSERT DELAYED on MyISAM table Combined as Bug#16218. INSERT DELAYED crashed in 5.0 on a table with a varchar that could be NULL and was created pre-5.0 (Bugs 16218 and 13707). INSERT DELAYED corrupted data in 5.0 on a table with varchar fields that was created pre-5.0 (Bugs 17294 and 16611). In case of INSERT DELAYED the open table is copied from the delayed insert thread to be able to create a record for the queue. When copying the fields, a method was used that did convert old varchar to new varchar fields and did not set up some pointers into the record buffer of the table. The field conversion was guilty for the misinterpretation of the record contents by the delayed insert thread. The wrong pointer setup was guilty for the crashes. For Bug 13707 (Server crash with INSERT DELAYED on MyISAM table) I fixed the above mentioned method to set up one of the pointers. For Bug 16218 I set up the other pointers too. But when looking at the corruptions I got aware that converting the field type was totally wrong for INSERT DELAYED. The copied table is used to create a record that is to be sent to the delayed insert thread. Of course it can interpret the record correctly only if all field types are the same in both table objects. So I revoked the fix for Bug 13707 and changed the new_field() method so that it can suppress conversions. No test case as this is a migration problem. One needs to create a table with 4.x and use it with 5.x. I added two test scripts to the bug report. sql/field.cc: Bug#16218 - Crash on insert delayed Bug#17294 - INSERT DELAYED puting an \n before data Bug#16611 - INSERT DELAYED corrupts data Bug#13707 - Server crash with INSERT DELAYED on MyISAM table Combined as Bug#16218. Added parameter 'keep_type' to Field::new_field(). Undid the change from Bug 13707 (Server crash with INSERT DELAYED on MyISAM table). I solved all four bugs in sql/sql_insert.cc by making exact duplicates of the fields. The new_field() method converts certain field types, which is wrong for INSERT DELAYED. sql/field.h: Bug#13707 - Server crash with INSERT DELAYED on MyISAM table Combined as Bug#16218. Added parameter 'keep_type' to Field::new_field(). sql/sql_insert.cc: Bug#16218 - Crash on insert delayed Bug#17294 - INSERT DELAYED puting an \n before data Bug#16611 - INSERT DELAYED corrupts data Bug#13707 - Server crash with INSERT DELAYED on MyISAM table Combined as Bug#16218. Added comments. Made small style fixes. Used the new parameter 'keep_type' of Field::new_field() to avoid field type conversion. The table copy must have exactly the same types of fields as the original table. Otherwise the record contents created by the foreground thread could be misinterpreted by the delayed insert thread. sql/sql_select.cc: Bug#16218 - Crash on insert delayed Bug#17294 - INSERT DELAYED puting an \n before data Bug#16611 - INSERT DELAYED corrupts data Bug#13707 - Server crash with INSERT DELAYED on MyISAM table Combined as Bug#16218. Added parameter 'keep_type' to Field::new_field(). Undid the change from Bug 13707 (Server crash with INSERT DELAYED on MyISAM table). I solved all four bugs in sql/sql_insert.cc by making exact duplicates of the fields. The new_field() method converts certain field types, which is wrong for INSERT DELAYED. sql/sql_trigger.cc: Bug#16218 - Crash on insert delayed Bug#17294 - INSERT DELAYED puting an \n before data Bug#16611 - INSERT DELAYED corrupts data Bug#13707 - Server crash with INSERT DELAYED on MyISAM table Combined as Bug#16218. Added parameter 'keep_type' to Field::new_field(). Undid the change from Bug 13707 (Server crash with INSERT DELAYED on MyISAM table). I solved all four bugs in sql/sql_insert.cc by making exact duplicates of the fields. The new_field() method converts certain field types, which is wrong for INSERT DELAYED. sql/table.cc: Bug#16218 - Crash on insert delayed Bug#17294 - INSERT DELAYED puting an \n before data Bug#16611 - INSERT DELAYED corrupts data Bug#13707 - Server crash with INSERT DELAYED on MyISAM table Combined as Bug#16218. Added parameter 'keep_type' to Field::new_field(). Undid the change from Bug 13707 (Server crash with INSERT DELAYED on MyISAM table). I solved all four bugs in sql/sql_insert.cc by making exact duplicates of the fields. The new_field() method converts certain field types, which is wrong for INSERT DELAYED.
-
- 21 Jun, 2006 1 commit
-
-
unknown authored
This bug in Field_string::cmp resulted in a wrong comparison with keys in partial indexes over multi-byte character fields. Given field a is declared as a varchar(16) collate utf8_unicode_ci INDEX(a(4)) gives us an example of such an index. Wrong key comparisons could lead to wrong result sets if the selected query execution plan used a range scan by a partial index over a utf8 character field. This also caused wrong results in many other cases. mysql-test/t/ctype_utf8.test: Added test cases for bug #14896. mysql-test/r/ctype_utf8.result: Added test cases for bug #14896. sql/field.cc: Fixed bug #14896. This bug in Field_string::cmp resulted in a wrong comparison with keys in partial indexes over multi-byte character fields. Given field a is declared as a varchar(16) collate utf8_unicode_ci INDEX(a(4)) gives us an example of such an index. Wrong key comparisons could lead to wrong result sets if the selected query execution plan used a range scan by a partial index over a utf8 character field. This also caused wrong results in many other cases.
-
- 20 Jun, 2006 1 commit
-
-
unknown authored
Additional fix for #16377 for bigendian platforms sql_select.cc, select.result, select.test: After merge fix mysql-test/t/select.test: After merge fix mysql-test/r/select.result: After merge fix sql/sql_select.cc: After merge fix sql/field.h: Additional fix for #16377 for bigendian platforms sql/field.cc: Additional fix for #16377 for bigendian platforms
-
- 14 Jun, 2006 2 commits
-
-
unknown authored
After merge fix mysql-test/r/func_time.result: After merge fix mysql-test/r/func_concat.result: After merge fix mysql-test/r/cast.result: After merge fix sql/item_cmpfunc.h: After merge fix sql/item_cmpfunc.cc: After merge fix sql/field.cc: After merge fix
-
unknown authored
This bug in Field_string::cmp resulted in a wrong comparison with keys in partial indexes over multi-byte character fields. Given field a is declared as a varchar(16) collate utf8_unicode_ci INDEX(a(4)) gives us an example of such an index. Wrong key comparisons could lead to wrong result sets if the selected query execution plan used a range scan by a partial index over a utf8 character field. This also caused wrong results in many other cases. mysql-test/r/ctype_utf8.result: Added test cases for bug #14896. mysql-test/t/ctype_utf8.test: Added test cases for bug #14896.
-
- 13 Jun, 2006 1 commit
-
-
unknown authored
can lead to a wrong result. All date/time functions has the STRING result type thus their results are compared as strings. The string date representation allows a user to skip some of leading zeros. This can lead to wrong comparison result if a date/time function result is compared to such a string constant. The idea behind this bug fix is to compare results of date/time functions and data/time constants as ints, because that date/time representation is more exact. To achieve this the agg_cmp_type() is changed to take in the account that a date/time field or an date/time item should be compared as ints. This bug fix is partially back ported from 5.0. The agg_cmp_type() function now accepts THD as one of parameters. In addition, it now checks if a date/time field/function is present in the list. If so, it tries to coerce all constants to INT to make date/time comparison return correct result. The field for the constant coercion is taken from the Item_field or constructed from the Item_func. In latter case the constructed field will be freed after conversion of all constant items. Otherwise the result is same as before - aggregated with help of the item_cmp_type() function. From the Item_func_between::fix_length_and_dec() function removed the part which was converting date/time constants to int if possible. Now this is done by the agg_cmp_type() function. The new function result_as_longlong() is added to the Item class. It indicates that the item is a date/time item and result of it can be compared as int. Such items are date/time fields/functions. Correct val_int() methods are implemented for classes Item_date_typecast, Item_func_makedate, Item_time_typecast, Item_datetime_typecast. All these classes are derived from Item_str_func and Item_str_func::val_int() converts its string value to int without regard to the date/time type of these items. Arg_comparator::set_compare_func() and Arg_comparator::set_cmp_func() functions are changed to substitute result type of an item with the INT_RESULT if the item is a date/time item and another item is a constant. This is done to get a correct result of comparisons like date_time_function() = string_constant. mysql-test/r/cast.result: Fixed wrong test case result after bug fix#16377. sql/item_timefunc.h: Fixed bug#16377: result of DATE/TIME functions were compared as strings which can lead to a wrong result. The result_as_longlong() function is set to return TRUE for these classes: Item_date, Item_date_func, Item_func_curtime, Item_func_sec_to_time, Item_date_typecast, Item_time_typecast, Item_datetime_typecast, Item_func_makedate. sql/item_timefunc.cc: Fixed bug#16377: result of DATE/TIME functions were compared as strings which can lead to a wrong result.Correct val_int() methods are implemented for classes Item_date_typecast, Item_func_makedate, Item_time_typecast, Item_datetime_typecast. sql/item_cmpfunc.h: Fixed bug#16377: result of DATE/TIME functions were compared as strings which can lead to a wrong result. Arg_comparator::set_compare_func() and Arg_comparator::set_cmp_func() functions are changed to substitute result type of an item with the INT_RESULT if the item is a date/time item and another item is a constant. sql/field.cc: Fixed bug#16377: result of DATE/TIME functions were compared as strings which can lead to a wrong result. Field::set_warning(), Field::set_datetime_warning() now use current_thd to get thd if table isn't set. sql/item_cmpfunc.cc: Fixed bug#16377: result of DATE/TIME functions were compared as strings which can lead to a wrong result. The agg_cmp_type() function now accepts THD as one of parameters. In addition, it now checks if a date/time field/function is present in the list. If so, it tries to coerce all constants to INT to make date/time comparison return correct result. The field for the constant coercion is taken from the Item_field or constructed from the Item_func. In latter case the constructed field will be freed after conversion of all constant items. Otherwise the result is same as before - aggregated with help of the item_cmp_type() function. sql/item.h: The new function result_as_longlong() is added to the Item class. It indicates that the item is a date/time item and result of it can be compared as int. Such items are date/time fields/functions. mysql-test/t/func_time.test: Added test case fot bug#16377: result of DATE/TIME functions were compared as strings which can lead to a wrong result. mysql-test/r/func_time.result: Added test case fot bug#16377: result of DATE/TIME functions were compared as strings which can lead to a wrong result.
-
- 24 May, 2006 1 commit
-
-
unknown authored
Remove dflt_field from field structure as this was only needed when createing temporary table and I found another soultion that doesn't increase the size of the field structure for all table instances. (Better fix for bug #19089) Fixed compiler warnings Fixed valgrind warning in Item_date_add_intervall::eq. (Recoding of bugfix #19490) sql/field.cc: remove dflt_field from field structure (not needed) Simple cleanup of code that been copied elsewhere sql/field.h: remove dflt_field from field structure (not needed) sql/item.h: Removed compiler warnings sql/item_timefunc.cc: Fixed Item_date_add_intervall::eq The problem was that when we call 'eq' 'this' is not fixed, which means we can't call const_item() or a value function. I fixed this so that we check eq for all arguments and that the sign and type are identical. (The original code gave a 'accessing uninitialized data' in valgrind. sql/mysql_priv.h: Added default fields to create_tmp_field sql/sql_insert.cc: New default_field parameter to create_tmp_field() sql/sql_select.cc: New default_field parameter to create_tmp_field() Use this in create_tmp_table() to set right default value for a field
-
- 22 May, 2006 1 commit
-
-
unknown authored
mysql-test/r/view.result: Post-review fixes. sql/field.cc: Post-review fixes. sql/field.h: Post-review fixes. sql/sql_select.cc: Post-review fixes.
-
- 21 May, 2006 1 commit
-
-
unknown authored
When a CREATE TABLE command created a table from a materialized view id does not inherit default values from the underlying table. Moreover the temporary table used for the view materialization does not inherit those default values. In the case when the underlying table contained ENUM fields it caused misleading error messages. In other cases the created table contained wrong default values. The code was modified to ensure inheritance of default values for materialized views. mysql-test/r/view.result: Added a test case for bug #19089. mysql-test/t/view.test: Added a test case for bug #19089. sql/field.cc: Fixed bug ##19089. Added field dflt_field to the class Field. This field is set for temp table fields that inherits default values of items from which they are created. sql/field.h: Fixed bug ##19089. Added field dflt_field to the class Field. This field is set for temp table fields that inherits default values of items from which they are created. sql/sql_select.cc: Fixed bug #19089. When a CREATE TABLE command created a table from a materialized view id does not inherit default values from the underlying table. Moreover the temporary table used for the view materialization does not inherit those default values. The code was modified to ensure inheritance of default values for materialized views.
-
- 17 May, 2006 1 commit
-
-
unknown authored
mysql-test/r/func_time.result: Fix for #16327: invalid TIMESTAMP values retrieved - test result mysql-test/t/func_time.test: Fix for #16327: invalid TIMESTAMP values retrieved - test case sql/field.cc: Fix for #16327: invalid TIMESTAMP values retrieved - let 1969 as well
-
- 05 Apr, 2006 1 commit
-
-
unknown authored
The wrong value was being reported as the field_length for BIT fields, resulting in confusion for at least Connector/J. The field_length is now always the number of bits in the field, as it should be. mysql-test/r/type_bit.result: Add new results mysql-test/r/type_bit_innodb.result: Add new results mysql-test/t/type_bit.test: Add new regression test mysql-test/t/type_bit_innodb.test: Add new regression test sql/field.cc: Fix Field_bit->field_length to actually report the display width, and store the bytes stored in the rec in the new bytes_in_rec member. sql/field.h: Fix Field_bit::field_length to store the correct value, adding Field_bit::bytes_in_rec to remember the number of bytes used for storing the value. Remove Field_bit_as_char::create_length, as it is now redundant. sql/ha_ndbcluster.cc: Handle field_length of Field_bit actually being the display width (# of bits). sql/key.cc: Fix inappropriate use of field->field_length for BIT field.
-
- 29 Mar, 2006 1 commit
-
-
unknown authored
Bug#15098: CAST(column double TO signed int), wrong result which was fixed originally in 4.1. mysql-test/r/cast.result: Fixing test results sql/field.cc: Adding a "truncated value" warning.
-
- 25 Feb, 2006 1 commit
-
-
unknown authored
- Added empty constructors and virtual destructors to many classes and structs - Removed some usage of the offsetof() macro to instead use C++ class pointers configure.in: Added comment ndb/include/ndbapi/NdbDictionary.hpp: Fixed compiler warnings from gcc 4.0.2 sql/field.cc: Fixed compiler warnings from gcc 4.0.2 sql/handler.h: Fixed compiler warnings from gcc 4.0.2 sql/item.h: Fixed compiler warnings from gcc 4.0.2 sql/item_cmpfunc.h: Fixed compiler warnings from gcc 4.0.2 sql/log_event.h: Fixed compiler warnings from gcc 4.0.2 sql/mysql_priv.h: Fixed compiler warnings from gcc 4.0.2 For find_table_in_list I fixed it to use proper C++ class pointers instead of C style pointers sql/opt_range.cc: Fixed compiler warnings from gcc 4.0.2 sql/parse_file.h: Fixed compiler warnings from gcc 4.0.2 sql/sp_rcontext.h: Fixed compiler warnings from gcc 4.0.2 sql/spatial.h: Fixed compiler warnings from gcc 4.0.2 sql/sql_base.cc: Fixed compiler warnings from gcc 4.0.2 sql/sql_cache.h: Fixed compiler warnings from gcc 4.0.2 sql/sql_class.h: Fixed compiler warnings from gcc 4.0.2 sql/sql_parse.cc: Fixed compiler warnings from gcc 4.0.2 (Not pretty, but seams to work...) sql/sql_select.h: Fixed compiler warnings from gcc 4.0.2 sql/sql_update.cc: Fixed compiler warnings from gcc 4.0.2 sql/table.h: Fixed compiler warnings from gcc 4.0.2 sql/tztime.cc: Fixed compiler warnings from gcc 4.0.2 sql/tztime.h: Fixed compiler warnings from gcc 4.0.2
-
- 23 Feb, 2006 1 commit
-
-
unknown authored
-
- 21 Feb, 2006 1 commit
-
-
unknown authored
column is increasing when table is recreated with PS/SP": make use of create_field::char_length more consistent in the code. Reinit create_field::length from create_field::char_length for every execution of a prepared statement (actually fixes the bug). mysql-test/r/ps.result: Test results fixed (Bug#13134) mysql-test/t/ps.test: A test case for Bug#13134 "Length of VARCHAR() utf8 column is increasing when table is recreated with PS/SP" sql/field.cc: Move initialization of create_field::char_length to the constructor of create_field. sql/field.h: Rename chars_length to char_length (to be consistent with how this term is used throughout the rest of the code). sql/sql_parse.cc: Initialize char_length in add_field_to_list. This function effectively works as another create_field constructor. sql/sql_table.cc: Reinit length from char_length for every field in mysql_prepare_table. This is not needed if we're executing a statement for the first time, however, at subsequent executions length contains the number of bytes, not characters (as it's expected to).
-
- 20 Jan, 2006 1 commit
-
-
unknown authored
The bug appears after implementation of WL#2984 (Make stored routine variables work according to the standard). mysql-test/r/type_varchar.result: Update result file. mysql-test/t/type_varchar.test: Add a test for BUG#15588. sql/field.cc: - use memmove() instead of memcpy() -- after implementation of WL#2984 (Make stored routine variables work according to the standard) it is possible to store in the field the value from this field. For instance, this can happen for the following statement: SET sp_var = SUBSTR(sp_var, 1, 3); sql/sp_head.cc: - Work correctly with String: - String length has to be be reset before use; - qs_append() does not allocate memory, so the memory should be reserved beforehand. sql/sql_select.cc: Polishing: should have been done in WL#2984.
-
- 05 Jan, 2006 1 commit
-
-
unknown authored
- Fixed tests - Optimized new code - Fixed some unlikely core dumps - Better bug fixes for: - #14397 - OPTIMIZE TABLE with an open HANDLER causes a crash - #14850 (ERROR 1062 when a quering a view using a Group By on a column that can be null mysql-test/r/create.result: Update results after removing wrong warnings for CREATE ... SELECT New tests mysql-test/r/handler.result: Drop used tables mysql-test/r/kill.result: Make test portable mysql-test/r/mysqlshow.result: Drop tables used by previous test mysql-test/r/trigger.result: Reuse old procedure name mysql-test/r/view.result: Extra tests mysql-test/t/create.test: New tests to test fix of removing wrong warnings for CREATE ... SELECT mysql-test/t/disabled.def: Enable 'kill' test (should now be portable) mysql-test/t/handler.test: Drop used tables mysql-test/t/kill.test: Make test portable even if kill doesn't work at once mysql-test/t/mysqlshow.test: Drop tables used by previous test mysql-test/t/trigger.test: Reuse old procedure name mysql-test/t/view.test: Extra tests sql/field.cc: Removed compiler warning sql/ha_federated.cc: my_snprintf -> strmake() (Simple optimization) sql/ha_ndbcluster.cc: Indentation cleanups and trival optimization sql/item.cc: Moved save_org_in_field() to item.cc to make it easier to test Remove setting of null_value as this is not needed sql/item.h: Moved save_org_in_field() to item.cc to make it easier to test sql/log_event.cc: Remove inline of slave_load_file_stem() Added 'extension' parameter to slave_load_file_stem() to get smaller code Removed not critical (or needed) DBUG_ASSERT()'s Cleaned up usage of slave_load_file_stem() to not depend on constant string lengths Indentation fixes sql/opt_range.cc: Moved code from declaration to function body (To make it more readable) sql/parse_file.cc: Fixed DBUG_PRINT sql/sp.cc: Simple cleanups - Removed not needed {} level - Ensure saved variables starts with old_ sql/sp_head.cc: Indentation fixes Remove core dump when using --debug when m_next_cached_sp == 0 Fixed compiler warnings Trivial optimizations sql/sp_head.h: Changed argument to set_definer() to const Added THD argument to recursion_level_error() to avoid call to current_thd sql/sql_acl.cc: Removed not needed test (first_not_own_table is the guard) sql/sql_base.cc: Removed extra empty line sql/sql_handler.cc: Don't test table version in mysql_ha_read() as this is already tested in lock_tables() Moved call to insert_fields to be after lock_table() to guard aganst reopen of tables (Better fix for Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash) sql/sql_insert.cc: Mark fields that are set in CREATE ... SELECT as used (Removed wrong warnings about field not having a default value) sql/sql_parse.cc: Removed not needed test of 'tables' (first_not_own_table is the guard) Simplify code sql/sql_select.cc: Use group->field to check if value is null instead of item called by 'save_org_in_field' This is a better bug fix for #14850 (ERROR 1062 when a quering a view using a Group By on a column that can be null) sql/sql_trigger.cc: Move sql_modes_parameters outside of function Indentation fixes Fixed compiler warning Ensure that thd->lex->query_tables_own_last is set properly before calling check_table_access() (This allows us to remove the extra test in check_grant() and check_table_access())
-
- 03 Jan, 2006 1 commit
-
-
unknown authored
client/mysqladmin.cc: don't use the handler after it's closed client/mysqlbinlog.cc: memory leak client/mysqldump.c: many "ignore return value" warnings, one "NULL dereference" cmd-line-utils/libedit/history.c: memory leak include/my_base.h: cleanup libmysql/libmysql.c: "return value ignored" warning myisam/mi_delete.c: "return value ignored" warning myisam/myisampack.c: "out-of-bound access" warning myisam/sort.c: "double free" warning mysys/default_modify.c: "double free" warning mysys/mf_iocache2.c: "return value ignored" warnings mysys/my_bitmap.c: s/return/DBUG_RETURN/ mysys/my_error.c: memory leak server-tools/instance-manager/parse.cc: "NULL dereference" warning sql-common/client.c: "NULL dereference" warning sql/field.cc: deadcode, "NULL dereference", "uninitialized" warnings sql/field.h: unused parameters removed from constructor sql/ha_myisam.cc: "return value ignored" warnings sql/item.cc: "return value ignored" warnings changed constructor sql/item_func.cc: "return value ignored" warnings sql/log_event.cc: uninitialized warning sql/opt_range.cc: "double free" and uninitialized warnings sql/opt_range.h: "return value ignored" warning sql/repl_failsafe.cc: "return value ignored" warning sql/set_var.cc: "return value ignored" warning sql/slave.cc: "return value ignored" warnings sql/slave.h: new prototype sql/sql_acl.cc: deadcode and "NULL dereference" warnings sql/sql_db.cc: "return value ignored" warning sql/sql_handler.cc: "NULL dereference" warning sql/sql_help.cc: "NULL dereference" warning sql/sql_insert.cc: "return value ignored" warning sql/sql_parse.cc: "return value ignored" warning one more DBUG_ASSERT sql/sql_repl.cc: "return value ignored" and memory leak warnings sql/sql_show.cc: "return value ignored" and "NULL dereference" warnings sql/sql_test.cc: "return value ignored" warning sql/table.cc: memory leak sql/uniques.cc: "return value ignored" warning endspaces deleted
-
- 28 Dec, 2005 1 commit
-
-
unknown authored
Field_date::store function'. Though the Field_date::store function almost unused when protocol_version=10 additional check was added into it to store 4byte dates properly. Effective test routine is not available so far due to protocol_version is not a dynamic property and can not be modified with mysql-test script. sql/field.cc: Fixes bug #15634. Eliminates compiler warning 'all return paths are recursive in Field_date::store function'. Though the Field_date::store function almost unused when protocol_version=10 additional check was added into it to store 4byte dates properly.
-
- 19 Dec, 2005 1 commit
-
-
unknown authored
field.cc: BLOB variations have number-in-bytes limit, unlike CHAR/VARCHAR which have number-of-characters limits. A tinyblob column can store up to 255 bytes. In the case of basic Latin letters (which use 1 byte per character) we can store up to 255 characters in a tinyblob column. When passing an utf8 tinyblob column as an argument into a function (e.g. COALESCE) we need to reserve 3*255 bytes. I.e. multiply length in bytes to mbcharlen for the character set. Although in reality a tinyblob column can never be 3*255 bytes long, we need to set max_length to multiply to make fix_length_and_dec() of the function-caller (e.g. COALESCE) calculate the correct max_length for the column being created. ctype_utf8.result, ctype_utf8.test: Adding test case. mysql-test/t/ctype_utf8.test: Adding test case. mysql-test/r/ctype_utf8.result: Adding test case. sql/field.cc: Bug#15581: COALESCE function truncates mutli-byte TINYTEXT values BLOB variations have byte limits, unlike CHAR/VARCHAR which have number-of-character limits. It means tinyblob can store up to 255 bytes. All of them can be basic latin letters which use 1 byte per character. I.e. we can store up to 255 characters in a tinyblob column. When passing a tinyblob column as an argument into a function (for example COALESCE or CONCAT) we need to reserve 3*255 bytes in the case of utf-8. I.e. multiply length in bytes to mbcharlen for the character set.
-
- 07 Dec, 2005 1 commit
-
-
unknown authored
according to the standard. The idea is to use Field-classes to implement stored routines variables. Also, we should provide facade to Item-hierarchy by Item_field class (it is necessary, since SRVs take part in expressions). The patch fixes the following bugs: - BUG#8702: Stored Procedures: No Error/Warning shown for inappropriate data type matching; - BUG#8768: Functions: For any unsigned data type, -ve values can be passed and returned; - BUG#8769: Functions: For Int datatypes, out of range values can be passed and returned; - BUG#9078: STORED PROCDURE: Decimal digits are not displayed when we use DECIMAL datatype; - BUG#9572: Stored procedures: variable type declarations ignored; - BUG#12903: upper function does not work inside a function; - BUG#13705: parameters to stored procedures are not verified; - BUG#13808: ENUM type stored procedure parameter accepts non-enumerated data; - BUG#13909: Varchar Stored Procedure Parameter always BINARY string (ignores CHARACTER SET); - BUG#14161: Stored procedure cannot retrieve bigint unsigned; - BUG#14188: BINARY variables have no 0x00 padding; - BUG#15148: Stored procedure variables accept non-scalar values; mysql-test/r/ctype_ujis.result: Explicitly specify correct charset. mysql-test/r/schema.result: Drop our test database to not affect this test if some test left it cause of failure. mysql-test/r/show_check.result: Drop our test database to not affect this test if some test left it cause of failure. mysql-test/r/skip_name_resolve.result: Ignore columns with unpredictable values. mysql-test/r/sp-big.result: Add cleanup statement. mysql-test/r/sp-dynamic.result: Add cleanup statements. mysql-test/r/sp.result: Update result file. mysql-test/r/sum_distinct-big.result: Update result file. mysql-test/r/type_newdecimal-big.result: Update result file. mysql-test/t/ctype_ujis.test: Explicitly specify correct charset. mysql-test/t/schema.test: Drop our test database to not affect this test if some test left it cause of failure. mysql-test/t/show_check.test: Drop our test database to not affect this test if some test left it cause of failure. mysql-test/t/skip_name_resolve.test: Ignore columns with unpredictable values. mysql-test/t/sp-big.test: Add cleanup statement. mysql-test/t/sp-dynamic.test: Add cleanup statements. mysql-test/t/sp.test: Non-scalar values prohibited for assignment to SP-vars; polishing. mysql-test/t/type_newdecimal-big.test: Update type specification so that the variables can contain the large values used in the test. sql/field.cc: Extract create_field::init() to initialize an existing instance of create_field from new_create_field(). sql/field.h: Extract create_field::init() to initialize an existing instance of create_field from new_create_field(). sql/item.cc: - Introduce a new class: Item_sp_variable -- a base class of stored-routine-variables classes; - Introduce Item_case_expr -- an Item, which is used to access to the expression of CASE statement; sql/item.h: - Introduce a new class: Item_sp_variable -- a base class of stored-routine-variables classes; - Introduce Item_case_expr -- an Item, which is used to access to the expression of CASE statement; sql/item_func.cc: Pass the Field (instead of Item) for the return value of a function to the function execution routine. sql/item_func.h: Pass the Field (instead of Item) for the return value of a function to the function execution routine. sql/mysql_priv.h: Move create_virtual_tmp_table() out of sql_select.h. sql/sp.cc: Use create_result_field() instead of make_field(). sql/sp_head.cc: - Add a function to map enum_field_types to Item::Type; - Add sp_instr_push_case_expr instruction -- an instruction to push CASE expression into the active running context; - Add sp_instr_pop_case_expr instruction -- an instruction to pop CASE expression from the active running context; - Adapt the SP-execution code to using Fields instead of Items for SP-vars; - Use create_field structure for field description instead of a set of members. sql/sp_head.h: - Add a function to map enum_field_types to Item::Type; - Add sp_instr_push_case_expr instruction -- an instruction to push CASE expression into the active running context; - Add sp_instr_pop_case_expr instruction -- an instruction to pop CASE expression from the active running context; - Adapt the SP-execution code to using Fields instead of Items for SP-vars; - Use create_field structure for field description instead of a set of members. sql/sp_pcontext.cc: - Change rules to assign an index of SP-variable: use transparent index; - Add an operation to retrieve a list of defined SP-vars from the processing context recursively. sql/sp_pcontext.h: - Change rules to assign an index of SP-variable: use transparent index; - Add an operation to retrieve a list of defined SP-vars from the processing context recursively. sql/sp_rcontext.cc: - Change rules to assign an index of SP-variable: use transparent index; - Use a tmp virtual table to store SP-vars instead of Items; - Provide operations to work with CASE expresion. sql/sp_rcontext.h: - Change rules to assign an index of SP-variable: use transparent index; - Use a tmp virtual table to store SP-vars instead of Items; - Provide operations to work with CASE expresion. sql/sql_class.cc: - Reflect Item_splocal ctor changes; - Item_splocal::get_offset() has been renamed to get_var_idx(). sql/sql_class.h: Polishing. sql/sql_parse.cc: Extract create_field::init() to initialize an existing instance of create_field from new_create_field(). sql/sql_select.cc: Take care of BLOB columns in create_virtual_tmp_table(). sql/sql_select.h: Move create_virtual_tmp_table() out of sql_select.h. sql/sql_trigger.cc: Use boolean constants for boolean type instead of numerical ones. sql/sql_yacc.yy: Provide an instance of create_field for each SP-var. mysql-test/include/sp-vars.inc: The definitions of common-procedures, which are created under different circumstances. mysql-test/r/sp-vars.result: Result file for the SP-vars test. mysql-test/sp-vars.test: A new test for checking SP-vars functionality.
-
- 06 Dec, 2005 1 commit
-
-
unknown authored
field.cc: Adding longlong range checking to return LONGLONG_MIN or LONGLONG_MAX when out of range. Using (longlong) cast only when range is ok. cast.test: Adding test case. cast.result: Fixing results accordingly. sql/field.cc: Bug#15098 CAST(column double TO signed int), wrong result Adding longlong range checking. mysql-test/t/cast.test: Bug#15098 CAST(column double TO signed int), wrong result Adding longlong range checking. mysql-test/r/cast.result: Fixing results accordingly.
-
- 29 Nov, 2005 1 commit
-
-
unknown authored
- use rint() in some other val_int() methods as well.
-
- 20 Nov, 2005 1 commit
-
-
unknown authored
Bad examples of usage of a string with its length fixed. The incorrect length in the trigger file configuration descriptor fixed (BUG#14090). A hook for unknown keys added to the parser to support old .TRG files. sql/field.cc: Inefficient usage of String::append() fixed. Bad examples of usage of a string with its length fixed. sql/ha_berkeley.cc: A bad example of usage of a string with its length fixed. sql/ha_federated.cc: Inefficient usage of String::append() fixed. sql/ha_myisammrg.cc: Bad examples of usage of a string with its length fixed. sql/handler.cc: Inefficient usage of String::append() fixed. sql/item.cc: Bad examples of usage of a string with its length fixed. sql/item.h: A bad example of usage of a string with its length fixed. sql/item_cmpfunc.cc: Bad examples of usage of a string with its length fixed. sql/item_func.cc: Bad examples of usage of a string with its length fixed. sql/item_strfunc.cc: Bad examples of usage of a string with its length fixed. sql/item_subselect.cc: Bad examples of usage of a string with its length fixed. sql/item_sum.cc: Bad examples of usage of a string with its length fixed. Inefficient usage of String::append() fixed. sql/item_timefunc.cc: Inefficient using of String::append() fixed. Bad examples of usage of a string with its length fixed. sql/item_uniq.h: Bad examples of usage of a string with its length fixed. sql/key.cc: Bad examples of usage of a string with its length fixed. sql/log.cc: Bad examples of usage of a string with its length fixed. sql/log_event.cc: Bad examples of usage of a string with its length fixed. sql/mysqld.cc: The dummy parser hook allocated. sql/opt_range.cc: Inefficient usage of String::append() fixed. sql/parse_file.cc: Bad examples of usage of a string with its length fixed. A hook for unknown keys added to the parser. sql/parse_file.h: A hook for unknown keys added to the parser. sql/protocol.cc: A bad example of usage of a string with its length fixed. sql/repl_failsafe.cc: Bad examples of usage of a string with its length fixed. sql/share/errmsg.txt: A warning for old format config file. sql/slave.cc: Bad examples of usage of a string with its length fixed. sql/sp.cc: Bad examples of usage of a string with its length fixed. sql/sp_head.cc: Bad examples of usage of a string with its length fixed. sql/spatial.cc: A bad example of usage of a string with its length fixed. sql/sql_acl.cc: Bad examples of usage of a string with its length fixed. sql/sql_analyse.cc: Bad examples of usage of a string with its length fixed. Inefficient usage of String::append() fixed. sql/sql_lex.cc: Bad examples of usage of a string with its length fixed. sql/sql_load.cc: A bad example of usage of a string with its length fixed. sql/sql_parse.cc: Bad examples of usage of a string with its length fixed. sql/sql_prepare.cc: A bad example of usage of a string with its length fixed. sql/sql_select.cc: Bad examples of usage of a string with its length fixed. sql/sql_show.cc: Bad examples of usage of a string with its length fixed. sql/sql_string.cc: Bad examples of usage of a string with its length fixed. sql/sql_string.h: The macro definition moved to sql_string.h to be accessible in all parts of server. sql/sql_table.cc: Bad examples of usage of a string with its length fixed. sql/sql_trigger.cc: Bad examples of usage of a string with its length fixed. The incorrect length in the trigger file configuration descriptor fixed (BUG#14090). The hook for processing incorrect sql_mode record added. sql/sql_view.cc: A dummy hook used for parsing views. sql/structs.h: The macro definition moved to sql_string.h to be accessible in all parts of server. sql/table.cc: A bad example of usage of a string with its length fixed. sql/tztime.cc: A bad example of usage of a string with its length fixed.
-
- 16 Nov, 2005 1 commit
-
-
unknown authored
field. (Bug #14299) mysql-test/r/type_binary.result: Add results mysql-test/t/type_binary.test: Add new regression test sql/field.cc: Always report truncation of binary and varbinary strings, even if it was just spaces. (Plus some minor style/comment cleanups.)
-
- 14 Nov, 2005 1 commit
-
-
unknown authored
After push fix. Must not access new_field if it is NULL.
-