Commit graph

487 commits

Author SHA1 Message Date
unknown
03a85abe90 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0
into rurik.mysql.com:/home/igor/mysql-5.0


sql/item.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
2005-06-07 06:00:37 -07:00
unknown
edb38786c9 Manual merge.
sql/item.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_handler.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-06-07 14:50:45 +04:00
unknown
5188f031ae Patch two (the final one) for Bug#7306 "the server side preparedStatement
error for LIMIT placeholder".
The patch adds grammar support for LIMIT ?, ? and changes the
type of ST_SELECT_LEX::select_limit,offset_limit from ha_rows to Item*,
so that it can point to Item_param.


mysql-test/include/ps_modify.inc:
  Fix existing tests: now LIMIT can contain placeholders.
mysql-test/include/ps_query.inc:
  Fix existing tests: now LIMIT can contain placeholders.
mysql-test/r/ps.result:
  Add basic test coverage for LIMIT ?, ? and fix test results.
mysql-test/r/ps_2myisam.result:
  Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_3innodb.result:
  Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_4heap.result:
  Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_5merge.result:
  Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_6bdb.result:
  Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_7ndb.result:
  Fix test results: now LIMIT can contain placeholders.
mysql-test/t/ps.test:
  Add basic test coverage for LIMIT ?, ?.
sql/item.h:
  Add a short-cut for (ulonglong) val_int() to Item.
  Add a constructor to Item_int() that accepts ulonglong.
  Simplify Item_uint constructor by using the c-tor above.
sql/item_subselect.cc:
  Now select_limit has type Item *.
  We can safely create an Item in Item_exists_subselect::fix_length_and_dec():
  it will be allocated in runtime memory root and freed in the end of
  execution.
sql/sp_head.cc:
  Add a special initalization state for stored procedures to 
  be able to easily distinguish the first execution of a stored procedure
  from prepared statement prepare.
sql/sql_class.h:
  Introduce new state 'INITIALIZED_FOR_SP' to be able to easily distinguish
  the first execution of a stored procedure from prepared statement prepare.
sql/sql_derived.cc:
  - use unit->set_limit() to set unit->select_limit_cnt, offset_limit_cnt
    evreryplace. Add a warning about use of set_limit in 
  mysql_derived_filling.
sql/sql_error.cc:
  - use unit->set_limit() to set unit->select_limit_cnt, offset_limit_cnt
    evreryplace.
  - this change is also aware of bug#11095 "show warnings limit 0 returns 
  all rows instead of zero rows", so the one who merges the bugfix from
  4.1 can use local version of sql_error.cc.
sql/sql_handler.cc:
  - use unit->set_limit() to initalize 
  unit->select_limit_cnt,offset_limit_cnt everyplace.
sql/sql_lex.cc:
  Now ST_SELECT_LEX::select_limit, offset_limit have type Item *
sql/sql_lex.h:
  Now ST_SELECT_LEX::select_limit, offset_limit have type Item *
sql/sql_parse.cc:
  - use unit->set_limit() to initalize 
  unit->select_limit_cnt,offset_limit_cnt everyplace. 
  - we can create an Item_int to set global limit of a statement:
  it will be created in the runtime mem root and freed in the end of
  execution.
sql/sql_repl.cc:
  Use unit->set_limit to initialize limits.
sql/sql_select.cc:
  - select_limit is now Item* so the proper way to check for default value
  is to compare it with NULL.
sql/sql_union.cc:
  Evaluate offset_limit_cnt using the new type of ST_SELECT_LEX::offset_limit
sql/sql_view.cc:
  Now ST_SELECT_LEX::select_limit, offset_limit have type Item *
sql/sql_yacc.yy:
  Add grammar support for LIMIT ?, ? clause.
2005-06-07 14:11:36 +04:00
unknown
ecd32735e2 Merge rurik.mysql.com:/home/igor/dev/mysql-4.1-0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0


mysql-test/r/group_by.result:
  Auto merged
sql/item.h:
  Auto merged
sql/item_buff.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2005-06-07 03:07:42 -07:00
unknown
4da133cabf sql_select.cc, item_buff.cc, item.h:
Fixed bug #11088: a crash for queries with GROUP BY a BLOB column
  + COUNT(DISTINCT...) due to an attempt to allocate a too large
  buffer for the BLOB field.
  Now the size of the buffer is limited by max_sort_length.
group_by.test, group_by.result:
  Added a test case for bug #11088.


mysql-test/r/group_by.result:
  Added a test case for bug #11088.
mysql-test/t/group_by.test:
  Added a test case for bug #11088.
sql/item.h:
  Fixed bug #11088: a crash for queries with GROUP BY a BLOB column
  + COUNT(DISTINCT...) due to an attempt to allocate a too large
  buffer for the BLOB fields.
  Now the size of the buffer is limited by max_sort_length.
sql/item_buff.cc:
  Fixed bug #11088: a crash for queries with GROUP BY a BLOB column
  + COUNT(DISTINCT...) due to an attempt to allocate a too large
  buffer for the BLOB fields.
  Now the size of the buffer is limited by max_sort_length.
sql/sql_select.cc:
  Fixed bug #11088: a crash for queries with GROUP BY a BLOB column
  + COUNT(DISTINCT...) due to an attempt to allocate a too large
  buffer for the BLOB fields.
  Now the size of the buffer is limited by max_sort_length.
2005-06-07 03:05:57 -07:00
unknown
4eb26350cb merge
client/mysql.cc:
  Auto merged
libmysql/libmysql.c:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_bitmap.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2005-06-05 17:19:50 +03:00
unknown
b08b3a1555 Cleanup during review
Simple optimization for 2 argument usage to function of variable arguments
Fix stack overrun when using 1+1+1+1+1+1+1+....
Update crash-me results for 5.0
Don't call post_open if pre_open() fails (optimization)



sql-bench/limits/mysql-4.1.cfg:
  Rename: sql-bench/limits/mysql.cfg -> sql-bench/limits/mysql-4.1.cfg
libmysql/libmysql.c:
  More portable define
mysql-test/mysql-test-run.sh:
  Write also InnoDB warnings to warnings.log
mysql-test/t/type_newdecimal.test:
  Don't get errors if innodb is not defined
mysys/my_alloc.c:
  Cleanup comments
mysys/thr_lock.c:
  Cleanup comments
sql/item.h:
  Remove not needed initializer
sql/item_func.cc:
  Simple optimization for 2 argument usage to function of variable arguments
sql/mysql_priv.h:
  We use more stackspace with the introduction of int_op() etc.
  This change ensures we don't run out of stack when doing 1+1+1+1...
  (Tested on x86, 32 bit)
sql/sp_head.cc:
  Don't call post_open if pre_open() fails
sql/sp_rcontext.cc:
  More comments
  Change so that post_open() doesn't have to be called if pre_open() fails
sql/sql_parse.cc:
  Fold long lines
sql/sql_select.cc:
  Simple reorganization to reduce number of if's
  Ensure that table_map is updated for where clause (fixed warning from valgrind)
2005-06-05 17:01:20 +03:00
unknown
6de5ae6816 Post review fix of BUG#10969.
sql/item.h:
  Return name as LEX_STRING instead of its components.
sql/sql_yacc.yy:
  Name returned as LEX_STRING instead of its components.
2005-06-03 12:56:51 +02:00
unknown
ae28b3bd07 Fixed BUG#10969: Stored procedures: crash if default() function
Return an error if default() is used on a local variable.
  This is actaully a side-effect of BUG#5967: Stored procedure declared
  variable used instead of column (to be fixed later), so this is really a
  workaround until that is fixed.


mysql-test/r/sp-error.result:
  New test case for BUG#10969.
mysql-test/t/sp-error.test:
  New test case for BUG#10969.
sql/item.h:
  Get name of local variable for error messages.
sql/sql_yacc.yy:
  Return an error if default() is applied on a local SP variable.
2005-06-01 15:42:40 +02:00
unknown
865b8917d6 Move function from header file to make it easier to debug
sql/item.cc:
  Move function to make it easier to debug
sql/item.h:
  Move function to make them easier to debug
2005-05-26 00:18:24 +03:00
unknown
896786eadd Manual merge of patch fixing several trigger related bugs with main tree.
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Manual merge
sql/sql_update.cc:
  Manual merge
2005-05-24 22:35:41 +04:00
unknown
1fa7c69d31 Fix for bugs:
#5860 "Multi-table UPDATE does not activate update triggers"
 #6812 "Triggers are not activated for INSERT ... SELECT"
 #8755 "Trigger is not activated by LOAD DATA".
This patch also implements proper handling of triggers for special forms
of insert like REPLACE or INSERT ... ON DUPLICATE KEY UPDATE. 
Also now we don't call after trigger in case when we have failed to
inserted/update or delete row. Trigger failure should stop statement
execution.

I have not properly tested handling of errors which happen inside of
triggers in this patch, since it is simplier to do this once we will be
able to access tables from triggers.


mysql-test/r/trigger.result:
  Added tests for triggers behavior for various non-standard forms of
  INSERT such as REPLACE and INSERT ... ON DUPLICATE KEY UPDATE.
  Also added tests for bugs #5860 "Multi-table UPDATE does not activate
  update triggers", #6812 "Triggers are not activated for INSERT ... SELECT"
  and #8755 "Trigger is not activated by LOAD DATA".
mysql-test/t/trigger.test:
  Added tests for triggers behavior for various non-standard forms of
  INSERT such as REPLACE and INSERT ... ON DUPLICATE KEY UPDATE.
  Also added tests for bugs #5860 "Multi-table UPDATE does not activate
  update triggers", #6812 "Triggers are not activated for INSERT ... SELECT"
  and #8755 "Trigger is not activated by LOAD DATA".
sql/item.cc:
  Since it turned out that at trigger loading time we can't say in which
  buffer TABLE::record[0] or record[1] old version of row will be stored
  we have to change our approach to binding of Item_trigger_field to
  Field instances.
  Now after trigger parsing (in Item_trigger_field::setup_table()) we only
  find index of proper Field in the TABLE::field array. Then before trigger
  is invoked we set Table_triggers_list::old_field/new_field so they point
  to arrays holding Field instances bound to buffers with proper row
  versions. And as last step in Item_trigger_field::fix_fields() we get
  pointer to Field from those arrays using saved field index.
  
  Item_trigger_field::setup_field()/fix_fields() were changed to implement
  this approach.
sql/item.h:
  Since it turned out that at trigger loading time we can't say in which
  buffer TABLE::record[0] or record[1] old version of row will be stored
  we have to change our approach to binding of Item_trigger_field to
  Field instances.
  Now after trigger parsing (in Item_trigger_field::setup_table()) we only
  find index of proper Field in the TABLE::field array. Then before trigger
  is invoked we set Table_triggers_list::old_field/new_field so they point
  to arrays holding Field instances bound to buffers with proper row
  versions. And as last step in Item_trigger_field::fix_fields() we get
  pointer to Field from those arrays using saved field index.
  
  Item_trigger_field:
  - Added field_idx member to store index of Field object corresponding to
    this Item in TABLE::field array.
  - Added triggers member to be able to access to parent Table_trigger_list
    object from fix_fields() method.
  - setup_field() no longer needs to know for which type of event this
    trigger is, since it does not make decision Field for which buffer
    (record[0] or record[1] is appropriate for this Item_trigger_field)
sql/mysql_priv.h:
  Added fill_record_n_invoke_before_triggers() methods. They are simple
  wrappers around fill_record() which invoke proper before trigger right
  after filling record with values.
sql/sql_base.cc:
  Added fill_record_n_invoke_before_triggers() methods. They are simple
  wrappers around fill_record() which invoke proper before trigger right
  after filling record with values.
sql/sql_delete.cc:
  mysql_delete():
    Now we stop statement execution if one of triggers failed, we also
    don't execute after delete trigger if we failed to delete row from
    the table (We also pass information about which buffer contains old
    version of row to process_triggers()).
  multi_delete::send_data()/do_deletes():
    Now we also invoke triggers in case of multi-delete.
sql/sql_insert.cc:
  mysql_insert():
    Moved invocation of before triggers to fill_record_n_invoke_before_triggers()
    method. After triggers are now executed as part of write_record().
    (as nice side effect now we also stop statement execution if one of
    triggers fail).
  write_record():
    Invoke after insert trigger after performing insert. Also invoke proper
    triggers if insert is converted to update or conflicting row is deleted.
    Cleaned up error handling a bit - no sense to report error via
    handler::print_error if it was not generated by handler method and
    was reported before.
    Also now we will execute after trigger only if we really have written
    row to the table. 
  select_insert::send_data()/store_values():
    We should also execute INSERT triggers for INSERT ... SELECT statement.
sql/sql_load.cc:
  read_fixed_length()/read_sep_field():
    We should execute INSERT triggers when processing LOAD DATA statement.
    Small cleanup in auto-increment related code. Also moved check for
    thd->killed which is used to abort LOAD DATA in case of problems
    in 'traditional' mode to better place..
sql/sql_trigger.cc:
  Since it turned out that at trigger loading time we can't say in which
  buffer TABLE::record[0] or record[1] old version of row will be stored
  we have to change our approach to binding of Item_trigger_field to
  Field instances.
  Now after trigger parsing (in Item_trigger_field::setup_table()) we only
  find index of proper Field in the TABLE::field array. Then before trigger
  is invoked we set Table_triggers_list::old_field/new_field so they point
  to arrays holding Field instances bound to buffers with proper row
  versions. And as last step in Item_trigger_field::fix_fields() we get
  pointer to Field from those arrays using saved field index.
  
  Table_triggers_list methods were changed to implement this approach
  (see also comments for sql_trigger.h).
sql/sql_trigger.h:
  Since it turned out that at trigger loading time we can't say in which
  buffer TABLE::record[0] or record[1] old version of row will be stored
  we have to change our approach to binding of Item_trigger_field to
  Field instances.
  Now after trigger parsing (in Item_trigger_field::setup_table()) we only
  find index of proper Field in the TABLE::field array. Then before trigger
  is invoked we set Table_triggers_list::old_field/new_field so they point
  to arrays holding Field instances bound to buffers with proper row
  versions. And as last step in Item_trigger_field::fix_fields() we get
  pointer to Field from those arrays using saved field index.
  
  Changed Table_triggers_list to implement this new approach:
  - Added record1_field member to store array of Field objects bound
    to TABLE::record[1] buffer (instead of existing old_field member)
  - Added new_field member and changed meaning of old_field member.
    During trigger execution they should point to arrays of Field objects
    bound to buffers holding new and old versions of row respectively.
  - Added 'table' member to be able to get access to TABLE instance
    (for which this trigger list object was created) from process_triggers()
    method.
  - Now process_triggers() method sets old_field and new_field members
    properly before executing triggers body (basing on new 
    old_row_is_record1 parameter value).
  - Renamed prepare_old_row_accessors_method() to prepare_record1_accessors()
  
  Also added has_before_update_triggers() method which allows to check
  whenever any before update triggers exist for table.
sql/sql_update.cc:
  mysql_update():
    Now we invoke before triggers in fill_record_n_invoke_before_triggers()
    method. Also now we abort statement execution when one of triggers fail.
  safe_update_on_fly():
    When we are trying to understand if we can update first table in multi
    update on the fly we should take into account that BEFORE UPDATE
    trigger can change field values.
  multi_update::send_data()/do_updates()
    We should execute proper triggers when doing multi-update
    (in both cases when we do it on the fly and using temporary tables).
2005-05-24 22:19:33 +04:00
unknown
9c79a9d691 Fixed on BUG#6048: Stored procedure causes operating system reboot
Memory leak in locally evalutated expressions during SP execution fixed by
  reusing allocated item slots when possible.
  Note: No test case added, since the test is a stress test that tries to make
  the machine to run out of memory.
  Second attempt, now tested with debug build, valgrind build, max (optimized)
  build, with and without --debug, --vagrind and --ps-protocol.
  Errors in trigger and view test with --debug in debug build where present
  before this patch, and likewise for valgrind warnings for view test in
  valgrind build with --ps-protocol.


sql/item.cc:
  Init rsize in Item (for SP item reusal).
sql/item.h:
  Addes special new operator for reuse of Items, for SP internal use only.
sql/sp_head.cc:
  Reuse items assigned internally in SPs when possible.
sql/sp_rcontext.cc:
  Reuse items assigned internally in SPs when possible.
  Moved the local variable assignment here (from sp_head) to avoid
  duplicated code.
sql/sp_rcontext.h:
  New arg to sp_rcontext::set_item_eval() (and some coding style).
sql/sql_class.cc:
  Adjusted call to new set_item_eval().
2005-05-23 23:43:43 +02:00
unknown
6df4988985 join_outer.test, join_outer.result:
Added test cases for bug #9938.
item.h:
  Fixed bug #9938: missing method not_null_tables for Item_ref.


sql/item.h:
  Fixed bug #9938: missing method not_null_tables for Item_ref.
mysql-test/t/join_outer.test:
  Added test cases for bug #9938.
2005-05-21 08:44:50 -07:00
unknown
38c78b8bb9 Revert fix for Bug #6048: it introduced new problems.
sql/item.cc:
  Revert changes
sql/item.h:
  Revert changes
sql/sp_head.cc:
  Revert changes
sql/sp_rcontext.cc:
  Revert changes
2005-05-18 17:10:48 -07:00
unknown
f79897a57f Merge mysql.com:/usr/local/bk/mysql-5.0
into mysql.com:/home/pem/work/mysql-5.0


sql/item.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
2005-05-18 11:09:30 +02:00
unknown
90a2edd784 Fixed BUG#6048: Stored procedure causes operating system reboot.
Memory leak in locally evalutated expressions during SP execution fixed by
  reusing allocated item slots when possible.
  Note: No test case added, since the test is a stress test that tries to make
  the machine to run out of memory.


sql/item.cc:
  Make it possible to reuse allocated item slots (for use in SP execution).
sql/item.h:
  Make it possible to reuse allocated item slots (for use in SP execution).
sql/sp_head.cc:
  Reuse allocated item slots for expression evalutation during SP execution.
sql/sp_rcontext.cc:
  Updated sp_eval_func_item() call, and prevent item reuse in reused frames (for handlers).
2005-05-18 11:07:57 +02:00
unknown
9c71571f83 Merge with 4.1 to get fix for memory leak
client/mysql.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_base.cc:
  merge
2005-05-16 20:21:38 +03:00
unknown
4b2020c575 Some improvement in Item_int_with_ref class comment. 2005-05-16 14:06:52 +00:00
unknown
14920f416b Merge book.sanja.is.com.ua:/Users/bell/mysql/bk/mysql-5.0
into book.sanja.is.com.ua:/Users/bell/mysql/bk/work-bug-5.0


sql/item.h:
  Auto merged
2005-05-09 15:34:41 +03:00
unknown
d406a64780 Merge neptunus.(none):/home/msvensson/mysql/bug10241
into neptunus.(none):/home/msvensson/mysql/mysql-5.0


include/my_global.h:
  Auto merged
sql/field.h:
  Auto merged
sql/ha_berkeley.h:
  Auto merged
sql/ha_heap.h:
  Auto merged
sql/ha_innodb.h:
  Auto merged
sql/ha_myisam.h:
  Auto merged
sql/ha_myisammrg.h:
  Auto merged
sql/ha_ndbcluster.h:
  Auto merged
sql/handler.h:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_geofunc.h:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/item_sum.h:
  Auto merged
BitKeeper/deleted/.del-ha_isam.h~bf53d533be3d3927:
  Auto merged
BitKeeper/deleted/.del-ha_isammrg.h~66fd2e5bfe7207dc:
  Auto merged
sql/examples/ha_archive.h:
  Auto merged
sql/item_timefunc.h:
  Auto merged
sql/opt_range.h:
  Auto merged
sql/procedure.h:
  Auto merged
sql/protocol.h:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_list.h:
  Auto merged
sql/sql_select.h:
  Auto merged
sql/sql_string.h:
  Auto merged
sql/sql_udf.h:
  Auto merged
sql/tztime.h:
  Auto merged
2005-05-09 11:26:48 +02:00
unknown
e99c4c6cf2 Merge neptunus.(none):/home/msvensson/mysql/bug10241
into neptunus.(none):/home/msvensson/mysql/mysql-4.1


include/my_global.h:
  Auto merged
sql/item.h:
  Auto merged
2005-05-09 11:23:12 +02:00
unknown
a6b1546676 Item::fix_field need correct pointer on item reference to chnge it if itis need, so support of correct item address added to SP commands (BUG#5963)
some optimisation of IF/NOT IF ptomised to Pem


mysql-test/r/sp.result:
  test for bug#5963
mysql-test/t/sp.test:
  test for bug#5963
sql/item.cc:
  new method which return reference on Item for SP variables support
sql/item.h:
  comment fixed
  method added
sql/sp_head.cc:
  preparation of item made separate function
  we do not need new constant Item to check IF/IF NOT
  support of passing correct address of item for fix_fields method
sql/sp_rcontext.cc:
  support of Item address passing to fix_fields
sql/sp_rcontext.h:
  support of correct address passing to fix_fields
sql/sql_class.cc:
  support of correct item address passing to fix_field
2005-05-09 01:59:10 +03:00
unknown
54d57ffd2f Merge
BitKeeper/etc/logging_ok:
  auto-union
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/item.h:
  SCCS merged
2005-05-05 20:10:50 +05:00
unknown
6de14a23f7 A lot of fixes to Precision math
Mostly about precision/decimals of the results of the operations


include/decimal.h:
  decimal interface changed a little
sql/field.cc:
  a lot of precision/decimals related changes to the Field_new_decimal
sql/field.h:
  Field_new_decimal interface changed
sql/ha_ndbcluster.cc:
  f->precision should be used here
sql/item.cc:
  precision/decimals counting related changes
sql/item.h:
  precision/decimals counting related changes
sql/item_cmpfunc.cc:
  precision/decimals counting related changes
sql/item_cmpfunc.h:
  precision/decimals counting related changes
sql/item_func.cc:
  precision/decimals counting related changes
sql/item_func.h:
  precision/decimals counting related changes
sql/item_sum.cc:
  precision/decimals counting related changes
sql/item_sum.h:
  precision/decimals counting related changes
sql/my_decimal.cc:
  precision/decimals counting related changes
sql/my_decimal.h:
  precision/decimals counting related changes
sql/mysqld.cc:
  precision/decimals counting related changes
sql/set_var.cc:
  precision/decimals counting related changes
sql/sp_head.cc:
  dbug_decimal_print was replaced with dbug_decimal_as_string
sql/sql_class.h:
  div_precincrement variable added
sql/sql_parse.cc:
  precision/decimals counting related changes
sql/sql_select.cc:
  precision/decimals counting related changes
sql/sql_show.cc:
  Field::representation_length was removed
strings/decimal.c:
  decimal_actual_fraction was introduced
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
2005-05-05 20:06:49 +05:00
unknown
7f33809731 Manual merge
BitKeeper/etc/logging_ok:
  auto-union
configure.in:
  Auto merged
include/my_sys.h:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/t/ndb_restore.test:
  Auto merged
ndb/test/src/NDBT_ResultRow.cpp:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
2005-05-05 13:47:09 +04:00
unknown
c758512a91 A fix and test case for Bug#9777 " Empty set returned by Prepared Statement when it
should return a non empty one"
(see comments for the changed files for details).


mysql-test/r/ps.result:
  A test case for Bug#9777: tests results fixed.
mysql-test/t/ps.test:
  A test case for Bug#9777
sql/item.cc:
  A fix for Bug#9777: when creating a constant item from within 
  Item_int_with_ref::new_item, create the item by value, not by name.
  This should work with prepared statements placeholders.
  Item_int_with_ref is a special optimization case used
   when we compare datetime constants with datetime value.
  Converting the item to integer early is OK as it is in line
  with the purpose of Item_int_with_ref - to speed up comparison by 
  using integers.
  Minor cleanups.
sql/item.h:
  Declaration for Item_int_with_ref::new_item
2005-05-05 12:55:09 +04:00
unknown
9ab5f6143e BUG#10241 cygwin port: invalid pragma interface directives
- Introduce ifdefs so we can control when to use #pragma interface on cygwin


include/my_global.h:
  Turn on use of #pragma implementation and #pragma interface if compiled with GCC and platform != Cygwin
include/raid.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/examples/ha_archive.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/examples/ha_example.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/field.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_berkeley.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_blackhole.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_heap.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_innodb.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_isam.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_isammrg.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_myisam.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_myisammrg.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_ndbcluster.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/handler.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_cmpfunc.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_func.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_geofunc.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_strfunc.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_subselect.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_sum.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_timefunc.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/opt_range.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/procedure.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/protocol.h:
  replace __GNUC__ with USE_PRAGMA_IMPLEMENTATION
sql/set_var.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/sql_class.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/sql_list.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/sql_select.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/sql_string.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/sql_udf.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/tztime.h:
  replace __GNUC__ with USE_PRAGMA_INTERFACE
2005-05-04 15:05:56 +02:00
unknown
3c223a34cf Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/opt/local/work/mysql-5.0-root


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
2005-05-04 16:54:36 +04:00
unknown
a82865375e Post-merge fixes for Bug#9096 "select doesn't return all matched
records if prepared statements is used" (see comments to 
the changed files).


mysql-test/r/ps.result:
  Post-merge fix for Bug#9096: test results fixed.
mysql-test/r/type_datetime.result:
  Post-merge fix for Bug#9096: now we do better constants comparison,
  so the optimizer is able to guess from the index that we don't
  need to evaluate WHERE clause.
sql/item.cc:
  Post-merge fixes for Bug#9096: implement by-value comparison for
  new 5.0 DECIMAL type.
  Item_real is renamed to Item_float in 5.0
  Item_varbinary is renamed to Item_hex_string in 5.0
sql/item.h:
  Post-merge fixes for Bug#9096: declaration for Item_decimal::eq
2005-05-04 16:53:10 +04:00
unknown
3aa89efcdd Manual merge of Bug#9096 2005-05-03 19:32:29 +04:00
unknown
b883aebae0 Merge mysql.com:/opt/local/work/mysql-4.1-root
into mysql.com:/opt/local/work/mysql-4.1-9096-fresh


sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
2005-05-03 12:49:22 +04:00
unknown
9fcda7fcc5 A fix and test case for Bug#9096 "select doesn't return all matched
records if prepared statements is used".
This fix changes equality evaluation method of basic constants from
by-name to by-value, thus effectively enabling use of parameter markers
in some optimizations (constants propagation, evaluation of possible
keys for query).


mysql-test/r/ps.result:
  Test results for the test case for Bug#9096
mysql-test/t/ps.test:
  A short test case for Bug#9096 "select doesn't return all matched records if
   prepared statements is used". The is enough to reproduce the
  glitch in update_ref_and_keys causing the bug to occur.
sql/item.cc:
  Implement by-value equality evaluation of basic constants.
  This is needed to work with Item_param values. Until now
  Item_param was compared with other items by its name, which is always "?".
  The bug at hand showed up when an integer
  constant was created from one parameter marker (with value 200887 and
   name "?") and then compared by-name with another parameter marker
  (with value 860 and name "?"). True returned by this comparison resulted
  in a wrong table access method used to evaluate the query.
  Implement Item_param methods needed to emulate "basic constant" mode at 
  full.
sql/item.h:
  Change declaration of basic_const_item(): now it also widens its 
  argument from const Item * to Item * if the argument is a basic constant.
  Declare eq() for all basic constatns, as long as now they 
  are compared by value, not by name. Each constant needs its own
  comparison method.
  Declarations of Item_param methods needed to fully emulate 
  a basic constant when parameter value is set.
sql/item_func.cc:
  Fix wrong casts.
2005-05-03 12:47:27 +04:00
unknown
371b26e11c Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-test-5.0


sql/item.h:
  Auto merged
2005-04-30 19:32:45 +03:00
unknown
d45f95f04a postreview changes
sql/item.cc:
  changed parameters order
sql/item.h:
  changed parameters order
sql/sql_base.cc:
  fixed comment
  changed parameters order
2005-04-30 19:27:22 +03:00
unknown
a6acc4462c Merge with 4.1
BitKeeper/etc/logging_ok:
  auto-union
configure.in:
  Auto merged
include/config-win.h:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/r/drop.result:
  Auto merged
mysys/default.c:
  Auto merged
mysys/mf_keycache.c:
  Auto merged
sql/field.h:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~f96b7055cac394e:
  Auto merged
mysql-test/r/cast.result:
  Merge
mysql-test/t/cast.test:
  Merge
sql/sql_insert.cc:
  Merge
sql/sql_select.cc:
  Merge
2005-04-30 09:46:08 +03:00
unknown
97b0821462 CAST(string_argument AS UNSIGNED) didn't work for big integers above the signed range. (Bug #7036)
Produce warnings of wrong cast of strings to signed/unsigned.
Don't block not resolved IP's if DNS server is down (Bug #8467)
Fix compiler problems with MinGW (Bug #8872)


configure.in:
  Fix compiler problems with MinGW (Bug #8872)
include/config-win.h:
  Fix compiler problems with MinGW (Bug #8872)
include/my_global.h:
  Fix compiler problems with MinGW (Bug #8872)
mysql-test/r/cast.result:
  Test for cast to signed/unsigned outside of range (Bug #7036)
mysql-test/t/cast.test:
  Test for cast to signed/unsigned outside of range (Bug #7036)
mysys/default.c:
  Cleanup (combine identical code). 
  Done mainly by Jani
sql/field.h:
  Added cast_to_int_type() to ensure that enums are casted as numbers
sql/hostname.cc:
  Don't block not resolved IP's if DNS server is down (Bug #8467)
sql/item.h:
  Added cast_to_int_type() to ensure that enums are casted as numbers
sql/item_func.cc:
  CAST(string_argument AS UNSIGNED) didn't work for big integers above the
  signed range. (Bug #7036)
  Produce warnings of wrong cast of strings to signed/unsigned
sql/item_func.h:
  CAST(string_argument AS UNSIGNED) didn't work for big integers above the
  signed range. (Bug #7036)
2005-04-29 17:03:34 +03:00
unknown
ca119d390e if outer refernce (identifier) was resolved with help of cache all subqueries and resolved item itseld have to be correctly marked as dependent
(BUG#10041)


sql/item.cc:
  depended_from shoudl be cleaned
  layout fixed
  function to mark range of SELECTs as dependent (used if item was resolved with PS cache of resolving identifiers)
sql/item.h:
  function to mark range of SELECTs as dependent (used if item was resolved with PS cache of resolving identifiers)
sql/item_subselect.h:
  function to mark range of SELECTs as dependent (used if item was resolved with PS cache of resolving identifiers)
sql/sql_base.cc:
  if outer refernce (identifier) was resolved with help of cache all subqueries and resolved item itseld have to be correctly marked as dependent
2005-04-29 02:43:56 +03:00
unknown
e77860b7be Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0


sql/item.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
2005-04-15 22:35:29 -07:00
unknown
2b92a78eb8 subselect.result, subselect.test:
Added a test case for bug #9338.
sql_select.cc:
  Fixed bug #9338.
  When an occurence of a field reference has to be replaced
  by another field reference the whole Item_field must be
  replaced.
item.cc:
  Fixed bug #9338.
  The method Item_field::replace_equal_field_processor was
  replaced by Item_field::replace_equal_field. The new method
  is used to replace the occurences of Item_field objects.
item.h:
  Fixed bug #9338.
  The virtual function replace_equal_field_processor was replaced
  by replace_equal_field. The latter is supposed to be used as a
  callback function in calls of the method transform.


sql/item.h:
  Fixed bug #9338.
  The virtual function replace_equal_field_processor was replaced
  by replace_equal_field. The latter is supposed to be used as a
  callback function in calls of the method transform.
sql/item.cc:
  The method Item_field::replace_equal_field_processor was
  replaced by Item_field::replace_equal_field The new method
  is used to replace the occurences of Item_field objects.
sql/sql_select.cc:
  Fixed bug #9338.
  When an occurence of a field reference has to be replaced
  by another field reference the whole Item_field must be
  replaced.
mysql-test/t/subselect.test:
  Added a test case for bug #9338.
mysql-test/r/subselect.result:
  Added a test case for bug #9338.
2005-04-15 20:43:45 -07:00
unknown
e0fdbeba7e Fixed BUG#9598: stored procedure call within stored procedure
overwrites IN variable
  and added error checking of variables for [IN]OUT parameters while
  rewriting the out parameter handling.


mysql-test/r/sp-error.result:
  New test case for non-variable argument for [IN]OUT parameters.
  (And changed to qualified names in some other error messages.)
mysql-test/r/sp.result:
  New test case for BUG#9598.
mysql-test/t/sp-error.test:
  New test case for non-variable argument for [IN]OUT parameters.
mysql-test/t/sp.test:
  New test case for BUG#9598.
sql/item.h:
  Need to distinguish between SP local variable items and other items,
  for error checking and [IN]OUT parameter handling.
sql/share/errmsg.txt:
  New error message for non-variable arguments for [IN]OUT parameters in stored procedures.
sql/sp_head.cc:
  Rewrote the [IN]OUT parameter handling in procedure invokation, to make
  it work properly when using user variables in sub-calls.
  Also added error checking for non-variable arguments for such parameters
  (and changed to qualified names for wrong number of arg. errors).
sql/sp_rcontext.cc:
  No need to keep track on the out index for an [IN]OUT parameter any more.
sql/sp_rcontext.h:
  No need to keep track on the out index for an [IN]OUT parameter any more.
2005-04-14 14:52:35 +02:00
unknown
5cdec5d6ba Merge
mysql-test/r/create.result:
  Auto merged
mysql-test/r/ctype_latin1_de.result:
  Auto merged
mysql-test/r/grant.result:
  Auto merged
mysql-test/r/grant2.result:
  Auto merged
mysql-test/r/limit.result:
  Auto merged
mysql-test/r/order_by.result:
  Auto merged
mysql-test/r/rpl000001.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
mysql-test/r/strict.result:
  Auto merged
mysql-test/r/type_blob.result:
  Auto merged
mysql-test/r/type_ranges.result:
  Auto merged
mysql-test/r/warnings.result:
  Auto merged
mysql-test/t/ctype_latin1_de.test:
  Auto merged
mysql-test/t/limit.test:
  Auto merged
mysql-test/t/order_by.test:
  Auto merged
mysql-test/t/show_check.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
mysql-test/t/type_blob.test:
  Auto merged
mysql-test/t/type_ranges.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
mysql-test/t/strict.test:
  SCCS merged
2005-04-05 19:45:34 -07:00
unknown
0c9304fd6d Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0


mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2005-04-01 15:06:35 +03:00
unknown
db7561ecf8 Invalid DEFAULT values for CREATE TABLE now generates errors. (Bug #5902)
CAST() now produces warnings when casting a wrong INTEGER or CHAR values. This also applies to implicite string to number casts. (Bug #5912)
ALTER TABLE now fails in STRICT mode if it generates warnings.
Inserting a zero date in a DATE, DATETIME or TIMESTAMP column during TRADITIONAL mode now produces an error. (Bug #5933)


mysql-test/r/bigint.result:
  New warning added
mysql-test/r/cast.result:
  Added testing of wrong CAST's of strings to numbers and numbers to strings
mysql-test/r/create.result:
  Added test for wrong default values (#5902)
mysql-test/r/func_if.result:
  Changed tests to produce less warnings
mysql-test/r/func_misc.result:
  New warning
mysql-test/r/func_str.result:
  Added missing drop table
  Changed test to produce less warnings
  New warnings
mysql-test/r/ndb_index_unique.result:
  Removed wrong default usage
mysql-test/r/ps_1general.result:
  Changed tests to produce less warnings
mysql-test/r/row.result:
  New warnings
mysql-test/r/rpl_session_var.result:
  Changed tests to produce less warnings
mysql-test/r/strict.result:
  New tests for CAST() and zero date handling
mysql-test/r/subselect.result:
  Changed tests to produce less warnings
mysql-test/r/type_ranges.result:
  Changed tests to produce less warnings
mysql-test/t/cast.test:
  Added testing of wrong CAST's of strings to numbers and numbers to strings
mysql-test/t/create.test:
  Added test for wrong default values (#5902)
mysql-test/t/func_if.test:
  Changed tests to produce less warnings
mysql-test/t/func_str.test:
  Added missing drop table
  Changed test to produce less warnings
  New warnings
mysql-test/t/ndb_index_unique.test:
  Removed wrong default usage
mysql-test/t/ps_1general.test:
  Changed tests to produce less warnings
mysql-test/t/rpl_session_var.test:
  Changed tests to produce less warnings
mysql-test/t/strict.test:
  New tests for CAST() and zero date handling
mysql-test/t/subselect.test:
  Changed tests to produce less warnings
mysql-test/t/type_ranges.test:
  Changed tests to produce less warnings
sql/Makefile.am:
  Added new include file
sql/field.cc:
  Added warnings for zero dates for DATE, DATETIME and TIMESTAMP
  Moved Field_blob::max_length() to a more appropriate position
  Changed type for 'level' in set_warning() to avoid casts
sql/field.h:
  Changed type for 'level' in set_warning() to avoid casts
sql/field_conv.cc:
  Copy date and datetime fields through string in 'traditional' mode to detect zero dates
sql/item.cc:
  Removed compiler warnings
  Give warnings for wrong CAST of strings -> number
sql/item.h:
  Moved Item_string::val_real() and ::val_int() to item.cc
sql/item_row.cc:
  Better detection of null values (which doesn't produce warnings)
sql/item_sum.cc:
  Better detection of null values (which doesn't produce warnings)
sql/item_timefunc.cc:
  Give warnings for wrong CAST of number -> string
sql/my_decimal.cc:
  Fixed typo in comment
sql/mysql_priv.h:
  Removed prototype for static function
  Moved defines for error handling to sql_error.h (to be able to use these in field.h)
sql/mysqld.cc:
  Simplify code
sql/sql_class.h:
  Moved to sql_error.h
sql/sql_load.cc:
  Removed wrong cast
sql/sql_parse.cc:
  Fixed wrong printf()
sql/sql_table.cc:
  Made mysql_prepare_table() static
  Changed references to pointers to make code more readable
  ALTER TABLE now aborts if one gets warnings in STRICT mode
sql/time.cc:
  Fixed possible wrong call
sql/unireg.cc:
  Removed one call to current_thd
  Give errors if one uses a wrong DEFAULT value
2005-04-01 15:04:50 +03:00
unknown
5b0c75259c Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-union_merge-5.0


sql/field.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2005-04-01 02:15:40 +03:00
unknown
c831a156ce postmerge 4.1->5.0 fixes
mysql-test/r/group_by.result:
  result change
mysql-test/r/union.result:
  result change
mysql-test/r/view.result:
  result change
mysql-test/t/subselect.test:
  fixed mistake of merge
sql/field.cc:
  new 5.0 types support
  temporary table/db names detection in field fixed
sql/field.h:
  removed non-existent methods
  added wrongly deleted during manual merge string
sql/item.cc:
  support of new types added to merge of union types routines
sql/item.h:
  fixed method definition
sql/item_cmpfunc.cc:
  fixed type
sql/item_func.h:
  item type name fixed
sql/item_subselect.cc:
  added forgoten methods
sql/item_subselect.h:
  fixed type
sql/sql_derived.cc:
  fixed typo of manual merge
sql/sql_view.cc:
  added new parameter
2005-04-01 02:14:30 +03:00
unknown
6ae390fd5d Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into neptunus.(none):/home/msvensson/mysql/mysql-4.1


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_subselect.h:
  Auto merged
2005-03-31 10:47:32 +02:00
unknown
8a898a0b72 merge 4.1->5.0
mysql-test/r/group_by.result:
  Auto merged
mysql-test/r/metadata.result:
  Auto merged
mysql-test/r/union.result:
  Auto merged
mysql-test/t/union.test:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
support-files/mysql.server.sh:
  Auto merged
2005-03-31 10:39:48 +03:00
unknown
f17bba4e2d Merge
mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/ps_6bdb.result:
  Auto merged
mysql-test/r/ps_7ndb.result:
  Auto merged
sql/item.h:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/item.cc:
  SCCS merged
2005-03-30 14:32:53 +02:00
unknown
af2ab040cc BUG#8807 Select crash server
- Add function Item_param::fix_fields which will update any subselect they are part of and indicate that the subsleect is not const during prepare phase, and thus should not be executed during prepare.


mysql-test/include/ps_query.inc:
  Adde new test case
mysql-test/r/ps_2myisam.result:
  Update test result
mysql-test/r/ps_3innodb.result:
  Update test result
mysql-test/r/ps_4heap.result:
  Update test result
mysql-test/r/ps_5merge.result:
  Update test result
mysql-test/r/ps_6bdb.result:
  Update test result
mysql-test/r/ps_7ndb.result:
  Update test result
sql/item.cc:
  Add function Item_param::fix_fields, which will mark any subselects they are part of as not being a constant expression unless the param value is specified, ie. it will be not be constant during prepare phase.
sql/item.h:
  Adde Item_param::fix_fields
sql/item_subselect.h:
  Make Item_param::fix_field friend of Item_subselect
2005-03-30 12:14:37 +02:00