Commit graph

29897 commits

Author SHA1 Message Date
unknown
8d4f74be2d - final fixes for bug#16431 (Events: An event which alters itself disappears)
- fix for bug#16423 (Events: SHOW CREATE EVENT doesn't work)
- this Changeset commits makes CREATE/UPDATE/DELETE EVENT real DDL statements
  by committing the currently open transaction before they are executed.
- this Changeset also fixes a trailing space problem since the very early days
  of the internal cron
- adds sophisticated checking of whether mysql.event was tampered accidentally
  or with purpose by an user.
- adds a lot of inline function documentation - documents everything left
  uncodumented
- INTERVAL_XXXX to XXX in I_S.EVENTS.INTERVAL_FIELD

WL#1034 (Internal CRON)


mysql-test/r/events.result:
  update result
mysql-test/t/events.test:
  add test cases for SHOW CREATE EVENT
  add test cases where the structure of mysql.event is changed and error reporting in this case
sql/event.cc:
  - do a lot more checking on mysql.event whether it's valid
    introduced generic function table_check_intact() which can be used also
    for checking whether a system table (mysql.*) has been tampered by user
    and report an error in this case. The checking is quite strict, thus
    maybe some mechanism can be added later that loosens this like some
    session variable, for instance, i_am_aware_that_i_can_damage_my_data
    so the table will be opened nevertheless we think that it's not valid.
  - add evex_show_create_event(THD *thd, sp_name *spn, LEX_STRING definer)
  - document a loooot. not a single function left undocumented.
sql/event.h:
  - add evex_show_create_event(THD *thd, sp_name *spn, LEX_STRING definer)
  - change get_show_create_event() to get_create_event()
  - add TABLE_FIELD_W_TYPE used by table_check_intact()
  - add event_timed::sql_mode so it can be used by show create event. currently
    always 0, will be fixed by a patch for another bug. At least makes the code
    of show create event complete.
sql/event_executor.cc:
  - add evex_check_system_tables() that checks on boot and event
    main thread startup that mysql.db and mysql.user tables are correct.
  - document everything!
sql/event_priv.h:
  remove a line
sql/event_timed.cc:
  - implement SHOW CREATE EVENT
  - document undocumented functions!
sql/share/errmsg.txt:
  - fix an error message and add two new
sql/sql_acl.cc:
  - add mysql.db table definition to use by table_check_intact()
  - exchange some of the positions by numbers from mysql.db to enum names (see sql_acl.h)
sql/sql_acl.h:
  - define the structure of mysql.db table
sql/sql_parse.cc:
  - handle SQLCOM_SHOW_CREATE_EVENT
  - end the current transaction becase CREATE/UPDATE/DELETE EVENT is a DDL
    statement
sql/sql_show.cc:
  - remove interval_type_to_name
  - use common function event_reconstruct_interval_expression()
    that reconstructs the expression given at create/alter, to some
    extent - interval of 2:62 MINUTE_SECOND will be reconstructed as
    interval of 3:02 MINUTE_SECOND!
sql/sql_yacc.yy:
  init the definer of event_timed also when doing SHOW CREATE EVENT
  because it's needed for checking into mysql.event
sql/table.cc:
  - remove stale code. only mysql.event should be a 'system_table'
  - add table_check_intact() to check the consistency of a table.
    mostly usable with mysql.xxx tables.
sql/table.h:
  - export TABLE_FIELD_W_TYPE and table_check_intact() which are used for 
    checking the structure of a table. mostly usable for mysql.xxx tables.
2006-02-14 16:20:48 +01:00
unknown
80c60741c0 Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new
2006-01-31 11:43:11 +01:00
unknown
394dd23495 bug#10987 - rpl_ndb_bank
last bug fix revealed another bug.
  fix buffer management when parsing table descriptor


storage/ndb/src/kernel/blocks/backup/Backup.cpp:
  remove pages on backup record, use buffer in file record instead
storage/ndb/src/kernel/blocks/backup/Backup.hpp:
  remove useless pages on backup record
    file buffer is good enough
storage/ndb/src/kernel/blocks/backup/BackupInit.cpp:
  remove useless pages on backup record
    file buffer is good enough
2006-01-31 11:42:36 +01:00
unknown
26cc7364a5 Merge bk-internal:/home/bk/mysql-5.1-new
into  mysql.com:/usr/local/mysql/x/mysql-5.1-new
2006-01-31 10:48:40 +01:00
unknown
91b0d093fd Bug #16851, log floods with ndb discover messages
+ fix crashing bug when discovering ndb tables outside select context
2006-01-31 01:37:48 +01:00
unknown
7d901198a2 Merge bk-internal:/home/bk/mysql-5.1-new
into  mysql.com:/usr/local/mysql/x/mysql-5.1-new


scripts/make_win_src_distribution.sh:
  Auto merged
2006-01-30 22:35:46 +01:00
unknown
3a2b70f841 Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new
2006-01-30 21:28:55 +01:00
unknown
bf8274a49a Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new
2006-01-30 21:07:50 +01:00
unknown
857cff5a69 bug#10987 - rpl_ndb_bank -
Allow GET_TABINFO during BACKUP
  (otherwise LCP gets corrupt)


storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  All GET_TABINFO during BACKUP
2006-01-30 21:07:01 +01:00
unknown
aa7dbd0289 Merge rburnett@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  linux.site:/home/reggie/work/mysql-5.1
2006-01-30 11:47:56 -06:00
unknown
6330e07526 Merge bk-internal:/home/bk/mysql-5.1-new
into  mysql.com:/home/jimw/my/mysql-5.1-clean
2006-01-30 09:47:55 -08:00
unknown
c4f91d17b7 Merge mysql.com:/usr/local/mysql/mysql-5.1-win-fixes
into  mysql.com:/usr/local/mysql/x/mysql-5.1-new


VC++Files/sql/mysqld.vcproj:
  Auto merged
sql/event.h:
  Auto merged
sql/event_executor.cc:
  Auto merged
sql/event_timed.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_partition.cc:
  Auto merged
VC++Files/client/mysqldump.vcproj:
  Manual merge.
2006-01-30 17:57:20 +01:00
unknown
8a78ab057e Merge bk-internal:/home/bk/mysql-5.1-new
into  mysql.com:/usr/local/mysql/x/mysql-5.1-new
2006-01-30 17:47:06 +01:00
unknown
5f67b29f61 Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into lmy004.:/work/mysql-5.1-events_i_s
2006-01-30 17:20:46 +01:00
unknown
e5eea47c67 post-merge fixes of fix for bug#16642 (No I_S.EVENTS table)
WL#1034 (Internal CRON)


mysql-test/r/events.result:
  fix result of t/events (post-merge fix of bug #16642)
mysql-test/r/system_mysql_db.result:
  fix result(post-merge fix of bug #16642)
mysql-test/t/events.test:
  fix test, use --echo instead of select, fix failing create event statement
sql/event_timed.cc:
  add a bit more debug information
2006-01-30 17:12:30 +01:00
unknown
a0b5fe13e0 BUG# 14524 - Partitions: crash if blackhole
This bug was fixed through other patches.  This test case just shows 
that it is fixed.


mysql-test/r/partition_hash.result:
  result block for bug #14524
mysql-test/t/partition_hash.test:
  test block for bug# 14524
2006-01-30 10:07:39 -06:00
unknown
2f265f0cf5 Merge bk-internal:/home/bk/mysql-5.1-new
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1
2006-01-30 17:07:38 +01:00
unknown
178b1740ab Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  poseidon.ndb.mysql.com:/home/tomas/mysql51
2006-01-30 17:07:37 +01:00
unknown
5a60eba217 added --core option in mysql-test-run for ndb
mysql-test/r/ndb_restore.result:
  removed test printout not used
mysql-test/t/ndb_restore.test:
  removed test printout not used
2006-01-30 17:06:31 +01:00
unknown
c5347f7d96 Merge bk-internal:/home/bk/mysql-5.1-new
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1
2006-01-30 15:38:07 +01:00
unknown
b0ed146522 Merge bk-internal:/home/bk/mysql-5.1-new
into  mysql.com:/usr/local/mysql/mysql-5.1-merge
2006-01-30 15:28:59 +01:00
unknown
f17fbd90dd Merge mysql.com:/home/bkroot/mysql-5.1-new
into  mysql.com:/home/bk/fix-mysql-5.1-new
2006-01-30 15:22:18 +01:00
unknown
63fd138d31 Fixing minor problem causing the rpl_row_basic_11bugs test to fail
when executed using the Perl version of mysql-test-run.


mysql-test/t/rpl_row_basic_11bugs-master.opt:
  Removing extreneous semicolon
2006-01-30 15:16:49 +01:00
unknown
5ab28d81f9 Merge mysql.com:/usr/local/mysql/mysql-5.0-merge
into  mysql.com:/usr/local/mysql/mysql-5.1-merge


mysql-test/r/innodb.result:
  Auto merged
mysql-test/t/innodb.test:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
storage/innobase/include/os0file.h:
  Auto merged
storage/innobase/os/os0file.c:
  Auto merged
VC++Files/sql/mysqld.vcproj:
  SCCS merged
2006-01-30 15:05:31 +01:00
unknown
2272e140fd post-commit merge
mysql-test/lib/init_db.sql:
  Auto merged
scripts/mysql_create_system_tables.sh:
  Auto merged
scripts/mysql_fix_privilege_tables.sql:
  Auto merged
sql/event.cc:
  Auto merged
sql/event.h:
  Auto merged
sql/event_executor.cc:
  Auto merged
sql/event_priv.h:
  Auto merged
sql/event_timed.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/events.result:
  manual merge
mysql-test/r/system_mysql_db.result:
  manual merge
mysql-test/t/events.test:
  manual merge
2006-01-30 14:28:48 +01:00
unknown
e65d02e005 Fix mysqlslap.vcproj dependencies also for Release and classic configuration.
VC++Files/client/mysqlslap.vcproj:
  Fix dependencies also for Release and classic configuration.
2006-01-30 14:10:12 +01:00
unknown
d2590a8f2d Merge bk-internal:/home/bk/mysql-5.1-new
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1
2006-01-30 13:46:30 +01:00
unknown
baec050207 Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  april.(none):/home/svoj/devel/mysql/BUG16722/mysql-5.1-new


storage/myisam/ft_boolean_search.c:
  Auto merged
2006-01-30 16:28:51 +04:00
unknown
c3542cebf9 fix for bug#16642 (Events: No INFORMATION_SCHEMA.EVENTS table)
post-review change - use pointer instead of copy on the stack.
WL#1034 (Internal CRON)
 This patch adds INFORMATION_SCHEMA.EVENTS table with the following format:
  EVENT_CATALOG  - MYSQL_TYPE_STRING  (Always NULL)
  EVENT_SCHEMA   - MYSQL_TYPE_STRING  (the database)
  EVENT_NAME     - MYSQL_TYPE_STRING  (the name)
  DEFINER        - MYSQL_TYPE_STRING  (user@host)
  EVENT_BODY     - MYSQL_TYPE_STRING  (the body from mysql.event)
  EVENT_TYPE     - MYSQL_TYPE_STRING  ("ONE TIME" | "RECURRING")
  EXECUTE_AT     - MYSQL_TYPE_TIMESTAMP (set for "ONE TIME" otherwise NULL)
  INTERVAL_VALUE - MYSQL_TYPE_LONG    (set for RECURRING otherwise NULL)
  INTERVAL_FIELD - MYSQL_TYPE_STRING  (set for RECURRING otherwise NULL)
  SQL_MODE       - MYSQL_TYPE_STRING  (for now NULL)
  STARTS         - MYSQL_TYPE_TIMESTAMP (starts from mysql.event)
  ENDS           - MYSQL_TYPE_TIMESTAMP (ends from mysql.event)
  STATUS         - MYSQL_TYPE_STRING  (ENABLED | DISABLED)
  ON_COMPLETION  - MYSQL_TYPE_STRING  (NOT PRESERVE | PRESERVE)
  CREATED        - MYSQL_TYPE_TIMESTAMP
  LAST_ALTERED   - MYSQL_TYPE_TIMESTAMP
  LAST_EXECUTED  - MYSQL_TYPE_TIMESTAMP
  EVENT_COMMENT  - MYSQL_TYPE_STRING

  SQL_MODE is NULL for now, because the value is still not stored in mysql.event .
Support will be added as a fix for another bug.

 This patch also adds SHOW [FULL] EVENTS [FROM db] [LIKE pattern]
1. SHOW EVENTS shows always only the events on the same user,
   because the PK of mysql.event is (definer, db, name) several 
   users may have event with the same name -> no information disclosure.
2. SHOW FULL EVENTS - shows the events (in the current db as SHOW EVENTS)
   of all users. The user has to have PROCESS privilege, if not then
   SHOW FULL EVENTS behave like SHOW EVENTS.
3. If [FROM db] is specified then this db is considered.
4. Event names can be filtered with LIKE pattern.
  SHOW EVENTS returns table with the following columns, which are subset of
  the data which is returned by SELECT * FROM I_S.EVENTS
   Db
   Name
   Definer 
   Type
   Execute at
   Interval value
   Interval field 
   Starts 
   Ends
   Status


mysql-test/lib/init_db.sql:
  change the PK - (definer, db, name)
  quicker searches when SHOW EVENTS;
  allow also different users to have events with the same name -> 
  no information disclosure
mysql-test/r/events.result:
  result of new tests
mysql-test/r/information_schema.result:
  result of new tests
mysql-test/r/information_schema_db.result:
  result of new tests
mysql-test/r/system_mysql_db.result:
  result of new tests
mysql-test/t/events.test:
  new tests for information_schema.events
scripts/mysql_create_system_tables.sh:
  change the PK of mysql.event to (definer, db, name)
scripts/mysql_fix_privilege_tables.sql:
  change the PK of mysql.event to (definer, db, name)
sql/event.cc:
  pass around the definer of the event because of the new PK
  which is (definer, db, name). It's needed for index searching.
sql/event.h:
  - make enum evex_table_field again public so it can be used
  in sql_show.cc
  - make created and modified ulonglong, because they should be such
  - make public evex_open_event_table so it can be used in sql_show.cc
sql/event_executor.cc:
  - cosmetics
sql/event_priv.h:
  - moved enum evex_table_field and evex_open_event_table()
    to event.h (made them therefore public)
sql/event_timed.cc:
  - in event_timed::init_definer() always fill this.definer with
    the concatenated value of definer_user@definer_host. Makes
    later the work easier.
  - pass around the definer wherever is needed for searching 
    (new prototype of evex_db_find_evex_aux)
sql/mysqld.cc:
  - add counter for SHOW EVENTS
sql/sql_lex.h:
  - register SHOW EVENTS as command
sql/sql_parse.cc:
  - handle SCH_EVENTS (I_S.EVENTS like SCH_TRIGGERS)
  - make additional check in case of SHOW EVENTS (check for EVENT on
    the current database. if it is null check_access() gives appropriate
    message back.
sql/sql_show.cc:
  - add INFORMATION_SCHEMA.EVENTS and SHOW EVENTS
  - I_S.EVENTS.SQL_MODE is NULL for now -> not implemented. Trudy
    asked to be added so bug #16642 can be completely closed. There
    is another bug report which will fix the lack of storage of
    SQL_MODE during event creation.
sql/sql_yacc.yy:
  - always call event_timed::init_definer() when CREATE/ALTER/DROP
    EVENT but not when just compiling the body of the event because
    in this case this operation is not needed, it takes memory and
    CPU time and at the end the result is not used. event_timed::definer
    is used only on SQLCOM_CREATE/ALTER/DROP_EVENT execution not on
    statement compilation.
  - add SHOW [FULL] EVENTS [FROM db] [LIKE pattern]
    in case of FULL and the user has PROCESS privilege then he will see
    also others' events in the current database, otherwise the output
    is the same as of SHOW EVENTS. Because the events are per DB only
    the events from the current database are shown. pattern is applied
    against event name. FROM db is self explanatory.
sql/table.h:
  add SCH_EVENTS as part of INFORMATION_SCHEMA
2006-01-30 13:15:23 +01:00
unknown
ab88a598ca Windows compile fixes in preparation for 5.1.6 beta.
VC++Files/client/mysqldump.vcproj:
  Add missing source file.
VC++Files/mysql.sln:
  Fix configuration mismatch.
VC++Files/sql/mysqld.vcproj:
  Enable row-based replication.
  Add missing source files.
scripts/make_win_src_distribution.sh:
  Add copying of missing directory.
sql/event.h:
  Fix type conflict only visible on Windows.
sql/event_executor.cc:
  Fix non-portable thread stuff.
sql/event_timed.cc:
  Fix type conflict only visible on Windows.
sql/ha_archive.cc:
  Add cast needed for Windows.
sql/handler.h:
  Fix Windows byte * <-> char * mismatch.
sql/opt_range.cc:
  Fix Windows byte * <-> char * mismatch.
sql/set_var.cc:
  BUG#16811
  Fix Windows compilation by making the cast-away of volatile implicit
  (Windows linker does not like volatile <-> non-volatile mismatch, in
  contrast to Unix)
sql/sql_partition.cc:
  Fix Windows byte * <-> char * mismatch.
2006-01-30 13:09:08 +01:00
unknown
799129e254 Fix another non-portable __attribute__ 2006-01-30 12:42:27 +01:00
unknown
42fc1a9e2d Merge bk-internal:/home/bk/mysql-5.1-new
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1
2006-01-30 12:12:48 +01:00
unknown
93985f253a __attribute__ is (of course) not portable 2006-01-30 11:25:47 +01:00
unknown
701347bc2e Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  poseidon.ndb.mysql.com:/home/tomas/mysql51
2006-01-30 11:11:54 +01:00
unknown
1dc94a9dcf MySQL Bugs: #16772: Starting node joins cluster too early, workaround avoiding the issue for dynamically allocated nodeid's
storage/ndb/include/kernel/signaldata/AllocNodeId.hpp:
  New BitKeeper file ``storage/ndb/include/kernel/signaldata/AllocNodeId.hpp''
2006-01-30 11:09:55 +01:00
unknown
8fbc7ef0d5 Merge neptunus.(none):/home/msvensson/mysql/bug15904/my51-bug15904
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1


sql/sql_table.cc:
  Auto merged
2006-01-30 11:03:17 +01:00
unknown
35485efbc9 Merge neptunus.(none):/home/msvensson/mysql/bug15719/my51-bug15719
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1
2006-01-30 10:59:51 +01:00
unknown
bb0cdc20af Merge neptunus.(none):/home/msvensson/mysql/bug15719/my50-bug15719
into  neptunus.(none):/home/msvensson/mysql/bug15719/my51-bug15719


sql-common/client.c:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2006-01-30 10:57:42 +01:00
unknown
40b058b11b Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new
2006-01-30 08:24:24 +01:00
unknown
7501a104d4 bug#10987 - ndb - ndb_rpl_bank
more printouts...


storage/ndb/src/kernel/blocks/backup/Backup.cpp:
  printouts
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  printouts
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
  printouts
2006-01-30 08:23:54 +01:00
unknown
70471e6ae2 Do not create log table handler if run in bootstrap mode.
This patch also fixes annoying complains on the log tables
absence, issued by the shell version of mysql-test-run.


sql/log.h:
  check for the table log handler presence, as now it
  could be absent in some cases. Namely, during bootstrap.
sql/mysqld.cc:
  do not create log table handler, if run
  in bootstrap mode.
2006-01-30 02:24:47 +03:00
unknown
d4c61055ed bug#10987 - ndb - ndb_rpl_bank
even more debug printouts


storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  more printouts...
2006-01-29 23:13:39 +01:00
unknown
529267ee4f bug#10987 - ndb - more printouts to hunt rpl_ndb_bank problem in pushbuild
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  more printouts
  write tabfile sync
2006-01-29 15:53:34 +01:00
unknown
50abf1e471 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new
into serg.mylan:/usr/home/serg/Abk/mysql-5.1


sql/handler.h:
  Auto merged
2006-01-29 09:53:26 +01:00
unknown
167e534cf1 Merge pgalbraith@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  govinda.patg.net:/home/patg/mysql-build/mysql-5.1-new-wl2986
2006-01-28 16:24:38 -08:00
unknown
ff5d012454 WL# 2986
Final patch
-----------

This WL is about using this bitmap in all parts of the partition handler.
Thus for:
rnd_init/rnd_next
index_init/index_next and all other variants of index scans
read_range_... the various range scans implemented in the partition handler.

Also use those bitmaps in the various other calls that currently loop over all
partitions.




mysql-test/r/partition_pruning.result:
  WL# 2986
  
  New results reflecting bitmap being used to determine if a partition is to be
  included
mysql-test/t/partition_pruning.test:
  WL# 2986
  
  New tests to show bitmap being used in ha_partition
sql/ha_partition.cc:
  WL# 2986
  
  Used work from 2682 and removed the partition select code.
      
  Added do {} while loop to any iteration over partitions to now utilise 
  m_part_info->used_partitions bitmap to determine if a partition should be
  used.
sql/ha_partition.h:
  WL# 2986
  
  Removed unused member
sql/handler.h:
  WL# 2986
  
  Removed unused member
sql/opt_range.cc:
  WL# 2986
  
  Added bitmap_clear_all to clear bitmap prior to pruning
  DBUG code for testing
sql/sql_partition.cc:
  WL# 2986
  
  Changed < to <=, which fixes the problem with edge cases going awry.
2006-01-28 16:22:32 -08:00
unknown
3b476a8ff2 two buffer overflows fixed
sql/sp.cc:
  use strxnmov, just in case
sql/sql_parse.cc:
  init thd->security_ctx->priv_host,
  otherwise - buffer overflow in db_create_routine
sql/unireg.cc:
  not too nice to do bzero(buf, 9) after char buf[5], eh ?
2006-01-28 19:21:40 +01:00
unknown
9bd6415218 Merge
mysql-test/r/create.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
sql/sql_table.cc:
  SCCS merged
2006-01-28 10:37:22 +01:00
unknown
5de6e07159 Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into debian.(none):/M51/mysql-5.1
2006-01-28 09:01:11 +01:00
unknown
c4dd9a2bc3 Merge bk-internal:/home/bk/mysql-5.1-new
into  mysql.com:/home/jimw/my/mysql-5.1-clean
2006-01-27 16:01:52 -08:00