Commit graph

11 commits

Author SHA1 Message Date
unknown
abbb201661 Post-review fixes for
Bug #18559 "log tables cannot change engine, and
            gets deadlocked when dropping w/ log on":
1) Add more generic error messages
2) Add new handlerton flag for engines, which support
   log tables
3) Remove (log-tables related) mutex lock in myisam to
   improve performance


mysql-test/r/log_tables.result:
  update result file to use new error messages
mysql-test/t/log_tables.test:
  update test file with new error messages
sql/handler.h:
  Add new handlerton flag, to mark whether engine
  supports log tables
sql/share/errmsg.txt:
  Add more generic error messages
sql/sql_table.cc:
  Update error messages
storage/csv/ha_tina.cc:
  CSV supports log tables
storage/myisam/ha_myisam.cc:
  MyISAM supports log tables
storage/myisam/mi_write.c:
  remove mutex lock to improve performance
2006-09-15 13:07:23 +04:00
unknown
1363c9b215 Fixed warning message breakage.
Fixed install breakage (my own fault)
Edited exampled cnf to remove bdb references. 


mysql-test/r/backup.result:
  fix warnings
mysql-test/r/im_options.result:
  Remove missed bdb skip
mysql-test/r/im_utils.result:
  Remove missed bdb-skip
mysql-test/r/log_tables.result:
  Fix warnings
mysql-test/r/show_check.result:
  Fix warnings
mysql-test/r/sp_trans.result:
  Fix warning
mysql-test/r/type_timestamp.result:
  Fix warning
mysql-test/r/warnings.result:
  Fix warning
mysql-test/t/disabled.def:
  Disabled Federation test
mysql-test/t/federated_transactions.test:
  Fixed comments in federation test
netware/mysql_install_db.c:
  Fix install breakage.
netware/mysql_test_run.c:
  Fix install breakage.
scripts/mysql_install_db.sh:
  Fix install breakage
storage/myisam/ftbench/ft-test-run.sh:
  Fixed test which is never run
support-files/my-innodb-heavy-4G.cnf.sh:
  Modified examples
support-files/my-small.cnf.sh:
  Modified examples
2006-08-13 22:28:41 -07:00
unknown
79b03c66bf Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/home/cps/mysql/devel/5.1-curs-bug


sql/ha_myisam.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/sql_table.cc:
  Auto merged
mysql-test/r/log_tables.result:
  SCCS merged
mysql-test/t/log_tables.test:
  SCCS merged
2006-08-04 14:48:51 +04:00
unknown
157c42de97 Fix Bug #18559 "log tables cannot change engine, and
gets deadlocked when dropping w/ log on"

Log tables rely on concurrent insert machinery to add data.
This means that log tables are always opened and locked by
special (artificial) logger threads. Because of this, the thread
which tries to drop a log table starts to wait for the table
to be unlocked. Which will happen only if the log table is disabled.
Alike situation happens if one tries to alter a log table.
However in addition to the problem above, alter table calls
check_if_locking_is_allowed() routine for the engine. The
routine does not allow alter for the log tables. So, alter
doesn't start waiting forever for logs to be disabled, but 
returns with an error.
Another problem is that not all engines could be used for
the log tables. That's because they need concurrent insert.

In this patch we:
(1) Explicitly disallow to drop/alter a log table if it
    is currently used by the logger.
(2) Update MyISAM to support log tables
(3) Allow to drop log tables/alter log tables if log is
    disabled
At the same time we (4) Disallow to alter log tables to
unsupported engine (after this patch CSV and MyISAM are 
alowed)
Recommit with review fixes.


mysql-test/r/log_tables.result:
  Update result file.
  Note: there are warnings in result file. This is because of CSV
  bug (Bug #21328). They should go away after it is fixed.
mysql-test/t/log_tables.test:
  Add a test for the bug
sql/ha_myisam.cc:
  Add log table handling to myisam: as log tables
  use concurrent insert, they are typically
  locked with TL_CONCURRERENT_INSERT lock. So,
  disallow other threads to attempt locking of
  the log tables in incompatible modes. Because
  otherwise the threads will wait for the tables
  to be unlocked forever.
sql/handler.cc:
  Add a function to check if a table we're going to lock
  is a log table and if the lock mode we want allowed
sql/handler.h:
  Add a new function to check compatibility of the locking
sql/log.cc:
  we shouldn't close the log table if and only
  if this particular table is already closed
sql/log.h:
  add new functions to check if a log is enabled
sql/share/errmsg.txt:
  add new error messages
sql/sql_table.cc:
  DROP and ALTER TABLE should not work on log
  tables if the log tables are enabled
storage/csv/ha_tina.cc:
  move function to check if the locking for the log
  tables allowed to handler class, so that we can
  reuse it in other engines.
storage/myisam/mi_extra.c:
  add new ::extra() flag processing to myisam
storage/myisam/mi_open.c:
  init log table flag
storage/myisam/mi_write.c:
  update status after each write if it's a log table
storage/myisam/myisamdef.h:
  Add new log table flag to myisam share.
  We need it to distinguish between usual
  and log tables, as for the log tables we
  should provide concurrent insert in a
  different way than for usual tables: we
  want new rows to be immediately visible
  to other threads.
2006-08-03 21:28:15 +04:00
unknown
e1ec4de43f Fix Bug #20139 Infinite loop after "FLUSH" and "LOCK tabX, general_log"
Due to incorrect handling of FLUSH TABLES, log tables were marked for flush,
but not reopened. Later we started to wait for the log table to be closed
(disabled) after the flush. And as nobody disabled logs in concurrent treads,
the command lasted forever.
After internal consultations it was decided to skip logs during FLUSH TABLES.
The reasoning is that logging is done in the "log device", whatever it is
which is always active and controlled by FLUSH LOGS. So, to flush logs
one should use FLUSH LOGS, and not FLUSH TABLES.


mysql-test/r/log_tables.result:
  update result file
mysql-test/t/log_tables.test:
  add a test for the bug
sql/sql_base.cc:
  Skip log tables during FLUSH TABLES
2006-08-03 17:23:37 +04:00
unknown
041171fd81 Merge bk-internal:/home/bk/mysql-5.1-new
into  mysql.com:/home/jimw/my/mysql-5.1-clean


mysql-test/r/log_tables.result:
  Merge conflict
mysql-test/t/log_tables.test:
  Merge conflict
2006-05-23 09:49:04 -07:00
unknown
749f183265 update log_tables.test so it is less fragile
mysql-test/r/log_tables.result:
  update result so test is less fragile
mysql-test/t/log_tables.test:
  update test so it is less fragile
2006-05-23 15:01:23 +02:00
unknown
5b2cade4fa Bug #20004: log_tables fails on Windows due to output differences
This test included hostname information in the output, which varies
  between platforms.


mysql-test/r/log_tables.result:
  Update results
mysql-test/t/log_tables.test:
  Replace user_host selected from logs to avoid platform differences.
  Also, fix use of replace_column in test for bug 17600.
2006-05-22 11:34:41 -07:00
unknown
5fd44f2cc6 Fix Bug#17600: Invalid data logged into mysql.slow_log
Recommit with post-review fixes.


mysql-test/r/log_tables.result:
  update result
mysql-test/t/log_tables.test:
  add a test
sql/log.cc:
  Fix NULL handling in log tables
storage/csv/ha_tina.cc:
   Explicitly check fo NULLs, when writing a row.
   We should not hope, that the null field was
   cleaned up.
   Though usually we do call Field::reset() or
   restore_row(), before calling Field::set_null(),
   this depency is neither documented nor enforced
   by other means.
mysql-test/t/log_tables-master.opt:
  New BitKeeper file ``mysql-test/t/log_tables-master.opt''
2006-03-06 21:03:17 +03:00
unknown
c0b31dc2f0 Fix for Bug#16905 Log tables: unicode statements are logged incorrectly
mysql-test/r/log_tables.result:
  update result
mysql-test/t/log_tables.test:
  add a testcase
sql/log.cc:
  take into account client charset info, while logging
  into a table.
sql/log.h:
  pass the charset info along with the log messages
  to log them correctly
2006-02-03 13:05:14 +03:00
unknown
41536fcefe WL1019: complete patch. Reapplied patch to the clean
tree to get rid of multiple typos in CS comments and
unify the patch.


configure.in:
  CSV is compiled in by default now
include/my_base.h:
  add new ha_extra flag for the log tables
mysql-test/include/im_check_os.inc:
  we should only run im tests if csv is on for now: im relies
  on mysqld options available only in csv build.
mysql-test/include/system_db_struct.inc:
  check log tables structure
mysql-test/lib/init_db.sql:
  create log tables when running tests.
mysql-test/mysql-test-run.pl:
  Add old logs flag to IM tests. As IM could only deal with
  old logs (this feature is not needed with log tables)
mysql-test/r/connect.result:
  update result
mysql-test/r/csv.result:
  update result
mysql-test/r/im_utils.result:
  update result
mysql-test/r/information_schema.result:
  update result
mysql-test/r/mysqlcheck.result:
  update result
mysql-test/r/show_check.result:
  update result
mysql-test/r/system_mysql_db.result:
  update result
mysql-test/t/connect.test:
  disable test if CSV engine is not in: result depends on the
  presence of CSV-based log tables
mysql-test/t/csv.test:
  add tests for concurrent insert (the functionality is added
  to CSV in this patch)
mysql-test/t/information_schema.test:
  disable test if CSV engine is not in: result depends on the
  presence of CSV-based log tables
mysql-test/t/mysqlcheck.test:
  disable test if CSV engine is not in: result depends on the
  presence of CSV-based log tables
mysql-test/t/show_check.test:
  disable test if CSV engine is not in: result depends on the
  presence of CSV-based log tables
mysql-test/t/system_mysql_db.test:
  disable test if CSV engine is not in: result depends on the
  presence of CSV-based log tables
mysql-test/t/system_mysql_db_fix.test:
  disable test if CSV engine is not in: result depends on the
  presence of CSV-based log tables
scripts/mysql_create_system_tables.sh:
  new system tables: slow_log and general_log
scripts/mysql_fix_privilege_tables.sql:
  add new log tables: use an SP to create them for
  non-csv build to work fine.
sql/ha_myisam.cc:
  move locking-related checks to the hanlder
sql/ha_myisam.h:
  new function declared
sql/handler.h:
  new virtual function is added: we should check for handler-related
  locking issues in the handler
sql/lock.cc:
  from now on we check for handler-related locking issues
  in the handler itself rather then in lock.cc
sql/log.cc:
  Add log tables support, refactoring: there are log event
  handlers with common interface. They are used by the LOGGER
  class, which is responsible for their initialization, cleanup
  and managment. Logging to the tables provided by one of the
  log event handler types.
sql/log.h:
  declare new log classes
sql/log_event.cc:
  convert old logging routines calls to use new API
sql/mysql_priv.h:
  define common log routines and objects
sql/mysqld.cc:
  Add support for the log tables. Their initalization, cleanup
  and specific options.
sql/share/errmsg.txt:
  add new error messages for the log tables
sql/slave.cc:
  convert old logging routines calls to use new API
sql/sql_base.cc:
  TABLE objects used by the logger should be skipped
  during refreshes (as log tables are always opened
  and locked). fix table_is_used to skip them.  This
  is needed for FLUSH LOGS to work
sql/sql_db.cc:
  convert old logging routines calls to use new API
sql/sql_delete.cc:
  fix TRUNCATE to work with log tables
sql/sql_parse.cc:
  command_name is now an array of LEX_STRINGs
sql/sql_prepare.cc:
  convert old logging routines calls to use new API
sql/sql_show.cc:
  convert old logging routines calls to use new API
sql/sql_table.cc:
  don't reoped the log tables for admin purposes
sql/table.cc:
  mark log tables as such during the open
sql/table.h:
  add log-related info
storage/csv/ha_tina.cc:
  add support for concurrent insert (see bk commit - 5.1 tree
  (petr:1.1910) for standalone patch), add log tables-specific
  csv table handling.
storage/csv/ha_tina.h:
  enable concurrent insert for CSV, add log table flag
mysql-test/r/log_tables.result:
  New BitKeeper file ``mysql-test/r/log_tables.result''
mysql-test/t/log_tables.test:
  New BitKeeper file ``mysql-test/t/log_tables.test''
2006-01-19 05:56:06 +03:00