Commit graph

415 commits

Author SHA1 Message Date
Gleb Shchepa
8155de51e5 manual merge 5.0-bugteam --> 5.1-bugteam (bug 40021)
sql_view.cc: required_view_parameters has been decreased by 2 
(not by 1) because its value was incorrect: 16 instead of 15
(minor performance issue).


sql/sql_view.cc:
  sql_view.cc: required_view_parameters has been decreased by 2 
  (not by 1) because its value was incorrect: 16 instead of 15
  (minor performance issue).
2008-11-14 21:37:27 +04:00
Gleb Shchepa
56b9586fd1 Bug #40021: Renaming view fails, archived .frm for view is
missing after downgrade

Obsolete arc/ directory and view .frm file backup support
has been removed by the patch for bug 17823. However, that
bugfix caused a problem with "live downgrades" of the
server: if we rename some view 4 times under 5.1.29/5.0.72
and then try to rename it under 5.1.28/5.0.70 on the same
database, the server fails with a error:

  query 'RENAME TABLE ... TO ...' failed: 6: Error on
  delete of '....frm-0001' (Errcode: 2)

Also .frm file of that view may be lost (renamed to .frm~).

The server failed because it tried to rename latest 3
backup .frm files renaming the view: the server used an
integer value of the "revision" field of .frm file to
extract those file names. After the fix for bug 17823 those
files were not created/maintained any more, however the
"revision" field was incremented as usual. So, the server
failed renaming non existent files.

This fix solves the problem by removing the support for
"revision" .frm file field:
1. New server silently ignores existent "revision" fields
   in old .frm files and never write it down;
2. Old server assumes, that missing "revision" field in new
   .frm files means default value of 0.
3. Accordingly to the fix for bug 17823 the new server
   drops arc/ directory on alter/rename view, so after
   "live downgrade" old server begins maintenance of the
   arc/ directory from scratch without conflicts with .frm
   files.


sql/parse_file.cc:
  Bug #40021: Renaming view fails, archived .frm for view is
              missing after downgrade
  
  1. static write_parameter(): the old_version parameter
     and the section for FILE_OPTIONS_REV have been re moved.
  2. write_parameter(): the max_versions parameter has been
     removed;
  3. sql_create_definition_file(): removal of dead code;
  4. rename_in_schema_file(): revision and num_view_backups
     parameters and dead code have been removed;
  5. File_parser::parse(): FILE_OPTIONS_REV section has been
     removed.
sql/parse_file.h:
  Bug #40021: Renaming view fails, archived .frm for view is
              missing after downgrade
  
  1. The FILE_OPTIONS_REV constant has been removed.
  2. sql_create_definition_file and rename_in_schema_file
     functions: obsolete versions, revision and
     num_view_backups parameters have been removed.
sql/sql_db.cc:
  Bug #40021: Renaming view fails, archived .frm for view is
              missing after downgrade
  
  Commentary update.
sql/sql_trigger.cc:
  Bug #40021: Renaming view fails, archived .frm for view is
              missing after downgrade
  
  sql_create_definition_file() calls have been updates to
  new parameter lists.
sql/sql_view.cc:
  Bug #40021: Renaming view fails, archived .frm for view is
              missing after downgrade
  
  1. The mysql_create_view function code is used for both
     CREATE VIEW and ALTER queries, but query cache is
     necessary for ALTER command only. Check for a non first
     view revision has been replaced with a direct check for
     ALTER query.
  2. The num_view_backups global constant has been removed.
  3. view_parameters: the "revision" .frm field support has
     been removed.
  4. sql_create_definition_file and rename_in_schema_file
     function calls have been updates to new parameter lists.
sql/table.h:
  Bug #40021: Renaming view fails, archived .frm for view is
              missing after downgrade
  
  TABLE_LIST: the revision field has been removed.
2008-11-14 21:25:57 +04:00
Gleb Shchepa
39996b44cc manual merge 5.0-5.1.29-rc --> 5.1-5.1.29-rc 2008-10-08 02:52:49 +05:00
Gleb Shchepa
f48b42e776 Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
``FLUSH TABLES WITH READ LOCK''

Concurrent execution of 1) multitable update with a
NATURAL/USING join and 2) a such query as "FLUSH TABLES
WITH READ LOCK" or "ALTER TABLE" of updating table led
to a server crash.


The mysql_multi_update_prepare() function call is optimized
to lock updating tables only, so it postpones locking to
the last, and if locking fails, it does cleanup of modified
syntax structures and repeats a query analysis.  However,
that cleanup procedure was incomplete for NATURAL/USING join
syntax data: 1) some Field_item items pointed into freed
table structures, and 2) the TABLE_LIST::join_columns fields
was not reset.

Major change:
  short-living Field *Natural_join_column::table_field has
  been replaced with long-living Item*.


mysql-test/r/lock_multi.result:
  Added test case for bug #38691.
mysql-test/t/lock_multi.test:
  Added test case for bug #38691.
sql/item.cc:
  Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
            ``FLUSH TABLES WITH READ LOCK''
  
  The Item_field constructor has been modified to allocate
  and copy original database/table/field names always (not
  during PS preparation/1st execution only), because
  an initialization of Item_field items with a pointer to
  short-living Field structures is a common practice.
sql/sql_base.cc:
  Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
            ``FLUSH TABLES WITH READ LOCK''
  
  1) Type adjustment for Natural_join_column::table_field
     (Field to Item_field);
  2) The setup_natural_join_row_types function has been
     updated to take into account new
     first_natural_join_processing flag to skip unnecessary
     reinitialization of Natural_join_column::join_columns
     during table reopening after lock_tables() failure
     (like the 'first_execution' flag for PS).
sql/sql_lex.cc:
  Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
            ``FLUSH TABLES WITH READ LOCK''
  
  Initialization of the new
  st_select_lex::first_natural_join_processing flag has
  been added.
sql/sql_lex.h:
  Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
            ``FLUSH TABLES WITH READ LOCK''
  
  The st_select_lex::first_natural_join_processing flag
  has been added to skip unnecessary rebuilding of
  NATURAL/USING JOIN structures during table reopening
  after lock_tables failure.
sql/sql_update.cc:
  Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
            ``FLUSH TABLES WITH READ LOCK''
  
  Extra cleanup calls have been added to reset
  Natural_join_column::table_field items.
sql/table.cc:
  Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
            ``FLUSH TABLES WITH READ LOCK''
  
  Type adjustment for Natural_join_column::table_field
  (Field to Item_field).
sql/table.h:
  Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
            ``FLUSH TABLES WITH READ LOCK''
  
  Type of the Natural_join_column::table_field field has
  been changed from Field that points into short-living
  TABLE memory to long-living Item_field that can be
  linked to (fixed) reopened table.
2008-10-08 02:34:00 +05:00
Mattias Jonsson
22e0319620 merge 2008-10-01 12:14:55 +02:00
Mattias Jonsson
be63f0af4f Bug#38804: Query deadlock causes all tables to be inaccessible.
Problem was a mutex added in bug n 27405 for solving a problem
with auto_increment in partitioned innodb tables.
(in ha_partition::write_row over partitions file->ha_write_row)

Solution is to use the patch for bug#33479, which refines the
usage of mutexes for auto_increment.

Backport of bug-33479 from 6.0:

Bug-33479: auto_increment failures in partitioning

Several problems with auto_increment in partitioning
(with MyISAM, InnoDB. Locking issues, not handling
multi-row INSERTs properly etc.)

Changed the auto_increment handling for partitioning:
Added a ha_data variable in table_share for storage engine specific data
such as auto_increment value handling in partitioning, also see WL 4305
and using the ha_data->mutex to lock around read + update.

The idea is this:
Store the table's reserved auto_increment value in
the TABLE_SHARE and use a mutex to, lock it for reading and updating it
and unlocking it, in one block. Only accessing all partitions
when it is not initialized.
Also allow reservations of ranges, and if no one has done a reservation
afterwards, lower the reservation to what was actually used after
the statement is done (via release_auto_increment from WL 3146).
The lock is kept from the first reservation if it is statement based
replication and a multi-row INSERT statement where the number of
candidate rows to insert is not known in advance (like INSERT SELECT,
LOAD DATA, unlike INSERT VALUES (row1), (row2),,(rowN)).

This should also lead to better concurrancy (no need to have a mutex
protection around write_row in all cases)
and work with any local storage engine.

mysql-test/suite/parts/inc/partition_auto_increment.inc:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  Test source file for testing auto_increment
mysql-test/suite/parts/r/partition_auto_increment_archive.result:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  result file for testing auto_increment
mysql-test/suite/parts/r/partition_auto_increment_blackhole.result:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  result file for testing auto_increment
mysql-test/suite/parts/r/partition_auto_increment_innodb.result:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  result file for testing auto_increment
mysql-test/suite/parts/r/partition_auto_increment_memory.result:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  result file for testing auto_increment
mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  result file for testing auto_increment
mysql-test/suite/parts/r/partition_auto_increment_ndb.result:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  result file for testing auto_increment
mysql-test/suite/parts/t/partition_auto_increment_archive.test:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  test file for testing auto_increment
mysql-test/suite/parts/t/partition_auto_increment_blackhole.test:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  test file for testing auto_increment
mysql-test/suite/parts/t/partition_auto_increment_innodb.test:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  test file for testing auto_increment
mysql-test/suite/parts/t/partition_auto_increment_memory.test:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  test file for testing auto_increment
mysql-test/suite/parts/t/partition_auto_increment_myisam.test:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  test file for testing auto_increment
mysql-test/suite/parts/t/partition_auto_increment_ndb.test:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  test file for testing auto_increment
sql/ha_partition.cc:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: Failures using auto_increment and partitioning
  
  Changed ha_partition::get_auto_increment from file->get_auto_increment
  to file->info(HA_AUTO_STATUS), since it is works better with InnoDB
  (InnoDB can have issues with partitioning and auto_increment,
  where get_auto_increment sometimes can return a non updated value.)
  
  Using the new table_share->ha_data for keeping the auto_increment
  value, shared by all instances of the same table.
  It is read+updated when holding a auto_increment specific mutex.
  Also added release_auto_increment to decrease gaps if possible.
  And a lock for multi-row INSERT statements where the number of candidate
  rows to insert is not known in advance (like INSERT SELECT, LOAD DATA;
  Unlike INSERT INTO (row1),(row2),,(rowN)).
  Fixed a small bug, copied++ to (*copied)++ and the same for deleted.
  Changed from current_thd, to ha_thd()
sql/ha_partition.h:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: Failures using auto_increment and partitioning
  
  Added a new struct HA_DATA_PARTITION to be used in table_share->ha_data
  Added a private function to set auto_increment values if needed
  Removed the restore_auto_increment (the hander version is better)
  Added lock/unlock functions for auto_increment handling.
  Changed copied/deleted to const.
sql/handler.h:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: auto_increment failures in partitioning
  
  Added const for changed_partitions
  Added comments about SQLCOM_TRUNCATE for delete_all_rows
sql/table.h:
  Bug#38804: Query deadlock causes all tables to be inaccessible.
  Backporting from 6.0 of:
  Bug-33479: Failures using auto_increment and partitioning
  
  Added a variable in table_share: ha_data for storage of storage engine
  specific data (such as auto_increment handling in partitioning).
2008-09-08 15:30:01 +02:00
Martin Hansson
3bad2119f9 Bug#36086: SELECT * from views don't check column grants
This patch also fixes bugs 36963 and 35600.
                      
- In many places a view was confused with an anonymous derived
  table, i.e. access checking was skipped. Fixed by introducing a
  predicate to tell the difference between named and anonymous
  derived tables.
                      
- When inserting fields for "SELECT * ", there was no 
  distinction between base tables and views, where one should be
  made. View privileges are checked elsewhere.

mysql-test/include/grant_cache.inc:
  Bug#36086: Changed test case.
mysql-test/r/grant2.result:
  Bug#36086: Changed test result.
mysql-test/r/grant_cache_no_prot.result:
  Bug#36086: Changed test result.
mysql-test/r/grant_cache_ps_prot.result:
  Bug#36086: Changed test result.
mysql-test/r/view_grant.result:
  Bug#36086: Test result.
mysql-test/t/grant2.test:
  Bug#36086: Changed test case.
mysql-test/t/view_grant.test:
  Bug#36086: Test case.
sql/item.cc:
  Bug#36086: Replaced conditional with new methods.
sql/sql_acl.cc:
  Bug no 35600: 
  In mysql_table_grant:
    Replaced conditional with the new accessor method.
  
  In check_grant:
   - Changed the requirement table->derived != null to 
     checking all anonymous derived tables.
   - Use of the accessor methods for getting object and database 
     names.
      
  Bug#36086: In check_grant_all_columns:
    - Updated comment. This function is now called for views
      as well.
    - The error message should not disclose any column names 
      unless the user has privilege to see all column names.
    - Changed names of Field_iterator_table_ref methods.
sql/sql_base.cc:
  Bug no 36963: In insert_fields()
    - Commented.
    - We should call check_grant_all_columns() for views in  
      this case.        
    - Changed names of Field_iterator_table_ref methods.
    - We should not disclose column names in the error message
      when the user has no approprate privilege.
sql/sql_cache.cc:
  Bug#36086: Replaced test with new predicate method.
sql/sql_derived.cc:
  Bug#36086: commenting only. Updated and doxygenated
  comment for mysql_derived_prepare().
sql/sql_parse.cc:
  Bug no 35600: 
  - In check_single_table_access:
    Due to the bug, check_grant would raise an error for a
    SHOW CREATE TABLE command for a TEMPTABLE view. It should in
    fact not be be invoked in this case. This table privilege
    is checked already.
    There is a test case for this in information_schema_db.test.
      
  - In check_access: replaced table->derived
sql/table.cc:
  Bug#36086: 
  
  - In TABLE_LIST::set_underlying_merge(): 
    Commenting only. Doxygenated, corrected spelling,
    added.
  
  - Renamed table_name() and db_name() methods of 
    Field_iterator_table_ref in order to be consistent
    with new methods in TABLE_LIST.
sql/table.h:
  Bug#36086: 
    - Commented GRANT_INFO.
    - Added a predicate is_anonymous_derived_table() to    
      TABLE_LIST.
    - Added get_table_name() and get_db_name() to   
      TABLE_LIST in order to hide the disparate   
      representation of these properties.
2008-09-03 16:45:40 +02:00
Kristofer Pettersson
548413824b Bug#38002 table_cache consumes too much memory with blobs
Tables in the table definition cache are keeping a cache buffer for blob
fields which can consume a lot of memory.
    
This patch introduces a maximum size threshold for these buffers.


sql/sql_base.cc:
  Added function free_field_buffers_larger_than to reclaim memory from blob
  field buffers too large to be cached.
sql/table.cc:
  Added function free_field_buffers_larger_than
2008-07-24 22:38:44 +02:00
unknown
37b2c32d95 Bug#27430 "Crash in subquery code when in PS and table DDL changed after
PREPARE": rename members, methods, classes to follow the spec 
(a code review request)


sql/mysql_priv.h:
  enum_metadata_type -> enum_table_ref_type
sql/sp_head.cc:
  Metadata_version_observer -> Reprepare_observer
sql/sql_base.cc:
  metadata -> table_ref
sql/sql_class.cc:
  Replace an abstract interface with a concrete implementation.
sql/sql_class.h:
  enum_metadata_type -> enum_table_ref_type
sql/sql_prepare.cc:
  Move implementation of Execute_observer to sql_class.cc and
  rename the class to Reprepare_observer.
  Use getters instead of direct access to the members.
sql/table.h:
  metadata -> table_ref
2008-05-20 11:29:16 +04:00
unknown
1cf0b5cb89 Implement some code review fixes for the fix for Bug#27430
"Crash in subquery code when in PS and table DDL changed after PREPARE"


include/my_sys.h:
  Add two new flags for my_error(). These flags help parameterize
  behavoiur of my_message_sql()
sql/item.cc:
  Update comments.
  Fix a typo in Item_param::set_param_type_and_swap_value()
sql/mysqld.cc:
  Implement two additional flags for my_error():
   - if ME_NO_SP_HANDLER is specified, ignore stored procedure continue/
      exit handlers
   - if ME_NO_WARNING_FOR_ERROR is specified, do not push warning
sql/sql_base.cc:
  Update comments.
  Rename a few methods.
sql/sql_class.h:
  Update and improve comments.
sql/sql_prepare.cc:
  Update comments.
  Style changes.
sql/table.h:
  Update comments.
  Style changes.
  Rename a few methods.
tests/mysql_client_test.c:
  Zero the bind array, to follow C API requirements.
2008-05-18 01:51:18 +04:00
unknown
f74a78b8eb Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.(none):/opt/local/work/mysql-5.1-27430


include/my_global.h:
  Auto merged
mysql-test/r/grant.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/grant.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
storage/myisam/mi_create.c:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
sql/share/errmsg.txt:
  Manual merge.
2008-04-19 14:37:20 +04:00
unknown
bd2a732812 WL#4165 "Prepared statements: validation".
Add metadata validation to ~20 more SQL commands. Make sure that
these commands actually work in ps-protocol, since until now they
were enabled, but not carefully tested.
Fixes the ml003 bug found by Matthias during internal testing of the
patch.


mysql-test/r/ps_ddl.result:
  Update test results (WL#4165)
mysql-test/t/ps_ddl.test:
  Cover with tests metadata validation of 26 SQL statements.
sql/mysql_priv.h:
  Fix the name in the comment.
sql/sp_head.cc:
  Changed the way the observer is removed in case of stored procedures
  to support validation prepare stmt from "call p1(<expr>)": whereas
  tables used in the expression must be validated, substatements
  of p1 must not.
  The previous scheme used to silence the observer only in stored
  functions and triggers.
sql/sql_class.cc:
  Now the observer is silenced in sp_head::execute(). Remove it from
  Sub_statement_state.
sql/sql_class.h:
  Now the observer is silenced in sp_head::execute(). Remove it from
  Sub_statement_state.
sql/sql_parse.cc:
  Add CF_REEXECUTION_FRAGILE to 20 more SQLCOMs that need it.
sql/sql_prepare.cc:
  Add metadata validation to ~20 new SQLCOMs that need it.
  Fix memory leaks with expressions used in SHOW DATABASES and CALL
  (and prepared statements).
  We need to fix all expressions at prepare, since if these expressions
  use subqueries, there are one-time transformations of the parse
  tree that must be done at prepare. 
  List of fixed commands includes: SHOW TABLES, SHOW DATABASES,
  SHOW TRIGGERS, SHOW EVENTS, SHOW OPEN TABLES,SHOW KEYS, SHOW FIELDS, 
  SHOW COLLATIONS, SHOW CHARSETS, SHOW VARIABLES, SHOW TATUS, SHOW TABLE
  STATUS, SHOW PROCEDURE STATUS, SHOW FUNCTION STATUS, CALL.
  Add comment to set_parameters().
sql/table.h:
  Update comments.
2008-04-17 01:04:49 +04:00
unknown
a63dde5a5b Tentative implementation of
WL#4165 Prepared statements: validation 
WL#4166 Prepared statements: automatic re-prepare
Fixes
Bug#27430 Crash in subquery code when in PS and table DDL changed after PREPARE
Bug#27690 Re-execution of prepared statement after table was replaced with a view crashes
Bug#27420 A combination of PS and view operations cause error + assertion on shutdown

The basic idea of the patch is to keep track of table metadata between
prepared statement prepare and execute. If some table used in the statement
has changed, the prepared statement is re-prepared before execution.

See WL#4165 and WL#4166 contents and comments in the code for details
of the implementation.


include/my_global.h:
  Remove 'register' keyword to avoid warnings when swapping large structures
  that don't fit into a register. Any modern compiler is capable of placing
  a variable in a register when that would benefit performance.
mysql-test/r/ps_1general.result:
  Update test results: since now we re-prepare automatically,
  more correct results are produced in prepare-ddl-execute scenario.
mysql-test/r/query_cache_merge.result:
  Ensure that the table definition cache is large enough for
  the test to pass in --ps-protocol
mysql-test/r/trigger.result:
  Update test results to reflect automatic statement reprepare.
mysql-test/t/disabled.def:
  Enable ps_ddl.test, which now passes.
mysql-test/t/ps_1general.test:
  Since now we re-execute prepared statements after DDL successfully,
  change the test to produce repeatable results. Remove expectancy of
  an error in one place where now we automatically reprepare the prepared
  statement.
mysql-test/t/query_cache_merge.test:
  Ensure the table definition cache is large enough for the test to pass
  in --ps-protocol
mysql-test/t/trigger.test:
  Sinc
sql/item.cc:
  Implement Item_param "copy" functionality, used at re-prepare of
  a prepared statement.
  We copy the type of the original parameter, and move the assigned value,
  if any. Sic, the value is "moved", since it can be quite big --
  e.g. in case we deal with a LONG DATA parameter.
  It's essential to move the value from the old parameter since
  at the time of re-prepare the client packet with the necessary information
  may be not available.
sql/item.h:
  Declare a new method used for reprepare.
sql/my_decimal.h:
  Implement "swap()" functionality of class my_decimal to be
  able to easily swap two decimal values.
sql/mysql_priv.h:
  Declare enum_metadata_type.
sql/mysqld.cc:
  Implement a status variable for the number of reprepared statements.
sql/sql_base.cc:
  Implement metadata version validation.
sql/share/errmsg.txt:
  Add two new error messages: ER_NEED_REPREPARE and ER_PS_REBIND.
  The first error (theoretically) never reaches the user.
  It is issued by the metadata validation framework when a metadata version
  has changed between prepare and execute. Later on it's intercepted
  and the statement is automatically re-prepared. Only if the error
  has occurred repeatedly MAX_REPREPARE_ATTEMTS (3) times do we
  return it to the user.
  
  The second error is issued when after re-prepare we discover
  that the metadata we sent over to the client using the binary
  protocol differs drammatically from the new result set metadata 
  that the reprepared statement produces (e.g. number of result
  set columns is different).
sql/sql_class.cc:
  Implement metadata version validation framework.
sql/sql_class.h:
  Declarations for metadata version validation framework.
sql/sql_parse.cc:
  Mark commands for which we must invalidate and reprepare a prepared
  statement when metadata has changed.
sql/sql_prepare.cc:
  Implement WL#4165 and WL#4166 (limited support of metadata validation
  and re-prepare).
sql/table.h:
  Implement metadata validation.
tests/mysql_client_test.c:
  Add a test case for WL#4166
2008-04-08 20:01:20 +04:00
unknown
6ef32fd0a9 Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel


client/mysqldump.c:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
mysys/my_create.c:
  SCCS merged
2008-03-13 23:35:52 +02:00
unknown
6c2f9bf5e1 Merge ssh://bk-internal.mysql.com//home/bk/mysql-5.1-opt
into  kaamos.(none):/data/src/opt/mysql-5.1-opt


sql/sql_show.cc:
  Auto merged
sql/table.h:
  Auto merged
2008-03-12 13:56:50 +03:00
unknown
4aae2099c9 Bug #34367: sql/sql_show.cc: create_schema_table should handle
MYSQL_TYPE_NEWDECIMAL

Added support for the type MYSQL_TYPE_NEWDECIMAL. It now works like
MYSQL_TYPE_DECIMAL. Unfortunately there cannot be a test case until
we have a working information_schema plugin as part of the source
distribution.


sql/sql_show.cc:
  Bug#34367: The fix. Corrected wrong comments and a DBUG_ENTER with wrong 
  function name.
sql/table.h:
  Bug#34367: Added comments to st_field_info.
2008-03-07 13:56:15 +01:00
unknown
abf0761539 Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel


client/mysqltest.c:
  Auto merged
mysql-test/r/change_user.result:
  Auto merged
mysql-test/t/change_user.test:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_test.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
2008-03-07 11:25:47 +02:00
unknown
a3e83048a3 Fix for Bug#30217: Views: changes in metadata behaviour
between 5.0 and 5.1.
  
The problem was that in the patch for Bug#11986 it was decided
to store original query in UTF8 encoding for the INFORMATION_SCHEMA.
This approach however turned out to be quite difficult to implement
properly. The main problem is to preserve the same IS-output after
dump/restore.
  
So, the fix is to rollback to the previous functionality, but also
to fix it to support multi-character-set-queries properly. The idea
is to generate INFORMATION_SCHEMA-query from the item-tree after
parsing view declaration. The IS-query should:
  - be completely in UTF8;
  - not contain character set introducers.
  
For more information, see WL4052.


mysql-test/include/ddl_i18n.check_views.inc:
  Add a test case for Bug#30217.
mysql-test/r/ddl_i18n_koi8r.result:
  Update result file.
mysql-test/r/ddl_i18n_utf8.result:
  Update result file.
mysql-test/r/information_schema.result:
  Update result file.
mysql-test/r/information_schema_db.result:
  Update result file.
mysql-test/r/mysqldump.result:
  Update result file.
mysql-test/r/show_check.result:
  Update result file.
mysql-test/t/ddl_i18n_koi8r.test:
  Add a test case for Bug#30217.
mysql-test/t/ddl_i18n_utf8.test:
  Add a test case for Bug#30217.
mysql-test/t/mysqldump.test:
  Add a test case for Bug#30217.
sql/ha_ndbcluster.cc:
  Add a parameter to print().
sql/item.cc:
  1. Add a parameter to print().
  2. Item_string::print():
        - Do not append character set introducer to the text literal
          if we're building a query for INFORMATION_SCHEMA;
        - Convert text literal to UTF8 if we're building a query
          for INFORMATION_SCHEMA.
sql/item.h:
  Add a parameter to print().
sql/item_cmpfunc.cc:
  Add a parameter to print().
sql/item_cmpfunc.h:
  Add a parameter to print().
sql/item_func.cc:
  Add a parameter to print().
sql/item_func.h:
  Add a parameter to print().
sql/item_geofunc.h:
  Add a parameter to print().
sql/item_row.cc:
  Add a parameter to print().
sql/item_row.h:
  Add a parameter to print().
sql/item_strfunc.cc:
  Add a parameter to print().
sql/item_strfunc.h:
  Add a parameter to print().
sql/item_subselect.cc:
  Add a parameter to print().
sql/item_subselect.h:
  Add a parameter to print().
sql/item_sum.cc:
  Add a parameter to print().
sql/item_sum.h:
  Add a parameter to print().
sql/item_timefunc.cc:
  Add a parameter to print().
sql/item_timefunc.h:
  Add a parameter to print().
sql/mysql_priv.h:
  Add a parameter to print().
sql/sp_head.cc:
  Add a parameter to print().
sql/sql_lex.cc:
  Add a parameter to print().
sql/sql_lex.h:
  Add a parameter to print().
sql/sql_parse.cc:
  Add a parameter to print().
sql/sql_select.cc:
  Add a parameter to print().
sql/sql_show.cc:
  Add a parameter to print().
sql/sql_test.cc:
  Add a parameter to print().
sql/sql_view.cc:
  Build INFORMATION_SCHEMA query from Item-tree.
sql/sql_yacc.yy:
  Build INFORMATION_SCHEMA query from Item-tree.
sql/table.h:
  Add a parameter to print().
2008-02-22 13:30:33 +03:00
unknown
58753e5c11 Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel


BitKeeper/etc/ignore:
  auto-union
client/mysqlcheck.c:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
include/Makefile.am:
  Auto merged
include/m_string.h:
  Auto merged
include/my_base.h:
  Auto merged
include/my_dbug.h:
  Auto merged
include/my_global.h:
  Auto merged
include/my_sys.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysql/Makefile.shared:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
mysys/mf_keycache.c:
  Auto merged
sql/gen_lex_hash.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/lex.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
sql/unireg.cc:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
storage/myisam/ft_nlq_search.c:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
storage/myisam/myisampack.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
client/mysqlslap.c:
  Manual merge with main 5.1 tree.
2008-02-08 12:13:33 +01:00
unknown
295732b580 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1


configure.in:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/field.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_geofunc.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/key.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/opt_sum.cc:
  Auto merged
sql/protocol.h:
  Auto merged
sql/repl_failsafe.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_select.h:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
storage/archive/ha_archive.cc:
  Auto merged
storage/innobase/buf/buf0buf.c:
  Auto merged
storage/innobase/buf/buf0flu.c:
  Auto merged
storage/innobase/buf/buf0lru.c:
  Auto merged
storage/innobase/include/buf0buf.h:
  Auto merged
storage/innobase/include/buf0buf.ic:
  Auto merged
storage/innobase/include/sync0arr.h:
  Auto merged
storage/innobase/include/sync0rw.h:
  Auto merged
storage/innobase/include/sync0rw.ic:
  Auto merged
storage/innobase/include/sync0sync.h:
  Auto merged
storage/innobase/os/os0sync.c:
  Auto merged
storage/innobase/sync/sync0arr.c:
  Auto merged
storage/innobase/sync/sync0rw.c:
  Auto merged
storage/innobase/sync/sync0sync.c:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  merged
sql/item_cmpfunc.cc:
  merged
sql/protocol.cc:
  merged
sql/slave.cc:
  merged
sql/sql_class.h:
  merged
sql/sql_parse.cc:
  merged
2007-12-20 22:11:37 +01:00
unknown
7fd0ad21a7 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-forcollapseandmerge
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint


CMakeLists.txt:
  Auto merged
configure.in:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/r/information_schema_db.result:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
sql/CMakeLists.txt:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/repl_failsafe.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/structs.h:
  Auto merged
sql/table.h:
  Auto merged
storage/archive/ha_archive.cc:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
support-files/mysql.spec.sh:
  Auto merged
client/mysqlcheck.c:
  Manual merge.
mysql-test/r/information_schema.result:
  Manual merge.
mysql-test/r/mysqlcheck.result:
  Manual merge.
mysql-test/t/mysqlcheck.test:
  Manual merge.
sql/slave.cc:
  Manual merge.
sql/sql_base.cc:
  Manual merge.
sql/sql_delete.cc:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
sql/sql_update.cc:
  Manual merge.
2007-12-14 13:42:09 -05:00
unknown
9a10c20ba9 Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


BitKeeper/etc/ignore:
  auto-union
client/mysql.cc:
  Auto merged
client/mysqltest.c:
  Auto merged
include/mysql_com.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/r/archive.result:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/delayed.result:
  Auto merged
mysql-test/r/func_misc.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/merge.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/r/type_date.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_innodb_bug28430.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/func_misc.test:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
mysql-test/t/merge.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/type_date.test:
  Auto merged
mysql-test/t/type_datetime.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
mysys/queues.c:
  Auto merged
sql/events.cc:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_string.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/lib/mtr_report.pl:
  manual merge
mysql-test/r/myisam.result:
  manual merge
mysql-test/r/partition.result:
  manual merge
mysql-test/r/user_var.result:
  manual merge
mysql-test/t/myisam.test:
  manual merge
mysql-test/t/partition.test:
  manual merge
mysql-test/t/user_var.test:
  manual merge
sql/item.h:
  manual merge
sql/item_func.cc:
  manual merge
storage/myisammrg/ha_myisammrg.cc:
  manual merge
2007-12-13 15:56:04 +04:00
unknown
ee52ff0ad9 Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel


mysql-test/lib/mtr_report.pl:
  Auto merged
mysys/my_delete.c:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
storage/myisam/mi_packrec.c:
  Auto merged
storage/myisam/myisamchk.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
include/my_base.h:
  Manual merge from 5.1
2007-12-07 22:27:48 +02:00
unknown
9a34c80e11 Bug#30152 MySQLD crash duing alter table causes DROP DATABASE to FAIL due to temp file
disable decoding of table name if the table is internal temporary table


mysql-test/r/drop.result:
  test result
mysql-test/t/drop.test:
  test case
sql/sql_db.cc:
  check is the name is internal tmp table name
sql/sql_table.cc:
  disable decoding of table name if the table is internal temporary table
sql/table.h:
  added flag which is true when table name is the name of internal temporary table
2007-11-23 18:21:24 +04:00
unknown
c8450b278d Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Bug 26867 - LOCK TABLES + REPAIR + merge table result in
            memory/cpu hogging
Bug 26377 - Deadlock with MERGE and FLUSH TABLE
Bug 25038 - Waiting TRUNCATE
Bug 25700 - merge base tables get corrupted by
            optimize/analyze/repair table
Bug 30275 - Merge tables: flush tables or unlock tables
            causes server to crash
Bug 19627 - temporary merge table locking
Bug 27660 - Falcon: merge table possible
Bug 30273 - merge tables: Can't lock file (errno: 155)

The problems were:

Bug 26379 - Combination of FLUSH TABLE and REPAIR TABLE
                corrupts a MERGE table

  1. A thread trying to lock a MERGE table performs busy waiting while
     REPAIR TABLE or a similar table administration task is ongoing on
     one or more of its MyISAM tables.
  
  2. A thread trying to lock a MERGE table performs busy waiting until all
     threads that did REPAIR TABLE or similar table administration tasks
     on one or more of its MyISAM tables in LOCK TABLES segments do UNLOCK
     TABLES. The difference against problem #1 is that the busy waiting
     takes place *after* the administration task. It is terminated by
     UNLOCK TABLES only.
  
  3. Two FLUSH TABLES within a LOCK TABLES segment can invalidate the
     lock. This does *not* require a MERGE table. The first FLUSH TABLES
     can be replaced by any statement that requires other threads to
     reopen the table. In 5.0 and 5.1 a single FLUSH TABLES can provoke
     the problem.

Bug 26867 - LOCK TABLES + REPAIR + merge table result in
            memory/cpu hogging

  Trying DML on a MERGE table, which has a child locked and
  repaired by another thread, made an infinite loop in the server.

Bug 26377 - Deadlock with MERGE and FLUSH TABLE

  Locking a MERGE table and its children in parent-child order
  and flushing the child deadlocked the server.

Bug 25038 - Waiting TRUNCATE

  Truncating a MERGE child, while the MERGE table was in use,
  let the truncate fail instead of waiting for the table to
  become free.

Bug 25700 - merge base tables get corrupted by
            optimize/analyze/repair table

  Repairing a child of an open MERGE table corrupted the child.
  It was necessary to FLUSH the child first.

Bug 30275 - Merge tables: flush tables or unlock tables
            causes server to crash

  Flushing and optimizing locked MERGE children crashed the server.

Bug 19627 - temporary merge table locking

  Use of a temporary MERGE table with non-temporary children
  could corrupt the children.

  Temporary tables are never locked. So we do now prohibit
  non-temporary chidlren of a temporary MERGE table.

Bug 27660 - Falcon: merge table possible

  It was possible to create a MERGE table with non-MyISAM children.

Bug 30273 - merge tables: Can't lock file (errno: 155)

  This was a Windows-only bug. Table administration statements
  sometimes failed with "Can't lock file (errno: 155)".

These bugs are fixed by a new implementation of MERGE table open.

When opening a MERGE table in open_tables() we do now add the
child tables to the list of tables to be opened by open_tables()
(the "query_list"). The children are not opened in the handler at
this stage.

After opening the parent, open_tables() opens each child from the
now extended query_list. When the last child is opened, we remove
the children from the query_list again and attach the children to
the parent. This behaves similar to the old open. However it does
not open the MyISAM tables directly, but grabs them from the already
open children.

When closing a MERGE table in close_thread_table() we detach the
children only. Closing of the children is done implicitly because
they are in thd->open_tables.

For more detail see the comment at the top of ha_myisammrg.cc.

Changed from open_ltable() to open_and_lock_tables() in all places
that can be relevant for MERGE tables. The latter can handle tables
added to the list on the fly. When open_ltable() was used in a loop
over a list of tables, the list must be temporarily terminated
after every table for open_and_lock_tables().
table_list->required_type is set to FRMTYPE_TABLE to avoid open of
special tables. Handling of derived tables is suppressed.
These details are handled by the new function
open_n_lock_single_table(), which has nearly the same signature as
open_ltable() and can replace it in most cases.

In reopen_tables() some of the tables open by a thread can be
closed and reopened. When a MERGE child is affected, the parent
must be closed and reopened too. Closing of the parent is forced
before the first child is closed. Reopen happens in the order of
thd->open_tables. MERGE parents do not attach their children
automatically at open. This is done after all tables are reopened.
So all children are open when attaching them.

Special lock handling like mysql_lock_abort() or mysql_lock_remove()
needs to be suppressed for MERGE children or forwarded to the parent.
This depends on the situation. In loops over all open tables one
suppresses child lock handling. When a single table is touched,
forwarding is done.

Behavioral changes:
===================

This patch changes the behavior of temporary MERGE tables.
Temporary MERGE must have temporary children.
The old behavior was wrong. A temporary table is not locked. Hence
even non-temporary children were not locked. See
Bug 19627 - temporary merge table locking.

You cannot change the union list of a non-temporary MERGE table
when LOCK TABLES is in effect. The following does *not* work:
CREATE TABLE m1 ... ENGINE=MRG_MYISAM ...;
LOCK TABLES t1 WRITE, t2 WRITE, m1 WRITE;
ALTER TABLE m1 ... UNION=(t1,t2) ...;
However, you can do this with a temporary MERGE table.

You cannot create a MERGE table with CREATE ... SELECT, neither
as a temporary MERGE table, nor as a non-temporary MERGE table.
CREATE TABLE m1 ... ENGINE=MRG_MYISAM ... SELECT ...;
Gives error message: table is not BASE TABLE.


include/my_base.h:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added HA_EXTRA_ATTACH_CHILDREN and HA_EXTRA_DETACH_CHILDREN.
include/myisammrg.h:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added element 'children_attached' to MYRG_INFO.
  Added declarations for myrg_parent_open(),
  myrg_attach_children() and myrg_detach_children()
  for the new MERGE table open approach.
mysql-test/extra/binlog_tests/blackhole.test:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Preliminarily added new error message with a comment.
mysql-test/r/create.result:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Fixed test result.
mysql-test/r/delayed.result:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Moved test result from here to merge.result.
mysql-test/r/merge.result:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Fixed/added test result.
mysql-test/r/myisam.result:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Moved test result for bug 8306 from here to merge.result.
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Fixed test result.
mysql-test/t/create.test:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Fixed error number.
mysql-test/t/delayed.test:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Moved test from here to merge.test.
mysql-test/t/merge.test:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Fixed test for new temporary MERGE table behavior.
  Exchanged error numbers by symbolic codes.
  Added tests. Included are tests for bugs
  8306 (moved from myisam.test), 26379, 19627, 25038, 25700, 26377,
  26867, 27660, 30275, and 30273.
  Fixed changes resulting from disabled CREATE...SELECT.
  Integrated tests moved from delayed.test and myisam.test to here.
mysql-test/t/myisam.test:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Moved test for bug 8306 from here to merge.test.
mysys/thr_lock.c:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added code to let the owner of a high priority lock (TL_WRITE_ONLY)
  to bypass its own lock.
sql/ha_ndbcluster_binlog.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added 'thd' argument to init_tmp_table_share().
sql/handler.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added 'thd' argument to init_tmp_table_share().
sql/mysql_priv.h:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Removed declaration of check_merge_table_access(). It is now static
  in sql_parse.cc.
  Added declaration for fix_merge_after_open().
  Renamed open_and_lock_tables() to open_and_lock_tables_derived()
  with additional parameter 'derived'.
  Added inline functions simple_open_n_lock_tables() and
  open_and_lock_tables(), which call open_and_lock_tables_derived()
  and add the argument for 'derived'.
  Added new function open_n_lock_single_table(), which can be used
  as an replacement for open_ltable() in most situations. Internally
  it calls simple_open_n_lock_tables() so hat it is appropriate for
  MERGE tables.
  Added 'thd' argument to init_tmp_table_share().
sql/slave.cc:
  ug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added comment.
sql/sql_base.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  
  Defined new functions add_merge_table_list(),
  attach_merge_children(), detach_merge_children(), and
  fix_merge_after_open() for the new MERGE table open approach.
  
  Added calls of the new functions to
  close_handle_and_leave_table_as_lock(), close_thread_tables(),
  close_thread_table(), unlink_open_table(), reopen_name_locked_table(),
  reopen_table(), drop_locked_tables(), close_temporary_table(),
  and open_tables() respectively.
  
  Prevented special lock handling of merge children (like
  mysql_lock_remove, mysql_lock_merge or mysql_lock_abort)
  at many places. Some of these calls are forwarded to the
  parent table instead.
  
  Added code to set thd->some_tables_deleted for every thread that has
  a table open that we are flushing.
  Added code for MERGE tables to unlink_open_table().
  Added MERGE children to the list of unusable tables in open_table().
  Added MERGE table handling to reopen_table().
  Added lock handling and closing of a parent before the children
  in close_data_files_and_morph_locks().
  Added code for re-attaching children in reopen_tables().
  Added MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN to the locking flags and
  error reporting after mysql_lock_tables() in reopen_tables().
  Added lock handling and closing of a parent before the children
  in close_old_data_files().
  Added lock handling and detaching in drop_locked_tables().
  Added code for removing the children list from the statement list
  to prepare for a repetition in open_tables().
  Added new function open_n_lock_single_table(), which can be used
  as an replacement for open_ltable() in most situations. Internally
  it calls simple_open_n_lock_tables() so hat it is appropriate for
  MERGE tables.
  Disabled use of open_ltable() for MERGE tables.
  Removed function simple_open_n_lock_tables(). It is now inline
  declared in mysql_priv.h.
  Renamed open_and_lock_tables() to open_and_lock_tables_derived()
  with additional parameter 'derived'. open_and_lock_tables() is now
  inline declared in mysql_priv.h.
  Added a check for end-of-list in two loops in lock_tables().
  Added 'thd' argument to init_tmp_table_share().
sql/sql_insert.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Changed from open_ltable() to open_n_lock_single_table() in
  handle_delayed_insert().
  Reestablished LEX settings after lex initialization.
  Added 'thd' argument to init_tmp_table_share().
sql/sql_parse.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Made check_merge_table_access() a static function.
  Disabled use of CREATE...SELECT for MERGE tables.
sql/sql_partition.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Fixed comment typo.
sql/sql_select.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added 'thd' argument to init_tmp_table_share().
sql/sql_table.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Optimized use of mysql_ha_flush() in mysql_rm_table_part2().
  Disabled the use of MERGE tables with prepare_for_restore() and
  prepare_for_repair().
  Changed from open_ltable() to open_n_lock_single_table() in
  mysql_alter_table() and mysql_checksum_table().
  Disabled change of child list under LOCK TABLES.
  Initialized table_list->table in mysql_recreate_table().
sql/sql_trigger.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added code for allowing CREATE TRIGGER under LOCK TABLE, to be able
  to test it with MERGE tables.
sql/table.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added 'thd' argument to init_tmp_table_share().
  Setting table_map_id from query_id in init_tmp_table_share().
  Added member function TABLE::is_children_attached().
sql/table.h:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added access method get_table_def_version() to TABLE_SHARE.
  Added elements for MERGE tables to TABLE and TABLE_LIST.
storage/myisam/ha_myisam.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added an unrelated comment to the function comment of table2myisam().
storage/myisam/ha_myisam.h:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added new member function MI_INFO::file_ptr().
storage/myisammrg/ha_myisammrg.cc:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added callback functions to support parent open and children attach
  of MERGE tables.
  Changed ha_myisammrg::open() to initialize storage engine structures
  and create a list of child tables only. Child tables are not opened.
  Added ha_myisammrg::attach_children(), which does now the main part
  of MERGE open.
  Added ha_myisammrg::detach_children().
  Added calls to ::attach_children() and ::detach_children() to
  ::extra() on HA_EXTRA_ATTACH_CHILDREN and HA_EXTRA_DETACH_CHILDREN
  respectively.
  Added a check for matching TEMPORARY type for children against
  parent.
  Added a check for table def version.
  Added support for thd->open_options to attach_children().
  Changed child path name generation for temporary tables so that
  it does nothing special for temporary tables.
storage/myisammrg/ha_myisammrg.h:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added elements to class ha_myisammrg to support the new
  open approach.
  Changed empty destructor definition to a declaration.
  Implemented in ha_myisammrg.cc.
  Added declaration for methods attach_children() and
  detach_children().
  Added definition for method table_ptr() for use with
  callback functions.
storage/myisammrg/myrg_close.c:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Added a check to avoid closing of MyISAM tables when the
  child tables are not attached.
  Added freeing of rec_per_key_part when the child tables
  are not attached.
storage/myisammrg/myrg_extra.c:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  Some ::extra() functions and ::reset() can be called when
  children are detached.
storage/myisammrg/myrg_open.c:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
              corrupts a MERGE table
  
  Kept old myrg_open() for MERGE use independent from MySQL.
  Removed an always true condition in myrg_open().
  Set children_attached for independent MERGE use in myrg_open().
  
  Added myrg_parent_open(), myrg_attach_children(), and
  myrg_detach_children() for the new MERGE table open approach.
mysql-test/r/merge-big.result:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table
  New test result
mysql-test/t/merge-big.test:
  Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table
  New test case
2007-11-15 20:25:43 +01:00
unknown
f0e24c795f Merge bk-internal.mysql.com:/home/bk/mysql-5.1-community
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-forcollapseandmerge


sql/ha_ndbcluster.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
sql/sql_parse.cc:
  Manual merge.
sql/sql_select.cc:
  Manual merge.
2007-11-09 14:55:32 -05:00
unknown
0eec2d63d5 Merge hynda.mysql.fi:/home/my/mysql-5.1-main
into  hynda.mysql.fi:/home/my/mysql-5.1-marvel


BitKeeper/etc/ignore:
  auto-union
client/mysql_upgrade.c:
  Auto merged
client/mysqlcheck.c:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqlimport.c:
  Auto merged
client/mysqlshow.c:
  Auto merged
client/mysqlslap.c:
  Auto merged
client/mysqltest.c:
  Auto merged
include/my_global.h:
  Auto merged
include/my_sys.h:
  Auto merged
mysys/mf_keycache.c:
  Auto merged
mysys/my_init.c:
  Auto merged
mysys/safemalloc.c:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
sql/unireg.cc:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_write.c:
  Auto merged
sql/sql_yacc.yy:
  Merged with 5.1 main tree.
2007-11-08 13:23:08 +02:00
unknown
611dbd0bb3 Bug#30882 Dropping a temporary table inside a stored function may cause a server crash
If a stored function that contains a drop temporary table statement
is invoked by a create temporary table of the same name may cause
a server crash. The problem is that when dropping a table no check
is done to ensure that table is not being used by some outer query
(or outer statement), potentially leaving the outer query with a
reference to a stale (freed) table.

The solution is when dropping a temporary table, always check if
the table is being used by some outer statement as a temporary
table can be dropped inside stored procedures.

The check is performed by looking at the TABLE::query_id value for
temporary tables. To simplify this check and to solve a bug related
to handling of temporary tables in prelocked mode, this patch changes
the way in which this member is used to track the fact that table is
used/unused. Now we ensure that TABLE::query_id is zero for unused
temporary tables (which means that all temporary tables which were
used by a statement should be marked as free for reuse after it's
execution has been completed).


mysql-test/include/handler.inc:
  Add test case for side effect of Bug#30882
mysql-test/r/handler_innodb.result:
  Add test case result for side effect of Bug#30882
mysql-test/r/handler_myisam.result:
  Add test case result for side effect of Bug#30882
mysql-test/r/sp-error.result:
  Add test case result for Bug#30882
mysql-test/t/sp-error.test:
  Add test case for Bug#30882
sql/event_db_repository.cc:
  Update close_thread_tables call, no more default values.
sql/mysql_priv.h:
  Remove implicit default parameters values of the close_thread_tables
  function as no callers are using it.
sql/slave.cc:
  Update close_thread_tables call, no more default values
sql/sp_head.cc:
  Update close_thread_tables call, no more default values
sql/sql_base.cc:
  Changed the approach to distinguishing currently unused temporary tables.
  Now we ensure that such tables always have TABLE::query_id set to 0 and
  use this fact to perform checks during opening and dropping of temporary
  tables. This means that we have to call close_thread_tables() even for
  statements which use only temporary tables. To make this call cheaper,
  we re-factored close_thread_tables() to not take LOCK_open unless there
  are open base tables.
sql/sql_handler.cc:
  Properly close temporary tables associated with a handler.
sql/sql_insert.cc:
  close_temporary_table is now merged into drop_temporary_table.
sql/sql_parse.cc:
  Now the condition doesn't cover all cases because close_thread_tables()
  must be called even for statements that use only temporary tables.
sql/sql_table.cc:
  Use drop_temporary_table which perform checks to verify if
  the table is not being used. Error path problem is due to
  a handler tables issue and is going to be addressed in bug
  31397.
sql/table.h:
  Rename previously unused clear_query_id and document the usage of
  query_id and open_by_handler.
2007-11-01 18:52:56 -02:00
unknown
cca4ea275b Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1


CMakeLists.txt:
  Auto merged
BitKeeper/deleted/.del-Makefile.am~2:
  Auto merged
BitKeeper/deleted/.del-README~1:
  Auto merged
BitKeeper/deleted/.del-configure.js:
  Auto merged
BitKeeper/deleted/.del-ha_berkeley.cc:
  Auto merged
BitKeeper/triggers/post-commit:
  Auto merged
client/CMakeLists.txt:
  Auto merged
extra/CMakeLists.txt:
  Auto merged
include/config-win.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/r/func_in.result:
  Auto merged
mysql-test/r/information_schema_db.result:
  Auto merged
mysql-test/t/func_in.test:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
server-tools/instance-manager/CMakeLists.txt:
  Auto merged
sql/CMakeLists.txt:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/lex.h:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/structs.h:
  Auto merged
storage/archive/ha_archive.cc:
  Auto merged
storage/myisam/CMakeLists.txt:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
storage/ndb/src/ndbapi/DictCache.cpp:
  Auto merged
BitKeeper/deleted/.del-mysqld.vcproj~6aa7b3f9c3e28fcb:
  Manual merge.
configure.in:
  Manual merge.
mysql-test/r/information_schema.result:
  Manual merge.
mysql-test/t/profiling.test:
  Manual merge.
sql/set_var.cc:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
sql/sql_profile.cc:
  Manual merge.
sql/sql_profile.h:
  Manual merge.
sql/sql_select.cc:
  Manual merge.
sql/sql_show.cc:
  Manual merge.
sql/table.h:
  Manual merge.
storage/ndb/src/common/util/File.cpp:
  Manual merge.
support-files/mysql.spec.sh:
  Manual merge.
2007-10-31 17:24:32 -04:00
unknown
f48feae696 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-comeng-unification
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-recentcommmerge


BitKeeper/deleted/.del-ha_berkeley.cc:
  Auto merged
BitKeeper/deleted/.del-mysqld.vcproj~6aa7b3f9c3e28fcb:
  Auto merged
BitKeeper/triggers/post-commit:
  Auto merged
client/mysqlcheck.c:
  Auto merged
include/config-win.h:
  Auto merged
include/my_dbug.h:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/r/func_in.result:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/information_schema_db.result:
  Auto merged
mysql-test/t/func_in.test:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/repl_failsafe.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/structs.h:
  Auto merged
sql/table.h:
  Auto merged
storage/archive/ha_archive.cc:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
storage/ndb/src/common/util/File.cpp:
  Auto merged
configure.in:
  Manual merge.
sql/CMakeLists.txt:
  Manual merge.
sql/mysql_priv.h:
  Manual merge.
sql/mysqld.cc:
  Manual merge.
sql/set_var.cc:
  Manual merge.
sql/slave.cc:
  Manual merge.
sql/sql_cache.cc:
  Manual merge.
sql/sql_class.cc:
  Manual merge.
sql/sql_lex.h:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
sql/sql_select.cc:
  Manual merge.
sql/sql_show.cc:
  Manual merge.
sql/sql_table.cc:
  Manual merge.
sql/sql_update.cc:
  Manual merge.
sql/sql_yacc.yy:
  Manual merge.
2007-10-17 14:05:43 -04:00
unknown
fb84f573ad Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1
- Reserver namespace and place in frm for TABLE_CHECKSUM and PAGE_CHECKSUM create options
- Added syncing of directory when creating .frm files
- Portability fixes
- Added missing cast that could cause bugs
- Code cleanups
- Made some bit functions inline
- Moved things out of myisam.h to my_handler.h to make them more accessable
- Renamed some myisam variables and defines to make them more globaly usable (as they are used outside of MyISAM)
- Fixed bugs in error conditions
- Use compiler time asserts instead of run time
- Fixed indentation
HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP as the old name was wrong
(Added a define for old value to ensure we don't break any old code)
Added HA_EXTRA_PREPARE_FOR_RENAME as a signal for rename (before we used a DROP signal which is wrong)
- Initialize error messages early to get better errors when mysqld or an engine fails to start
- Fix windows bug that query_performance_frequency was not initialized if registry code failed
- thread_stack -> my_thread_stack_size


BitKeeper/etc/ignore:
  added libmysqld/scheduler.cc libmysqld/sql_connect.cc libmysqld/sql_tablespace.cc
include/Makefile.am:
  Added my_bit.h
include/m_string.h:
  Added bzero_if_purify() to simplify code
include/my_base.h:
  Reserve options for the future
  Added HA_OPTION_NULL_FIELDS, HA_OPTION_PAGE_CHECKSUM, HA_CREATE_PAGE_CHECKSUM
  Added new error message HA_ERR_NEW_FILE
  Added optional new row type BLOCK_RECORD
  Renamed HA_EXTRA_PREPARE_FOR_DELETE to HA_EXTRA_PREPARE_FOR_DROP
  Added HA_EXTRA_PREARE_FOR_RENAME to inform handler we will do a rename
  (Added define to make things compatible until 6.0)
  Moved invalidator_by_filename form myisam.h
include/my_dbug.h:
  Poirtablity fix
include/my_global.h:
  Added helper macros STATIC_INLINE and MY_ERRPTR
  Added NEED_EXPLICIT_SYNC_DIR
include/my_handler.h:
  Added missing casts
  Moved some constants and macros out from myisam.h to make these generally available
  Renamed mi_compare_text() to ha_compare_text() as this function is not myisam specific
  Renamed mi_portable_sizeof_char_ptr to portable_sizeof_char_ptr
  Added registering of handler messages for better error reporting during startup
include/my_sys.h:
  Added my_sync_dir() and my_sync_dir_by_file()
  More comments
  Some indentation fixes
  Moved bit functions to my_bit.h
  Added prototype for crc32()
include/myisam.h:
  Moved things from here to my_handler.h to make them more accessable
libmysql/Makefile.shared:
  Added my_sync
mysys/array.c:
  Fixed indentation and spelling errors
  Split set_dynamic() to two functions
  Added allocate_dynamic() as a new visiable function
  (no new code, only refactoring)
mysys/mf_iocache.c:
  More DBUG
mysys/mf_keycache.c:
  More explicite ASSERT
  Removed some casts
  Fixed indentation
mysys/mf_tempfile.c:
  Fixed bug with possible dangling file descriptor
mysys/my_atomic.c:
  Use compile time asserts instead of run time
mysys/my_bit.c:
  Make most bit functions inline
mysys/my_bitmap.c:
  Added my_bit.h
mysys/my_compress.c:
  Fixed indentation
mysys/my_create.c:
  Added my_sync_by_dir()
mysys/my_delete.c:
  Added my_sync_by_dir()
mysys/my_error.c:
  init_glob_errs() is now done in my_init()
mysys/my_handler.c:
  mi_compare_text() -> ha_compare_text() as this is not MyISAM specific
  Added functions to initialize handler error messages
  Fixed indentation
  More clear usage of include files
mysys/my_init.c:
  Added my_thread_stack_size to be used by other programs
  Ensure that global error messages are always initialized
  Fix windows bug that query_performance_frequency was not initialized if registry code failed
mysys/my_open.c:
  More comments
  Removed duplicate code
mysys/my_pread.c:
  Ensure that my_errno is set even if errno is 0
mysys/my_realloc.c:
  Added comment
mysys/my_rename.c:
  Added syncing of directories
mysys/my_symlink.c:
  Added my_sync_by_dir()
mysys/my_sync.c:
  Added my_sync_dir()
   
  On recent Mac OS X, fcntl(F_FULLFSYNC) is recommended over fsync()
  (see "man fsync" on Mac OS X 10.3).
  my_sync_dir(): to sync a directory after a file creation/deletion/
  renaming; can be called directly or via MY_SYNC_DIR in my_create/
  my_delete/my_rename(). No-op except on Linux (see "man fsync" on Linux).
  my_sync_dir_from_file(): same as above, just more practical when the
  caller has a file name but no directory name ready.
  Should the #warning even be a #error? I mean do we want to release
  binaries which don't guarantee any durability?
mysys/safemalloc.c:
  Added sf_malloc_report_allocated() (Debugging aid)
sql/gen_lex_hash.cc:
  Remove inline for big function
sql/ha_partition.cc:
  HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP
  prepare_for_delete -> prepare_for_rename() as this is the the time this function is called
sql/ha_partition.h:
  prepare_for_delete -> prepare_for_rename() as this is the the time this function is called
sql/handler.cc:
  ha_init_errors() is now called at startup before plugins
  This allows us to get better error messages
sql/handler.h:
  Reserve enum value for Maria
  Add future proof enum for page checksums
sql/item_func.cc:
  Include my_bit.h
sql/lex.h:
  Added future proof CREATE table options
sql/log.cc:
  Added comment
sql/mysql_priv.h:
  thread_stack moved to mysys
sql/mysqld.cc:
  thread_stack moved to mysys
  thread_stack -> my_thread_stack_size
  Initialize myisam key caches before plugins starts
  Initialize error to allow storage engine to give better error messages if init failes.
  Fixed indentation
  Group all MyISAM options together
  Added new status variable 'Opened_table_definitions' to allow one to monitor if table definition cache is too small
  Clarified some option help messages
sql/opt_range.cc:
  Removed wrong usage of SAFE_MODE (this disabled key usage for UPDATES, which was never the intention)
  Removed print if total cost in a place where it didn't have any usable value
sql/set_var.cc:
  thread_stack -> my_thread_stack
sql/sql_class.cc:
  Intialize transaction object properly
sql/sql_parse.cc:
  thread_stack -> my_thread_stack
sql/sql_select.cc:
  Include my_bit.h
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
sql/sql_show.cc:
  Simplify handling of ha_choice variables
  Added future safe PAGE_CHECKSUM option
  Addid missing 'transactional=#' in information schema
sql/sql_table.cc:
  HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_FORCE_REOPEN when doing reopen
  HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_RENAME when doing rename
  Removed not needed initialization
sql/sql_test.cc:
  thread_stack -> my_thread_stack
sql/sql_yacc.yy:
  Simplify handling of ha_choice variables
  Added future proof create table options TABLE_CHECKSUM=# & PAGE_CHECKSUM=#
sql/table.cc:
  Save page_checksum in .frm
sql/table.h:
  Added variable to hold create table option PAGE_CHECKSUM
sql/unireg.cc:
  Added syncing of directories
storage/myisam/ft_boolean_search.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/ft_eval.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/ft_nlq_search.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/ft_parser.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/ft_stopwords.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/ft_test1.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/ft_update.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/ha_myisam.cc:
  Include my_bit.h
storage/myisam/mi_check.c:
  MI_MAX_POSSIBLE_KEY_BUFF -> HA_MAX_POSSIBLE_KEY_BUFF
  mi_compare_text() -> ha_compare_text()
  Added BLOCK_RECORD to avoid compiler warnings
storage/myisam/mi_checksum.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/mi_create.c:
  MI_MAX_POSSIBLE_KEY -> HA_MAX_POSSIBLE_KEY
  MI_MAX_KEY_BLOCK_SIZE -> HA_MAX_KEY_BLOCK_SIZE
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/mi_dynrec.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/mi_extra.c:
  HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP
storage/myisam/mi_open.c:
  MI_MAX_POSSIBLE_KEY -> HA_MAX_POSSIBLE_KEY
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/mi_packrec.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/mi_range.c:
  mi_compare_text -> ha_compare_text
storage/myisam/mi_test1.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/mi_test2.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/mi_unique.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/mi_write.c:
  mi_compare_text() -> ha_compare_text()
storage/myisam/myisamchk.c:
  Include my_bit.h
storage/myisam/myisamdef.h:
  Moved store_key_length_inc to handler.h
storage/myisam/myisampack.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisam/sp_test.c:
  mi_portable_sizeof_char_ptr -> portable_sizeof_char_ptr
storage/myisammrg/ha_myisammrg.cc:
  HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP
include/my_bit.h:
  New BitKeeper file ``include/my_bit.h''
2007-10-11 18:07:40 +03:00
unknown
ca448acc25 Bug #28702: VIEWs defined with USE/FORCE KEY ignore that request
When storing the VIEW the CREATE VIEW command is reconstructed 
from the parse tree. While constructing the command string
the index hints specified should also be printed.
Fixed by adding code to print the index hints when printing a 
table in the FROM clause.


mysql-test/r/view.result:
  Bug #28702: test case
mysql-test/t/view.test:
  Bug #28702: test case
sql/sql_select.cc:
  Bug #28702: preserve index hints in a VIEW definition.
sql/table.h:
  Bug #28702: preserve index hints in a VIEW definition.
2007-09-24 15:34:10 +03:00
unknown
b86904731f Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community


BitKeeper/triggers/post-commit:
  Auto merged
CMakeLists.txt:
  Auto merged
VC++Files/sql/mysqld.vcproj:
  Auto merged
client/CMakeLists.txt:
  Auto merged
extra/CMakeLists.txt:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
myisam/CMakeLists.txt:
  Auto merged
myisam/mi_open.c:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/information_schema_db.result:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
ndb/src/common/util/File.cpp:
  Auto merged
server-tools/instance-manager/CMakeLists.txt:
  Auto merged
sql/CMakeLists.txt:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/ha_archive.cc:
  Auto merged
sql/ha_berkeley.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/ha_myisammrg.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
win/README:
  Auto merged
win/configure.js:
  Auto merged
configure.in:
  manual merge.  version update.
sql/sql_parse.cc:
  manual merge
2007-09-10 08:06:27 -04:00
unknown
af602784f6 Manual merge of parallel development in separate team trees.
client/mysqldump.c:
  Auto merged
sql/event_db_repository.cc:
  Auto merged
sql/event_queue.cc:
  Auto merged
sql/field.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_handler.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/table.h:
  Auto merged
sql/sql_yacc.yy:
  Manual merge.
2007-08-22 17:13:42 +02:00
unknown
c514373cf3 Fix doxygen warnings.
client/mysqldump.c:
  Fix doxygen warnings
mysys/test_charset.c:
  Fix doxygen warnings
sql/event_db_repository.cc:
  Fix doxygen warnings
sql/events.cc:
  Fix doxygen warnings
sql/events.h:
  Fix doxygen warnings
sql/item_create.cc:
  Fix doxygen warnings, style.
sql/item_create.h:
  Fix coding style.
sql/item_subselect.cc:
  Fix doxygen warnings
sql/lock.cc:
  Fix doxygen warnings
sql/sp.cc:
  Fix doxygen warnings
sql/sp_head.h:
  Fix doxygen warnings
sql/sql_analyse.cc:
  Fix doxygen warnings
sql/sql_analyse.h:
  Fix doxygen warnings
sql/sql_base.cc:
  Fix doxygen warnings
sql/sql_db.cc:
  Fix doxygen warnings
sql/sql_lex.cc:
  Fix doxygen warnings
sql/sql_lex.h:
  Fix doxygen warnings
sql/sql_parse.cc:
  Fix doxygen warnings
sql/sql_plugin.cc:
  Fix doxygen warnings
sql/sql_prepare.cc:
  Fix doxygen warnings
sql/sql_show.cc:
  Fix doxygen warnings
sql/sql_trigger.cc:
  Fix doxygen warnings
sql/sql_update.cc:
  Fix doxygen warnings
sql/table.h:
  Fix doxygen warnings
2007-08-15 17:43:08 +04:00
unknown
c5f0611fad Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1


configure.in:
  Auto merged
client/mysql.cc:
  Auto merged
include/m_ctype.h:
  Auto merged
sql/field.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_string.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
storage/myisam/mi_rkey.c:
  Auto merged
client/mysqldump.c:
  Manual merge (trivial)
scripts/mysql_install_db.sh:
  Complex merge (parital rewrite of new code)
sql/sql_show.cc:
  Manual merge
tests/mysql_client_test.c:
  then
    if ! test -x "$print_defaults"
    then
      missing_in_basedir my_print_defaults
      exit 1
    fi
  else
2007-08-14 00:22:34 +03:00
unknown
09a53f28a7 Fixed a lot of compiler warnings and errors detected by Forte C++ on Solaris
Faster thr_alarm()
Added 'Opened_files' status variable to track calls to my_open()
Don't give warnings when running mysql_install_db
Added option --source-install to mysql_install_db

I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems
index_read()      -> index_read_map()
index_read_idx()  -> index_read_idx_map()
index_read_last() -> index_read_last_map()


BUILD/compile-solaris-sparc-forte:
  Updated script to current Solaris installations
  Now we compile by default for 64 bits
client/mysql.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
client/mysql_upgrade.c:
  Fixed compiler warning (on Forte)
client/mysqladmin.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
client/mysqlcheck.c:
  Fixed compiler warning (on Forte)
client/mysqldump.c:
  Fixed compiler warning (on Forte)
client/mysqlslap.c:
  Fixed compiler warning (on Forte)
client/mysqltest.c:
  Fixed compiler warning (on Forte)
client/sql_string.cc:
  Avoid compiler warnings when using C function pointers in C++
configure.in:
  Added detection of mtmalloc and ieeefp.h
extra/replace.c:
  Fixed compiler warning (on Forte)
include/m_ctype.h:
  Added some typedef's to make it easy to use C function pointers in C++
include/my_sys.h:
  Added my_file_total_opened (counter for calls to my_open())
include/myisam.h:
  Fixed compiler warning (on Forte)
libmysql/libmysql.c:
  Fixed compiler warning (on Forte) by adding casts and change types
libmysql/manager.c:
  Fixed compiler warning (on Forte) by adding casts and change types
mysql-test/r/ctype_cp932_binlog_stm.result:
  Updated positions
  (Needed because we didn't before correctly restore collation_database after running stored procedure
mysys/my_fopen.c:
  Count number of opened files
mysys/my_open.c:
  Count number of opened files
mysys/my_static.c:
  Count number of opened files
mysys/thr_alarm.c:
  Optimization to do less alarm() and pthread_sigmask() calls.
  Idea is to remember time for next pending alarm and not reschedule a new alarm if it's after the current one.
  Before we only did this if there was other pending alarms.
  We don't have to use pthread_sigmask() in case of 'USE_ONE_SIGNAL_HAND' as the alarm()
  signal will be blocked for the calling thread anyway and no other thread will have the alarm() signal enabled to call process_alarm()
regex/regcomp.c:
  Fixed compiler warning (on Forte) by adding casts and change types
scripts/mysql_install_db.sh:
  Added option --source-install to allow one to create a mysql database from the source tree without installing MySQL
  Don't give (unnecessary) warnings
server-tools/instance-manager/angel.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
server-tools/instance-manager/thread_registry.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/event_db_repository.cc:
  index_read() -> index_read_map()
sql/event_queue.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/field.cc:
  Fixed compiler warnings about hidden fields
sql/ha_partition.cc:
  Fixed compiler warnings about hidden fields
  index_read() -> index_read_map()
sql/ha_partition.h:
  index_read() -> index_read_map()
sql/handler.cc:
  Added PAGE option to row types (to prepare for future)
  index_read() -> index_read_map()
sql/handler.h:
  Added ROW_TYPE_PAGE (for future)
  Added flag to signal if table was to be created transactionally
  I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems
  index_read()      -> index_read_map()
  index_read_idx()  -> index_read_idx_map()
  index_read_last() -> index_read_last_map()
sql/item.cc:
  Fixed indentation
  Renamed local variable to avoid hiding class variable
sql/item_cmpfunc.cc:
  Renamed local variable to avoid hiding class variable
sql/item_cmpfunc.h:
  Removed not used variable
sql/item_func.cc:
  Renamed local variable to avoid hiding class variable
sql/item_strfunc.cc:
  Moved functions from Item_strfunc.cc
sql/item_strfunc.h:
  Move functions to item_strfunc.cc
  Use C function pointer type to avoid compiler warnings (with Forte)
sql/item_subselect.cc:
  index_read() -> index_read_map()
sql/item_xmlfunc.cc:
  Renamed local variable to avoid hiding class variable
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/key.cc:
  Fixed indentation
sql/log.cc:
  Renamed local variable to avoid hiding class variable
sql/log_event.cc:
  Removed call to my_time() when creating class instance of Log_event() as this may have static instances.
  (One can't call my_time() before my_init())
  index_read() -> index_read_map()
  Renamed local variable to avoid hiding class variable
sql/log_event_old.cc:
  Renamed local variable to avoid hiding class variable
sql/mysql_priv.h:
  Made all create_backup_ctx() declarations identical.
  This lifted up a bug where wrong create_backup_ctx() was called in some cases.
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/mysqld.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
  Fixed indentation
  Don't call end_thr_alarm() when calling unireg_abort() as unireg_abort() already calls end_thr_alarm()
  Added variable 'Opened_files' (number of calls to my_open() or my_fopen())
  Don't print 'loose' warnings when using --bootstrap (to avoid warnings when running mysql_install_db)
  Fixed compiler warnings
sql/opt_range.cc:
  index_read() -> index_read_map()
sql/opt_sum.cc:
  index_read() -> index_read_map()
sql/partition_info.cc:
  Renamed local variable to avoid hiding class variable
sql/rpl_filter.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/set_var.cc:
  Renamed local variable to avoid hiding class variable
  Added 'process_key_cache_t' type to avoid compiler warning (on Forte)
sql/set_var.h:
  Added 'process_key_cache_t' type to avoid compiler warning (on Forte)
sql/sp.cc:
  More debugging
  index_read() -> index_read_map()
sql/sp_cache.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/sp_head.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
  Moved 'saved_creation_ctx' higher up to be able to free objects allocated by create_backup_ctx()
sql/sql_acl.cc:
  index_read() -> index_read_map()
sql/sql_class.cc:
  Renamed local variable to avoid hiding class variable
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/sql_class.h:
  Renamed local variable to avoid hiding class variable
sql/sql_db.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/sql_delete.cc:
  Renamed local variable to avoid hiding class variable
sql/sql_handler.cc:
  index_read() -> index_read_map()
sql/sql_help.cc:
  index_read() -> index_read_map()
sql/sql_insert.cc:
  index_read() -> index_read_map()
  Renamed local variable to avoid hiding class variable
sql/sql_lex.cc:
  Renamed local variable to avoid hiding class variable
sql/sql_plugin.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
  index_read() -> index_read_map()
  Don't give warnings about not used plugins if we are using --warnings=0
sql/sql_select.cc:
  index_read() -> index_read_map()
sql-common/client.c:
  Fixed compiler warning (on Forte)
sql-common/my_time.c:
  Removed never accessed code
  Fixed compiler warning (on Forte)
sql/sql_servers.cc:
  index_read() -> index_read_map()
sql/sql_show.cc:
  Added TRANSACTIONAL to SHOW CREATE
  Fixed ROW_TYPE_PAGE
sql/sql_string.cc:
  Avoid compiler warnings when using C function pointers in C++
sql/sql_table.cc:
  Set create_info->transactional if we used TRANSACTIONAL=1
sql/sql_udf.cc:
  index_read() -> index_read_map()
sql/sql_yacc.yy:
  Added TRANSACTIONAL=0|1 to CREATE (for future)
  Added row type PAGE (was only partionally handled before)
sql/strfunc.cc:
  Avoid compiler warnings when using C function pointers in C++
sql/table.cc:
  More DBUG statements
  Declare all create_backup_ctx() functions identically
  Remember if table was created with TRANSACTIONAL flag or not (future safe)
  Renamed local variable to avoid hiding class variable
sql/table.h:
  Remember if table was created with TRANSACTIONAL=1
sql/tztime.cc:
  index_read() -> index_read_map()
sql-common/pack.c:
  Fixed compiler warning (on Forte)
storage/archive/archive_reader.c:
  Fixed compiler warning (on Forte)
storage/archive/azio.c:
  Fixed compiler warning (on Forte)
storage/blackhole/ha_blackhole.cc:
  index_read() -> index_read_map()
storage/blackhole/ha_blackhole.h:
  index_read() -> index_read_map()
storage/csv/ha_tina.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
storage/example/ha_example.cc:
  index_read() -> index_read_map()
storage/example/ha_example.h:
  index_read() -> index_read_map()
storage/heap/ha_heap.cc:
  index_read() -> index_read_map()
storage/heap/ha_heap.h:
  index_read() -> index_read_map()
storage/heap/hp_test1.c:
  Fixed compiler warning (on Forte)
storage/heap/hp_test2.c:
  Fixed compiler warning (on Forte)
storage/myisam/ft_boolean_search.c:
  Fixed compiler warning (on Forte)
storage/myisam/ft_nlq_search.c:
  Fixed compiler warning (on Forte)
storage/myisam/ft_parser.c:
  Fixed compiler warning (on Forte)
storage/myisam/ft_stopwords.c:
  Fixed compiler warning (on Forte)
storage/myisam/ha_myisam.cc:
  index_read() -> index_read_map()
storage/myisam/ha_myisam.h:
  index_read() -> index_read_map()
storage/myisam/mi_check.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_delete.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_dynrec.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_extra.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_key.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_keycache.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_locking.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_log.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_open.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_packrec.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_page.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_rkey.c:
  Added comment
storage/myisam/mi_search.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_statrec.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_test1.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_test2.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_test3.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_update.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_write.c:
  Fixed compiler warning (on Forte)
storage/myisam/myisamdef.h:
  Fixed that file_read/file_write returns type size_t
  Changed some functions to use uchar * as argument/return value instead of char*
  This fixed some compiler warnings on Forte
storage/myisam/myisamlog.c:
  Fixed compiler warning (on Forte)
storage/myisam/myisampack.c:
  Fixed compiler warning (on Forte)
storage/myisam/rt_test.c:
  Fixed compiler warning (on Forte)
storage/myisam/sort.c:
  Fixed compiler warning (on Forte) by adding casts or changing variables to uchar*
storage/myisam/sp_test.c:
  Fixed compiler warning (on Forte) by adding casts or changing variables to uchar*
storage/myisammrg/ha_myisammrg.cc:
  index_read() -> index_read_map()
storage/myisammrg/ha_myisammrg.h:
  index_read() -> index_read_map()
storage/myisammrg/myrg_create.c:
  Fixed compiler warning (on Forte) by adding casts or changing variable types
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
  Tdummy -> align  (as in other part of cluster code)
storage/ndb/src/kernel/vm/DynArr256.cpp:
  Removed not used variable
storage/ndb/src/ndbapi/Ndb.cpp:
  Removed not used variable
strings/strtod.c:
  Include ieeefp.h to avoid compiler warning
tests/bug25714.c:
  Fixed compiler warning
tests/mysql_client_test.c:
  Remove not used variable
  Fixed indentation
  Removed never reached code
  Fixed compiler warning (on Forte) by adding casts or changing variable types
vio/viosocket.c:
  Fixed compiler warning (on Forte) by adding casts or changing variable types
2007-08-13 16:11:25 +03:00
unknown
82d28fada7 WL#3732 Information schema optimization
client/mysqldump.c:
  table type compare is changed to case insensitive
mysql-test/r/information_schema.result:
  test result
mysql-test/r/information_schema_db.result:
  result fix
mysql-test/suite/ndb/r/ndb_alter_table.result:
  result fix
mysql-test/suite/ndb/r/ndb_temporary.result:
  result fix
mysql-test/t/information_schema.test:
  test case
sql/ha_ndbcluster.cc:
  char* variables are changed to LEX_STRING
sql/ha_ndbcluster.h:
  char* variables are changed to LEX_STRING
sql/ha_ndbcluster_binlog.cc:
  char* variables are changed to LEX_STRING
sql/handler.cc:
  char* variables are changed to LEX_STRING
sql/handler.h:
  char* variables are changed to LEX_STRING
sql/sql_base.cc:
  Modified functions which are used during open table process
  according to table opening method and requested_object.
sql/sql_select.cc:
  Add support for I_S tables into select_describe() function
sql/sql_show.cc:
  1. Added initialization of 'open_method' to 'st_field_info' structs.
  2. Added initialization of 'i_s_requested_object' to 'ST_SCHEMA_TABLE' structs.
  3. New function which calculates database name and table name values 
     from 'where' condition if it's possible
     void get_lookup_field_values(THD *thd, COND *cond, TABLE_LIST *table,
                                  LOOKUP_FIELD_VALUES *lookup_field_vals);
  4. New function which set table open method
     setup_table_open_method(TABLE_LIST *tables,
                             ST_SCHEMA_TABLE *schema_table,
                             enum enum_schema_tables schema_table_idx)
  5. New function
     int make_db_list(THD *thd, List<LEX_STRING> *files,
                      LOOKUP_FIELD_VALUES *lookup_field_vals,
                      bool *with_i_schema)
  6. New function
     int make_table_name_list(THD *thd, List<LEX_STRING> *files, LEX *lex,
                              LOOKUP_FIELD_VALUES *lookup_field_vals,
                              bool with_i_schema, LEX_STRING *db_name)
  7. Modified 'get_all_tables' function according to new schema(see wl#3732).
sql/sql_show.h:
  char* variables are changed to LEX_STRING
sql/table.cc:
  Modified functions which are used during open table process
  according to table opening method and requested_object.
sql/table.h:
  1. added new constants(open_method)
  #define SKIP_OPEN_TABLE 0
  #define OPEN_FRM_ONLY   1
  #define OPEN_FULL_TABLE 2
      
  2. Added new field 'open_method' into struct st_field_info;
     uint open_method;
      
  3. Added new field into ST_SCHEMA_TABLE struct
     uint i_s_requested_object;  /* the object we need to open(TABLE | VIEW) */.
  4. Added new field to TABLE_LIST struct.
     uint i_s_requested_object;
     This field is set from ST_SCHEMA_TABLE.i_s_requested_object
     for processed table before opening.
      
  5. Added new fields to TABLE_LIST struct, used for 'explain select' for I_S table
     bool has_db_lookup_value;
     bool has_table_lookup_value;
     uint table_open_method;
sql/unireg.h:
  added new constants
2007-08-03 03:14:05 +05:00
unknown
2914bad6ac Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime


client/mysqldump.c:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
sql/handler.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
mysql-test/include/mix1.inc:
  Manual merge.
mysql-test/r/innodb_mysql.result:
  Manual merge.
2007-07-31 23:47:38 +04:00
unknown
5114cb91e5 Merge kpettersson@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime


sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
2007-07-29 13:08:21 +02:00
unknown
a16919e473 Merge adventure.(none):/home/thek/Development/cpp/bug29929/my50-bug29929
into  adventure.(none):/home/thek/Development/cpp/bug29929/my51-bug29929


mysql-test/r/sp-prelocking.result:
  Auto merged
mysql-test/t/sp-prelocking.test:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  SCCS merged
2007-07-27 16:59:09 +02:00
unknown
07955aea2d Bug #29929 LOCK TABLES does not pre-lock tables used in triggers of the locked tables
When a table was explicitly locked with LOCK TABLES no associated
tables from any related trigger on the subject table were locked.
As a result of this the user could experience unexpected locking
behavior and statement failures similar to "failed: 1100: Table'xx'
was not locked with LOCK TABLES".

This patch fixes this problem by making sure triggers are
pre-loaded on any statement if the subject table was explicitly
locked with LOCK TABLES.


mysql-test/r/sp-prelocking.result:
  Added test case
mysql-test/t/sp-prelocking.test:
  Added test case
sql/sql_lex.cc:
  - Moved some conditional logic out of the table iteration.
  - Added event map values for LOCK TABLE command.
sql/table.cc:
  - Refactored set_trg_event_tpye into the two simpler functions set_trg_event_map
    and set_trg_event_map as methods for manipulating the table event map.
    The original function was only called from st_lex::set_trg_event_type_for_tables
    so it was possible to move the event map creation logic to this function as
    a loop optimization.
sql/table.h:
  - Refactored set_trg_event_tpye into the two simpler functions set_trg_event_map
    and set_trg_event_map as methods for manipulating the table event map.
    The original function was only called from st_lex::set_trg_event_type_for_tables
    so it was possible to move the event map creation logic to this function as
    a loop optimization.
2007-07-27 16:56:29 +02:00
unknown
4462578a1c WL#3984 (Revise locking of mysql.general_log and mysql.slow_log)
Bug#25422 (Hang with log tables)
Bug 17876 (Truncating mysql.slow_log in a SP after using cursor locks the
          thread)
Bug 23044 (Warnings on flush of a log table)
Bug 29129 (Resetting general_log while the GLOBAL READ LOCK is set causes
           a deadlock)

Prior to this fix, the server would hang when performing concurrent
ALTER TABLE or TRUNCATE TABLE statements against the LOG TABLES,
which are mysql.general_log and mysql.slow_log.

The root cause traces to the following code:
in sql_base.cc, open_table()
  if (table->in_use != thd)
  {
    /* wait_for_condition will unlock LOCK_open for us */
    wait_for_condition(thd, &LOCK_open, &COND_refresh);
  }
The problem with this code is that the current implementation of the
LOGGER creates 'fake' THD objects, like
- Log_to_csv_event_handler::general_log_thd
- Log_to_csv_event_handler::slow_log_thd
which are not associated to a real thread running in the server,
so that waiting for these non-existing threads to release table locks
cause the dead lock.

In general, the design of Log_to_csv_event_handler does not fit into the
general architecture of the server, so that the concept of general_log_thd
and slow_log_thd has to be abandoned:
- this implementation does not work with table locking
- it will not work with commands like SHOW PROCESSLIST
- having the log tables always opened does not integrate well with DDL
operations / FLUSH TABLES / SET GLOBAL READ_ONLY

With this patch, the fundamental design of the LOGGER has been changed to:
- always open and close a log table when writing a log
- remove totally the usage of fake THD objects
- clarify how locking of log tables is implemented in general.

See WL#3984 for details related to the new locking design.

Additional changes (misc bugs exposed and fixed):

1)

mysqldump which would ignore some tables in dump_all_tables_in_db(),
 but forget to ignore the same in dump_all_views_in_db().

2)

mysqldump would also issue an empty "LOCK TABLE" command when all the tables
to lock are to be ignored (numrows == 0), instead of not issuing the query.

3)

Internal errors handlers could intercept errors but not warnings
(see sql_error.cc).

4)

Implementing a nested call to open tables, for the performance schema tables,
exposed an existing bug in remove_table_from_cache(), which would perform:
  in_use->some_tables_deleted=1;
against another thread, without any consideration about thread locking.
This call inside remove_table_from_cache() was not required anyway,
since calling mysql_lock_abort() takes care of aborting -- cleanly -- threads
that might hold a lock on a table.
This line (in_use->some_tables_deleted=1) has been removed.


sql/handler.cc:
  Moved logic for system / log tables in the SQL layer.
sql/handler.h:
  Moved logic for system / log tables in the SQL layer.
sql/lock.cc:
  Revised locking of log tables
sql/log.cc:
  Major cleanup: changed how log tables are locked / written to.
sql/log.h:
  Major cleanup: changed how log tables are locked / written to.
sql/mysql_priv.h:
  performance schema helpers
sql/slave.cc:
  open_ltable() lock flags
sql/sp.cc:
  open_ltable() lock flags
sql/sql_acl.cc:
  open_ltable() lock flags
sql/sql_class.h:
  performance schema helpers
sql/sql_delete.cc:
  log tables cleanup in TRUNCATE
sql/sql_error.cc:
  Internal handlers can also intercept warnings
sql/sql_insert.cc:
  open_ltable() lock flags
sql/sql_parse.cc:
  performance schema helpers
sql/sql_plugin.cc:
  open_ltable() lock flags
sql/sql_rename.cc:
  log tables cleanup in RENAME
sql/sql_servers.cc:
  open_ltable() lock flags
sql/sql_show.cc:
  Move INFORMATION_SCHEMA_NAME to table.cc
sql/sql_table.cc:
  log tables cleanup (admin operations, ALTER TABLE)
sql/sql_udf.cc:
  open_ltable() lock flags
sql/table.cc:
  Implemented TABLE_CATEGORY.
sql/share/errmsg.txt:
  Changed the wording and name of ER_CANT_READ_LOCK_LOG_TABLE
sql/table.h:
  Implemented TABLE_CATEGORY.
storage/csv/ha_tina.cc:
  Moved logic for system / log tables in the SQL layer.
storage/csv/ha_tina.h:
  Moved logic for system / log tables in the SQL layer.
storage/myisam/ha_myisam.cc:
  Moved logic for system / log tables in the SQL layer.
storage/myisam/ha_myisam.h:
  Moved logic for system / log tables in the SQL layer.
client/mysqldump.c:
  Don't lock tables in the ignore list.
  Don't issue empty LOCK TABLES queries.
sql/sql_base.cc:
  log tables cleanup
  performance schema helpers
mysql-test/r/ps.result:
  Adjust test results
mysql-test/r/show_check.result:
  Adjust test results
mysql-test/r/status.result:
  Adjust test results
mysql-test/t/log_state.test:
  Added tests for Bug#29129
mysql-test/t/ps.test:
  Make the test output deterministic
mysql-test/t/show_check.test:
  Make the test output deterministic
mysql-test/r/log_state.result:
  Changed the default location of the log output to LOG_FILE,
  for backward compatibility with MySQL 5.0
  ---
  Adjust test results
mysql-test/r/log_tables.result:
  cleanup for -ps-protocol
mysql-test/t/log_tables.test:
  cleanup for -ps-protocol
sql/set_var.cc:
  Changed the default location of the log output to LOG_FILE,
  for backward compatibility with MySQL 5.0
  ---
  log tables cleanup
2007-07-27 00:31:06 -06:00
unknown
54c9742922 coding style fix : Index_hint 2007-07-23 19:09:48 +03:00
unknown
bc642e1132 Post-merge fixes (merge from the main).
mysql-test/r/innodb_mysql.result:
  Update test results (merge from the main tree).
mysql-test/r/query_cache.result:
  Update test results (merge from the main tree).
mysql-test/r/sp.result:
  Update test results (merge from the main tree).
mysql-test/t/query_cache.test:
  Use --echo End of to simplify future merges.
sql/handler.h:
  st_table_list -> TABLE_LIST
sql/item_create.cc:
  A post-merge fix (this code is in sql_yacc.yy in 5.0)
sql/rpl_utility.h:
  st_table_list -> TABLE_LIST
sql/sp.cc:
  A post-merge fix.
sql/sp_head.cc:
  In 5.1 memdup_root returns void*.
sql/sql_show.cc:
  st_table_list -> TABLE_LIST
sql/sql_show.h:
  st_table_list -> TABLE_LIST
sql/sql_yacc.yy:
  A post-merge fix.
sql/table.cc:
  st_table_list -> TABLE_LIST
sql/table.h:
  st_table_list -> TABLE_LIST
2007-07-17 00:59:21 +04:00
unknown
9562c54a5c Merge bodhi.(none):/opt/local/work/mysql-5.0-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime


mysql-test/r/trigger.result:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_trigger.h:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.cc:
  Auto merged
storage/myisam/ha_myisam.h:
  Auto merged
mysql-test/include/mix1.inc:
  Manual merge.
mysql-test/r/information_schema.result:
  Manual merge.
mysql-test/r/innodb_mysql.result:
  Manual merge.
mysql-test/r/query_cache.result:
  Manual merge.
mysql-test/r/sp.result:
  Manual merge.
mysql-test/t/information_schema.test:
  Manual merge.
sql/handler.h:
  Manual merge.
sql/sp.cc:
  Manual merge.
sql/sp_head.cc:
  Manual merge.
sql/sql_prepare.cc:
  Manual merge.
sql/sql_trigger.cc:
  Manual merge.
sql/sql_yacc.yy:
  Manual merge.
sql/table.h:
  Manual merge.
storage/myisam/ha_myisam.cc:
  Manual merge.
2007-07-16 23:31:36 +04:00
unknown
9dc3088f9e A fix and a test case for Bug#26141 mixing table types in trigger
causes full table lock on innodb table.
Also fixes Bug#28502 Triggers that update another innodb table 
will block on X lock unnecessarily (duplciate).
Code review fixes.

Both bugs' synopses are misleading: InnoDB table is
not X locked. The statements, however, cannot proceed concurrently, 
but this happens due to lock conflicts for tables used in triggers,
not for the InnoDB table. 

If a user had an InnoDB table, and two triggers, AFTER UPDATE and 
AFTER INSERT, competing for different resources (e.g. two distinct
MyISAM tables), then these two triggers would not be able to execute
concurrently. Moreover, INSERTS/UPDATES of the InnoDB table would
not be able to run concurrently. 
The problem had other side-effects (see respective bug reports).

This behavior was a consequence of a shortcoming of the pre-locking
algorithm, which would not distinguish between different DML operations
(e.g. INSERT and DELETE) and pre-lock all the tables
that are used by any trigger defined on the subject table.

The idea of the fix is to extend the pre-locking algorithm to keep track,
for each table, what DML operation it is used for and not
load triggers that are known to never be fired.


mysql-test/r/trigger-trans.result:
  Update results (Bug#26141)
mysql-test/r/trigger.result:
  Update results (Bug#28502)
mysql-test/t/trigger-trans.test:
  Add a test case for Bug#26141 mixing table types in trigger causes 
  full table lock on innodb table.
mysql-test/t/trigger.test:
  Add a test case for Bug#28502 Triggers that update another innodb 
  table will block echo on X lock unnecessarily. Add more test 
  coverage for triggers.
sql/item.h:
  enum trg_event_type is needed in table.h
sql/sp.cc:
  Take into account table_list->trg_event_map when determining
  what tables to pre-lock. 
  
  After this change, if we attempt to fire a 
  trigger for which we had not pre-locked any tables, error
  'Table was not locked with LOCK TABLES' will be printed.
  This, however, should never happen, provided the pre-locking
  algorithm has no programming bugs.
  
  Previously a trigger key in the sroutines hash was based on the name 
  of the table the trigger belongs to. This was possible because we would
  always add to the pre-locking list all the triggers defined for a table when
  handling this table.
  Now the key is based on the name of the trigger, owing
  to the fact that a trigger name must be unique in the database it
  belongs to.
sql/sp_head.cc:
  Generate sroutines hash key in init_spname(). This is a convenient
  place since there we have all the necessary information and can
  avoid an extra alloc.
  
  Maintain and merge trg_event_map when adding and merging elements
  of the pre-locking list.
sql/sp_head.h:
  Add ,m_sroutines_key member, used when inserting the sphead for a
  trigger into the cache of routines used by a statement.
  Previously the key was based on the table name the trigger belonged
  to, since for a given table we would add to the sroutines list
  all the triggers defined on it.
sql/sql_lex.cc:
  Introduce a new lex step: set_trg_event_type_for_tables().
  It is called when we have finished parsing but before opening
  and locking tables. Now this step is used to evaluate for each
  TABLE_LIST instance which INSERT/UPDATE/DELETE operation, if any,
  it is used in.
  In future this method could be extended to aggregate other information
  that is hard to aggregate during parsing.
sql/sql_lex.h:
  Add declaration for set_trg_event_type_for_tables().
sql/sql_parse.cc:
  Call set_trg_event_type_for_tables() after MYSQLparse(). Remove tabs.
sql/sql_prepare.cc:
  Call set_trg_event_type_for_tables() after  MYSQLparse().
sql/sql_trigger.cc:
  Call set_trg_event_type_for_tables() after MYSQLparse().
sql/sql_trigger.h:
  Remove an obsolete member.
sql/sql_view.cc:
  Call set_trg_event_type_for_tables() after MYSQLparse().
sql/sql_yacc.yy:
  Move assignment of sp_head::m_type before calling sp_head::init_spname(), 
  one is now used inside another.
sql/table.cc:
  Implement TABLE_LIST::set_trg_event_map() - a method that calculates
  wh triggers may be fired on this table when executing a statement.
sql/table.h:
  Add missing declarations.
  Move declaration of trg_event_type from item.h (it will be needed for 
  trg_event_map bitmap when we start using Bitmap template instead
  of uint8).
2007-07-12 22:26:41 +04:00
unknown
360a5ebc37 Remove typedef st_table_list TABLE_LIST and always use name 'TABLE_LIST'.
The need arose when working on Bug 26141, where it became
necessary to replace TABLE_LIST with its forward declaration in a few
headers, and this involved a lot of s/TABLE_LIST/st_table_list/.
Although other workarounds exist, this patch is in line
with our general strategy of moving away from typedef-ed names.
Sometime in future we might also rename TABLE_LIST to follow the
coding style, but this is a huge change.


sql/item.cc:
  st_table_list -> TABLE_LIST
sql/item.h:
  st_table_list -> TABLE_LIST
sql/mysql_priv.h:
  st_table_list -> TABLE_LIST
sql/sql_base.cc:
  st_table_list -> TABLE_LIST
sql/sql_lex.cc:
  st_table_list -> TABLE_LIST
sql/sql_lex.h:
  st_table_list -> TABLE_LIST
sql/sql_select.cc:
  st_table_list -> TABLE_LIST
sql/sql_show.cc:
  st_table_list -> TABLE_LIST
sql/sql_udf.h:
  Was not needed.
sql/table.cc:
  st_table_list -> TABLE_LIST
sql/table.h:
  st_table_list -> TABLE_LIST
2007-07-06 16:18:49 +04:00
unknown
9c1671267a Merge mysqldev@production.mysql.com:my/mysql-5.0-release
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community


BitKeeper/triggers/post-commit:
  Auto merged
client/CMakeLists.txt:
  Auto merged
extra/CMakeLists.txt:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
myisam/CMakeLists.txt:
  Auto merged
mysql-test/r/func_in.result:
  Auto merged
mysql-test/r/information_schema_db.result:
  Auto merged
mysql-test/t/func_in.test:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
server-tools/instance-manager/CMakeLists.txt:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/ha_archive.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/structs.h:
  Auto merged
sql/table.h:
  Auto merged
support-files/mysql.spec.sh:
  Auto merged
win/Makefile.am:
  Auto merged
win/README:
  Auto merged
win/configure.js:
  Auto merged
CMakeLists.txt:
  manual merge.
configure.in:
  manual merge.
mysql-test/r/information_schema.result:
  manual merge.
sql/CMakeLists.txt:
  manual merge.
sql/set_var.cc:
  manual merge.
sql/sql_parse.cc:
  manual merge.
sql/sql_select.cc:
  manual merge.
2007-07-02 10:46:46 -04:00
unknown
358b942b20 Unify profiling SHOW code and INFORMATION_SCHEMA code for
profiling.  Also,

Bug#26938: profiling client hang if used before enabled

In the SHOW command, not sending header data because we had no 
rows to send was a protocol violation.  Porting the SHOW PROFILE
command to use the Information Schema table avoids that problem.


mysql-test/r/profiling.result:
  Add headers of pre-profile SHOW test.
mysql-test/t/profiling.test:
  Verify that the protocol isn't violated if we ask for profiling 
  info before profiling has recorded anything.
sql/sql_parse.cc:
  Remove SQLCOM_SHOW_PROFILE and add a I_S schema table entry.
sql/sql_profile.cc:
  Add SHOW column-names and a new function that takes profile options
  set in the parser and packs a list of selected fields from the 
  I_S table implementation.
sql/sql_profile.h:
  Remove unused functions and add a new function.
sql/sql_show.cc:
  Add a pointer to the function that selects fields from I_S table
  for SHOW command.
sql/sql_yacc.yy:
  Prepare an I_S table for SHOW PROFILE.
sql/table.h:
  Rename to match the intention.
2007-07-02 07:27:39 -04:00