Commit graph

304 commits

Author SHA1 Message Date
unknown
66eb71f3fc A fix: bug#6931: Date Type column problem when using UNION-Table
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.
2005-02-04 15:31:36 +03:00
unknown
a88f6fda40 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into gw.mysql.r18.ru:/usr/home/ram/work/4.1


sql/item.h:
  Auto merged
2004-12-14 16:26:10 +04:00
unknown
cef35aeb1c bug#6275 "client_test" fail in 4.1.7 make test
bug#6911 resultset metadata always return client character set
2004-12-14 15:58:30 +04:00
unknown
54745a18a1 A quick fix for bug #7257: Crash in default tests: 'subselect'
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.
2004-12-14 15:41:01 +04:00
unknown
8322eb0aaa * Added comments and one assert
* 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()
2004-12-14 03:36:19 +03:00
unknown
0e48685291 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.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
2004-12-14 01:07:06 +03:00
unknown
06cbb73f26 Merged fixes for BUG#6976 and BUG#7079 2004-12-13 20:25:26 +03:00
unknown
75a43405d4 Merged (will need a post-merge fix)
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
2004-12-13 20:10:07 +03:00
unknown
6d7fe8520a Merging fix for BUG#6976 from 4.0 to 4.1
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
2004-12-13 20:06:06 +03:00
unknown
8621164bd1 comment of class edded 2004-12-13 15:05:52 +02:00
unknown
3ce0df5937 new reference which refer to current value not to result used for resolving outer
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
2004-12-11 17:13:19 +02:00
unknown
8127cea512 init values to avoid junk returning in case of null value asking without assigning value (BUG#6806)
mysql-test/r/subselect.result:
   Equal operation under row and empty subquery
mysql-test/t/subselect.test:
   Equal operation under row and empty subquery
sql/item.h:
  init values to avoid junk returning in case of null value asking without assigning value
2004-11-25 22:54:49 +02:00
unknown
3507a52e60 A fix and test case for Bug#6297 "prepared statement, wrong handling
of <parameter> IS NULL":
we must not only set Item::null_value in Item_param, but implement
Item_param::is_null() to work well with IS NULL/IS NOT NULL clauses.


mysql-test/r/ps.result:
  Test case for Bug#6297: test results fixed.
mysql-test/t/ps.test:
  A test case for Bug#6297 "prepared statement, wrong handling of 
  <parameter> IS NULL"
sql/item.h:
  A fix for Bug#6297: we must not only set null_value in Item_param, but
  also implement Item_param::is_null() to work well with  IS NULL/
  IS NOT NULL.
  Item::is_null() commented.
2004-11-21 12:04:27 +03:00
unknown
c5e6941e75 1. When mixing NULL to a character string,
the result takes its charset/collation
attributes from the character string,
e.g.  SELECT func(NULL, _latin2'string')
now returns a latin2 result. This is
done by introducing a new derivation
(aka coercibility) level DERIVATION_IGNORABLE,
which is used with Item_null.
2. 'Pure' NULL is now BINARY(0), not CHAR(0).
I.e. NULL is now more typeless.


mysql-test/r/metadata.result:
  Fixing test results:
  CHAR(0) -> BINARY(0) for NULLs
mysql-test/r/null.result:
  Testing mixing NULL with a character string with a number of functions.
mysql-test/r/ps_2myisam.result:
  Fixing test results:
  CHAR(0) -> BINARY(0) for NULLs
mysql-test/r/ps_3innodb.result:
  Fixing test results:
  CHAR(0) -> BINARY(0) for NULLs
mysql-test/r/ps_4heap.result:
  Fixing test results:
  CHAR(0) -> BINARY(0) for NULLs
mysql-test/r/ps_5merge.result:
  Fixing test results:
  CHAR(0) -> BINARY(0) for NULLs
mysql-test/r/ps_6bdb.result:
  Fixing test results:
  CHAR(0) -> BINARY(0) for NULLs
mysql-test/r/ps_7ndb.result:
  Fixing test results:
  CHAR(0) -> BINARY(0) for NULLs
mysql-test/t/null.test:
  Testing mixing NULL with a character string with a number of functions.
sql/item.cc:
  New derivation level.
sql/item.h:
  New derivation level.
2004-11-10 14:05:28 +04:00
unknown
fc04692c8b Many files:
Allow mixing of different character sets for more SQL functions.
item_func.h:
  Allow mixing of different character sets for more SQL functions..


sql/item_cmpfunc.cc:
  Allow mixing of different character sets for more SQL functions.
sql/item_func.cc:
  Allow mixing of different character sets for more SQL functions.
sql/item_func.h:
  Allow mixing of different character sets for more SQL functions..
sql/item_strfunc.cc:
  Allow mixing of different character sets for more SQL functions.
sql/item.cc:
  Allow mixing of different character sets for more SQL functions.
sql/item.h:
  Allow mixing of different character sets for more SQL functions.
mysql-test/t/ctype_recoding.test:
  Allow mixing of different character sets for more SQL functions.
mysql-test/r/ctype_recoding.result:
  Allow mixing of different character sets for more SQL functions.
2004-11-02 16:02:12 +04:00
unknown
a739f2d692 Allow to convert to non-Unicode charset when mixing a string
constant with a column. The string is converted into the column
character set. It conversion doesn't lose data, then operation
is possible. Otherwise, give an error, as it was earlier.


sql/item.h:
  Change bool argument to uint flags:
  we have now two different flags.
2004-10-29 16:00:03 +05:00
unknown
2f8b0ab3a7 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1


sql/item.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2004-10-22 19:51:04 +03:00
unknown
1cd249e0ed Followup to fix for bug#6050: fix valgrind warnings.
sql/item.cc:
  Fix valgrind errors: we need Item::name to point to PS memory
  as well.
sql/item.h:
  set_field no longer can be reused as is for PS purposes.
sql/sql_union.cc:
  Item_field::set_field -> Item_field::reset_field.
2004-10-22 20:21:55 +04:00
unknown
bc6652db9b Fix compiler warnings (detected by Intel's C++ compiler)
Fixed checking of privilege handling in CREATE ... SELECT (Bug #6094)


client/mysql.cc:
  Fix compiler warnings
client/mysqltest.c:
  Fix wrong counting of lines
  Remove compiler warnings
heap/hp_hash.c:
  Fix compiler warnings
innobase/dict/dict0load.c:
  Fix compiler warnings
innobase/include/mem0mem.h:
  Fix compiler warnings
libmysql/client_settings.h:
  Fix compiler warnings
myisam/ft_nlq_search.c:
  Add comments about compiler warnings
myisam/rt_index.c:
  Add comments about compiler warnings
myisam/rt_mbr.c:
  Add comments about compiler warnings
mysql-test/r/ps.result:
  Test case for bug#6094
mysql-test/t/ps.test:
  Test case for bug#6094
mysys/hash.c:
  Fix compiler warnings
mysys/my_handler.c:
  Add comments about compiler warnings
mysys/my_thr_init.c:
  Add comments about compiler warnings
ndb/include/mgmapi/mgmapi.h:
  Fix compiler warnings
regex/main.c:
  Fix compiler warnings
sql/item.h:
  Fix compiler warnings
sql/item_func.h:
  Add comments about compiler warnings
sql/spatial.h:
  Add comments about compiler warnings
sql/sql_lex.h:
  Fix compiler warning
sql/sql_list.h:
  Fix compiler warning
sql/sql_parse.cc:
  Move testing of access rights of tables in CREATE ... SELECT to create_table_precheck() to fix privilege checking in CREATE ... SELECT
  (Bug #6094)
sql/sql_prepare.cc:
  Remove not needed empty line
sql/sql_string.h:
  Fix compiler warnings
strings/ctype-mb.c:
  Fix compiler warnings
2004-10-22 18:44:51 +03:00
unknown
4512a46e65 A fix and test case for Bug#6050 "EXECUTE stmt reports ambiguous field
names with ident. tables fr. diff. schemata": revise all uses of
Item_field and make them prepared-statements friendly when necessary.


mysql-test/r/ps.result:
  Test results fixed: the test case for Bug#6050
mysql-test/r/ps_1general.result:
  Test results fixed: in prepared statements we expand '*' to a list
  of fully qualified fields (db.table.column).
mysql-test/t/ps.test:
  A test for Bug#6050 "EXECUTE stmt reports ambiguous fieldnames with 
  ident. tables fr. diff. schemata"
sql/item.cc:
  Revise all Item_field constructors: we need to make sure that no Item_field
  object points to unaccessible memory in prepared statements.
sql/item.h:
  Revise all Item_field constructors: we need to make sure that no Item_field
  object points to unaccessible memory in prepared statements.
sql/sql_base.cc:
  Item_field use changed to be prepared statements friendly.
sql/sql_class.h:
  New check of Item_arena state.
sql/sql_union.cc:
  Fixing the problem with name resolving in UNION and prepared statements:
  In case of SELECT a, b, c FROM t1 UNION SELECT a, b, c FROM t2 the list of
  selected items is represented as a List<Item_field>, where each 
  Item_field points to a field of temporary table.
  But the temporary table is created anew on each execution of the prepared 
  statement. So on each subsequent execution we should reset Item_field
  items to point to fields from freshly-created temporary table.
sql/table.h:
  Comment TABLE member.
2004-10-22 14:47:35 +04:00
unknown
9ed05da49d item.h:
A fix for Bug#6042 "constants propogation works olny once (prepared
  statements)": reset item->marker in Item::cleanup, as it's used
  in propogate_cond_constants. No test case as the only way I could
  come up with to show the problem is EXPLAIN, and EXPLAIN is painful
  to use in the test suite.


sql/item.h:
  A fix for Bug#6042 "constants propogation works olny once (prepared
  statements)": reset item->marker in Item::cleanup, as it's used
  in propogate_cond_constants
2004-10-12 17:33:13 +04:00
unknown
fe0a0347fc Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/media/sda1/mysql/mysql-4.1-hook


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
2004-10-10 02:39:48 +04:00
unknown
1d48aec228 A fix and test case for Bug#5987 "subselect in bool function
crashes server (prepared statements)": the bug was that all boolean
items always recovered its original arguments at statement cleanup 
stage.
This collided with Item_subselect::select_transformer, which tries to 
permanently change the item tree to use a transformed subselect instead of
original one.
So we had this call sequence for prepare:
mysql_stmt_prepare -> JOIN::prepare -> 
Item_subselect::fix_fields -> the item tree gets transformed ->
Item_bool_rowready_func2::cleanup, item tree is recovered to original
state, while it shouldn't have been;
mysql_stmt_execute -> attempts to execute a broken tree -> crash.
Now instead of bluntly recovering all arguments of bool functions in 
Item_bool_rowready_func2::cleanup, we recover only those
which were changed, and do it in one place.
There still would exist a possibility for a collision with subselect
tranformation, if permanent and temporary changes were performed at the 
same stage.
But fortunately subselect transformation is always done first, so it 
doesn't conflict with the optimization done by propogate_cond_constants.
Now we have: 
mysql_stmt_prepare -> JOIN::prepare -> subselect transformation 
permanently changes the tree -> cleanup doesn't recover anything, 
because nothing was registered for recovery.
mysql_stmt_execute -> JOIN::prepare (the tree is already transformed, 
so it doesn't change), JOIN::optimize -> 
propogate_cond_constants -> temporary changes the item tree 
with constants -> JOIN::execute -> cleanup -> 
the changes done by propogate_cond_constants are recovered, as
they were registered for recovery.


mysql-test/r/ps.result:
  Bug#5987: test results fixed.
mysql-test/t/ps.test:
  A test for bug#5987 "subselect in bool function crashes server 
  (prepared statements)"
sql/item.cc:
  resolve_const_item is now responsible to register all changes of the 
  item tree for recovery
sql/item.h:
  resolve_const_item signagture changed
sql/item_cmpfunc.h:
  Arguments of boolean functions are now recovered using the 
  centralized registry of THD.
sql/sql_class.cc:
  It's crucial to add new items to the beginning of the recovery list,
  so that the recovery is performed in LIFO mode: otherwise if we 
  change one node of a tree twice, it will be recovered to some intermediate
  state.
sql/sql_select.cc:
  change_cond_ref_to_const and propogate_cond_constants are now responsible
  to register all changes of the item tree for recovery.
  The recovery is done using the centralized THD registry of
  changed tree items.
2004-10-10 02:39:22 +04:00
unknown
c6b382d63b args_copy and cleunup() removed from Item_sum
registration changing ITEM_SUM arguments added


sql/item.cc:
  cleunup for Item_result_field
sql/item.h:
  cleunup for Item_result_field
sql/item_sum.cc:
  args_copy and cleunup() removed from Item_sum
sql/item_sum.h:
  args_copy and cleunup() removed from Item_sum
sql/sql_select.cc:
  registration changing ITEM_SUM arguments
2004-10-09 01:01:19 +03:00
unknown
166d19e963 Deployment of centralized Item change registry, step 2: Item_ref
doesn't need to have it's own recovery mechanism.


sql/item.cc:
  Deployment of centralized Item change registry, step 2: Item_ref 
  doesn't need to have it's own recovery mechanism, so it was simplified.
sql/item.h:
  Deployment of centralized Item change registry, step 2: Item_ref 
  doesn't need to have it's own recovery mechanism, so it was simplified.
sql/item_cmpfunc.cc:
  - Item::split_sum_func now requires THD
  - use THD::register_item_tree_change
sql/item_cmpfunc.h:
  - Item::split_sum_func now requires THD
sql/item_func.cc:
  - Item::split_sum_func now requires THD
  - use THD::register_item_tree_change
sql/item_func.h:
  - Item::split_sum_func now requires THD
sql/item_row.cc:
  - Item::split_sum_func now requires THD
  - use THD::register_item_tree_change
sql/item_row.h:
  - Item::split_sum_func now requires THD
sql/item_strfunc.cc:
  - Item::split_sum_func now requires THD
  - use THD::register_item_tree_change to register changes in the item
    tree
sql/item_strfunc.h:
  - Item::split_sum_func now requires THD
sql/item_subselect.cc:
  - use updated Item_ref constructor
sql/sql_base.cc:
  - Item::split_sum_func now requires THD
sql/sql_select.cc:
  - Item::split_sum_func now requires THD
sql/sql_yacc.yy:
  - use updated Item_ref constructor
2004-10-08 19:13:09 +04:00
unknown
8fa6f37a29 A fix for Bug#5748 "Prepared statement with BETWEEN and bigint values
crashes mysqld": implementation for a generic item tree modifications
registry. Every item tree modification which should be rolled back for
subsequent execution of a prepared statement or stored procedure should
be saved in the registry. All such modifications are rolled back at once
during cleanup stage of PS.
Actual fix for the bug just adds a call to register modifications to
convert_constant_item.
Post review fixes implemented.


mysql-test/r/ps.result:
  A fix for bug#5748, test results fixed.
mysql-test/t/ps.test:
  A test case for Bug#5748 "Prepared statement with BETWEEN and bigint 
  values crashes mysqld"
sql/item.cc:
  Fix for Bug#5748 "Prepared statement with BETWEEN and bigint values
  crashes mysqld":
  First step in removing up item-specific cleanups: now all such
  tree modifications should be done using the genericm mechanism implemented
  in this changeset.
sql/item.h:
  Fix for Bug#5748 "Prepared statement with BETWEEN and bigint values
  crashes mysqld": no need for an item-specific change record any more.
sql/item_cmpfunc.cc:
  A fix for Bug#5748 "Prepared statement with BETWEEN and bigint 
  values crashes mysqld": register item tree transformation performed by
  convert_constant_item.
sql/sql_class.cc:
  Implementation for item tree transformations registry.
sql/sql_class.h:
  Declarations, necessary for the tree transformations registry.
sql/sql_parse.cc:
  Assert that the item tree transformations registry is not used for 
  conventional execution.
sql/sql_prepare.cc:
  Use of the item tree modifications registry in prepared statements:
  rollback all modifications in the end of statement prepare and execute.
  Also we now always set thd->current_arena to be able to determine that
  this is an execution of prepared statement inside the registry code.
tests/client_test.c:
  A typo fixed.
2004-10-08 02:21:19 +04:00
unknown
40c12fa8c6 some comments added 2004-09-25 16:05:50 +03:00
unknown
e177c9586d Return character strings in table, type, possible_keys, key fields
of EXPLAIN SELECT, rather than binary strings.
2004-09-16 14:47:39 +05:00
unknown
705d50660d Move collation aggregation with superset conversion code
from Item_bool_func2 into DTCollation to make it reusable
for other types of items.
2004-09-01 13:56:33 +05:00
unknown
1dc52f0763 after review patch
mysql-test/r/negation_elimination.result:
  new tests of negation elimination
mysql-test/t/negation_elimination.test:
  new tests of negation elimination
sql/item.h:
  test of boolean functions added
sql/item_cmpfunc.cc:
  NOT subtree is already checked, so wee need to return just argument
sql/item_cmpfunc.h:
  test of boolean functions added
sql/mysql_priv.h:
  'place' to detect WHERE clause
sql/sql_parse.cc:
  function for creation negated expression
sql/sql_select.cc:
  removed unused function
sql/sql_select.h:
  removed unused function
sql/sql_yacc.yy:
  'place' to detect WHERE clause
2004-08-31 21:10:57 +03:00
unknown
b37a736110 Fix for BUG#4488: first portion: sign aware '<' and '>' comparisons. 2004-08-11 23:08:20 +04:00
unknown
50d4d61598 unused field removed 2004-06-28 20:01:11 +03:00
unknown
1249934266 correct eq() method for Item_param (BUG#4233)
mysql-test/r/ps.result:
  eq() for parameters test
mysql-test/t/ps.test:
  eq() for parameters test
sql/item.h:
  correct eq() method for Item_param
2004-06-26 23:55:38 +02:00
unknown
ef0b6f0703 type of parameter assignment for parameters from variables added (BUG#4280)
mysql-test/r/ps.result:
  parameters from variables (for field creation)
mysql-test/t/ps.test:
  parameters from variables (for field creation)
sql/item.cc:
  type of parameter assignment for parameters from variables
sql/item.h:
  removed spaces at line ends in Item_param definition
2004-06-25 15:16:00 +03:00
unknown
5e7260ab4f after merge fix
sql/item.h:
  Auto merged
2004-06-22 14:48:29 +05:00
unknown
cbfe9f0517 Fix for bug#4105 "Server crash on attempt to prepare a statement with
character set introducer": add new item type to be returned before from 
Item_param until it's value is set.
This way items like Item_bool_func2 and udf_handler won't treat this item
as constant literal when statement is prepared.


mysql-test/r/ps.result:
  Test results fixed (test case for bug #4105)
mysql-test/t/ps.test:
  Followup to bug #4105: a test case.
sql/item.cc:
  Fix for bug#4105 "Server crash on attempt to prepare a statement with 
  character set introducer": add new item type to be returned before from 
  Item_param until it's value is set.
sql/item.h:
  Fix for bug#4105 "Server crash on attempt to prepare a statement with 
  character set introducer": add new item type to be returned before from 
  Item_param until it's value is set.
2004-06-18 04:16:08 +04:00
unknown
6edb8d5bc7 after review fix (BUG#4067)
sql/field.cc:
  method getting maximum display length for fields
sql/field.h:
  method getting maximum display length for fields
sql/item.cc:
  code cleanup
  switch replaced with new method
sql/item.h:
  method getting maximum display length for fields
2004-06-17 13:48:31 +03:00
unknown
7b2357e03a a fix (Bug #4102 Crash with a DBUG window after a request) 2004-06-16 18:43:05 +05:00
unknown
a9d4556649 new length detection for non-string in UNION (BUG#4067)
mysql-test/r/subselect.result:
  new length in UNION
mysql-test/r/union.result:
  new length in UNION
  test of int with wrong display length
mysql-test/t/union.test:
  test of int with wrong display length
sql/item.cc:
  new length detection for non-string
sql/item.h:
  new length detection for non-string
2004-06-16 16:06:30 +03:00
unknown
19a5cf935a Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/kostja/mysql/mysql-4.1-4026


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
2004-06-09 03:22:55 +04:00
unknown
27eda71204 Proposed fix for Bug#4026 "Microseconds part of TIME/DATETIME types
is broken (prepared statements)": fixed date handling in many places 
of prepared statements code.


libmysql/libmysql.c:
  Fix for Bug#4026:
  - now buffer_length is defined for any buffer type. Network buffer 
    preallocation cleaned up.
  - added constants for maximum buffer sizes necessary for MYSQL_TYPE_DATE,
    MYSQL_TYPE_TIME, MYSQL_TYPE_DATETIME types.
  - TIME/DATETIME packing/unpacking functions fixed 
  - now result set metadata is always updated from fields sent to COM_EXECUTE.
    This is necessary to make 'SELECT ?' queries work without conversions.
sql/item.cc:
  - added implementatoin of Item_param::get_date
sql/item.h:
  - added enum_field_types Item_param::param_type. First step for proper
    handling of placeholders.
  - added get_date() implementation to prevent date -> string -> date 
    conversions when MYSQL_TYPE_DATE/DATETIME parameter is used in temporal 
    context.
sql/protocol.cc:
  Fix for Bug#4026:
  - PACKET_BUFFET_EXTRA_ALLOC -> PACKET_BUFFER_EXTRA_ALLOC.
    The define itself was moved to .cc as it's used only in protocol.cc
  - fixed Protocol_prep::store_time() call.
sql/protocol.h:
  - PACKET_BUFFER_EXTRA_ALLOC moved to protocol.cc
sql/sql_prepare.cc:
  Fix for Bug#4026:
  - MYSQL_TYPE_TIME/DATETIME handling fixed.
  - added initialization for Item_param::param_type in 
    setup_one_conversion_function
tests/client_test.c:
  Test case for Bug#4026
2004-06-09 03:21:50 +04:00
unknown
1d4ee7f81c Post review fixes for "SQL Syntax for Prepared Statements".
mysql-test/r/ps.result:
  Better error message
mysys/my_error.c:
  Comments added
sql/item.cc:
  Moved a chunk of code from sql_prepare.cc to Item_param::set_from_user_var
sql/item.h:
  Moved a chunk of code from sql_prepare.cc to Item_param::set_from_user_var
sql/item_func.cc:
  Code cleanup
sql/mysql_priv.h:
  Code cleanup
sql/sql_class.cc:
  Code cleanup
sql/sql_parse.cc:
  use user_var_entry::val_str in PREPARE stmt FROM @var.
sql/sql_prepare.cc:
  Post-review fixes and code cleanup.
sql/sql_yacc.yy:
  Coding style fixes
2004-06-07 12:09:10 +04:00
unknown
4d3dce7fc1 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/dbdata/psergey/mysql-4.1-ps-merge


mysys/my_error.c:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/share/czech/errmsg.txt:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/share/dutch/errmsg.txt:
  Auto merged
sql/share/english/errmsg.txt:
  Auto merged
sql/share/estonian/errmsg.txt:
  Auto merged
sql/share/french/errmsg.txt:
  Auto merged
sql/share/german/errmsg.txt:
  Auto merged
sql/share/greek/errmsg.txt:
  Auto merged
sql/share/hungarian/errmsg.txt:
  Auto merged
sql/share/italian/errmsg.txt:
  Auto merged
sql/share/japanese/errmsg.txt:
  Auto merged
sql/share/korean/errmsg.txt:
  Auto merged
sql/share/norwegian-ny/errmsg.txt:
  Auto merged
sql/share/norwegian/errmsg.txt:
  Auto merged
sql/share/polish/errmsg.txt:
  Auto merged
sql/share/portuguese/errmsg.txt:
  Auto merged
sql/share/romanian/errmsg.txt:
  Auto merged
sql/share/russian/errmsg.txt:
  Auto merged
sql/share/slovak/errmsg.txt:
  Auto merged
sql/share/spanish/errmsg.txt:
  Auto merged
sql/share/swedish/errmsg.txt:
  Auto merged
sql/share/ukrainian/errmsg.txt:
  Auto merged
2004-06-01 17:29:13 +04:00
unknown
7f1303329d Fix for Bug#3796 "Prepared statement, select concat(<parameter>,<column>), wrong
result": new Item_param member for use in val_str()


sql/item.cc:
  Fix for Bug#3796:
  - return str_value_ptr from val_str to prevent modifications of parameter 
  value.
sql/item.h:
  Fix for bug#3796:
  - Item::val_str() method semantics documented
  - new member of Item_param
tests/client_test.c:
  Test case for bug #3796 added. A few compile-time warnings removed.
2004-05-31 14:21:48 +04:00
unknown
4cca7db746 Manually merged, requirees more merging
sql/mysql_priv.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2004-05-25 08:15:50 +04:00
unknown
093d62922b Support for character set conversion in binary protocol: another go
after Monty's review.
- Item_param was rewritten.
- it turns out that we can't convert string data to character set of
  connection on the fly, because they first should be written to the binary
  log.
  To support efficient conversion we need to rewrite prepared statements
  binlogging code first.


include/my_global.h:
  Macro swap(a, b, c) was renamed to resolve name conflict with
  String::swap() method.
include/my_sys.h:
  Added declaration of escape_string_for_mysql()
include/mysql_com.h:
  Removed and moved back: a macro which is visible to libmysql user but
  has sence only in prepared statement protocol implementation.
isam/_search.c:
  swap -> swap_variables
isam/test2.c:
  swap -> swap_variables
libmysql/libmysql.c:
  - sub_escape_string moved to mysys/charset.c to be visible in sql/
  - few cleanups
myisam/mi_test2.c:
  swap -> swap_variables
mysys/charset.c:
  sub_escape_string was moved from libmysql.c to be able to use it in sql/
  code.
mysys/my_chsize.c:
  rename: swap -> swap_variables
mysys/my_compress.c:
  swap -> swap_variables
mysys/my_handler.c:
  swap -> swap_variables
sql/field.cc:
  Field::store_time refactored to use TIME_to_string function from time.cc
sql/item.cc:
  New implementation of Item_param class:
  added support for character sets conversion.
sql/item.h:
  Item_param:
  - 'state' member introduced instead of many boolean variables.
  - put ltime, int_value and real_value into union to save space.
  - remove unimplemented members
  - set_value renamed to set_str
sql/item_timefunc.cc:
  Refactored to use functions from time.cc
sql/lock.cc:
  rename: swap -> swap_variables
sql/mysql_priv.h:
  - added declarations for TIME_to_ulonglong_*, TIME_to_string functions
  - const specifiers for make_date, make_time, make_datetime arguments
sql/opt_range.cc:
  rename: swap -> swap_variables
sql/protocol.cc:
  - added character set conversion support to binary protocol.
  - Protocol::convert changed to point at shared buffer in THD.
    This lets us use one convert buffer for binary and simple protocol.
    The same buffer is used for client->server conversions in prepared
    statements code.
  - string conversion code refactored to Protocol::store_string_aux function.
  - few more comments
sql/protocol.h:
  - Protocol::convert now points at THD::convert_buffer: we want to share one
    buffer between all protocol implementations.
sql/sql_class.cc:
  - implementation of THD::convert_string using THD::convert_buffer
    (conversion of strings allocated in the system heap).
sql/sql_class.h:
  - THD::convert_buffer is shared between THD and network Protocols and
    used for character set conversion of strings.
  - new function to convert String object from one charset to another using
    THD::convert_buffer
sql/sql_insert.cc:
  A little fix in a comment.
sql/sql_parse.cc:
  Shrink convert buffer in the end of each statement.
sql/sql_prepare.cc:
    Many changes:
  - static specifier for set_param_* family of functions.
  - FIELD_TYPE -> MYSQL_TYPE
  - added set_param_binary as handler for BLOB types.
  - added character set support
  - added support for param typecode in mysql_stmt_get_longdata
    (mysql_stmt_send_long_data handler)
  - changes in Item_param deployed
  - few cleanups
sql/sql_select.cc:
  rename: swap -> swap_variables
sql/sql_string.cc:
  - String::append rewritten to support character set conversion for
  single-byte encodings.
  - added String::swap method to efficiently exchange two string objects.
sql/sql_string.h:
  Declraration for String::swap().
sql/time.cc:
  - function TIME_to_string to convert TIME to String in default MySQL format
  - family of functions TIME_to_ulonglong_*
tests/client_test.c:
  Test for support for character set conversions in prepared statements
  (binary and text data).
2004-05-25 02:03:49 +04:00
unknown
e7710af7f4 WL#1622 "SQL Syntax for Prepared Statements": Post-review fixes (1 of 2)
mysql-test/r/ps.result:
  Added tests for PREPARE stmt1 FROM @var syntax
mysql-test/t/ps.test:
  Added tests for PREPARE stmt1 FROM @var syntax
mysys/my_error.c:
  Added support for "%.*s" format
sql/item.cc:
  Removed one redundant Item_param::set_value function
sql/item.h:
  Removed one redundant Item_param::set_value function
sql/mysqld.cc:
  Reformmated the code
sql/share/czech/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/dutch/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/english/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/estonian/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/french/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/german/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/greek/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/hungarian/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/italian/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/japanese/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/korean/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/norwegian-ny/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/norwegian/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/polish/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/portuguese/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/romanian/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/russian/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/slovak/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/spanish/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/swedish/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/share/ukrainian/errmsg.txt:
  Changed ER_UNKNOWN_STMT_HANDLER format string
sql/sql_class.h:
  SQL Prepared statements now can't be used by binary protocol commands
sql/sql_lex.h:
  Added support for PREPARE stmt1 FROM @var syntax.
sql/sql_parse.cc:
  Added support for PREPARE stmt1 FROM @var syntax.
sql/sql_prepare.cc:
  Code cleanup
sql/sql_yacc.yy:
  Added support for PREPARE stmt1 FROM @var syntax.
2004-05-21 04:27:50 +04:00
unknown
d55809d891 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/dbdata/psergey/mysql-4.1-ps-merge


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_lex.h:
  Auto merged
2004-05-07 03:33:39 +04:00
unknown
f3544f3c5d Portability fixes
Change strtoll -> my_strtoll10()
Fixed bug in my_strntoul() and my_strntol() where we got different values on 32 and 64 bit systems (Bug #3472)


configure.in:
  Fixed problem on IRIX64 (One can't have AC_MSG_RESULT on same row as AC_DEFINE
extra/my_print_defaults.c:
  Fixed wrong definition for 'verbose'
include/my_global.h:
  Portability fix (IRIX64)
libmysql/client_settings.h:
  Remove compiler warnings
libmysql/libmysql.c:
  Remove compiler warnings
mysql-test/r/func_str.result:
  Updated results
mysql-test/r/key_cache.result:
  Updated results to not depend on key_blocks_unused
mysql-test/t/func_str.test:
  More test of long overflow
mysql-test/t/key_cache.test:
  Updated results to not depend on key_blocks_unused
sql/item.cc:
  Portability fix (don't use strtoll())
sql/item.h:
  Portability fix (don't use strtoll())
sql/item_sum.h:
  Portability fix (don't use strtoll())
sql/item_timefunc.cc:
  Fixed compiler warning
strings/ctype-simple.c:
  Fixed bug in my_strntoul() and my_strntol() where we got different values on 32 and 64 bit systems
strings/ctype-ucs2.c:
  Fixed bug in my_strntoul() and my_strntol() where we got different values on 32 and 64 bit systems
2004-05-07 01:43:17 +03:00
unknown
6810ca1b71 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/dbdata/psergey/mysql-4.1-ps-merge


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2004-05-06 23:02:32 +04:00