Commit graph

84 commits

Author SHA1 Message Date
Sergei Golubchik
911c4811de cleanup and updated test results 2014-07-23 14:48:13 +02:00
Sergei Golubchik
0fdb3bcfdb 10.0-base merge (roles) 2013-10-29 15:08:44 +01:00
Sergei Golubchik
fef4166990 Don't allow authentication clauses for roles, in particular:
GRANT ... IDENTIFIED BY [ PASSWORD ] ...
  GRANT ... IDENTIFIED VIA ... [ USING ... ]
  GRANT ... REQUIRE ...
  GRANT ... MAX_xxx ...
  SET PASSWORD FOR ... = ...
2013-10-28 07:46:17 +01:00
Sergei Golubchik
ac6877d420 SET PASSWORD bugfixes:
* work as documented, use CURRENT_USER()
* move the check for ER_PASSWORD_ANONYMOUS_USER where it can actually work
2013-10-18 11:41:40 -07:00
Sergey Vojtovich
815c607dcf MDEV-4879 - Merge test cases for new CREATE TEMPORARY TABLE privilege model
- merged test cases for MySQL bug#27480
- fixed that LOCK TABLES was unable to open temporary table
  (covered by grant2 test, merged appropriate code from 5.6)
- commented lines that cause server crash in merge test, reported
  MDEV-5042 (not relevant to bug#27480)
2013-09-20 13:12:53 +04:00
Sergei Golubchik
2ccf247e93 after merge changes:
* rename all debugging related command-line options
  and variables to start from "debug-", and made them all
  OFF by default.
* replace "MySQL" with "MariaDB" in error messages
* "Cast ... converted ... integer to it's ... complement"
  is now a note, not a warning
* @@query_cache_strip_comments now has a session scope,
  not global.
2011-12-12 23:58:40 +01:00
Sergei Golubchik
b4a0b2c2f8 post-merge fixes.
most tests pass.
5.3 merge is next
2011-07-02 22:12:12 +02:00
Sergei Golubchik
9809f05199 5.5-merge 2011-07-02 22:08:51 +02:00
Georgi Kodinov
dd0823cc03 Bug # 11766011: mysql.user.authentication_string column causes
configuration wizard to fail

Made the fields mysql.user.plugin and mysql.user.authentication_string
nullable to conform with some older clients doing inserts instead of 
using the commands.
2011-03-18 16:16:17 +02:00
Sergei Golubchik
65ca700def merge.
checkpoint.
does not compile.
2010-11-25 18:17:28 +01:00
Georgi Kodinov
9705711596 WL#1054: Pluggable authentication support
Merged the implementation to a new base tree.
2010-08-09 11:32:50 +03:00
Sergei Golubchik
291fd96983 pluggable auth with plugin examples
Makefile.am:
  add new API files to the check_abi rule,
  remove duplicates
client/CMakeLists.txt:
  now a client can use dlopen too
client/Makefile.am:
  be csh-friendly
include/my_global.h:
  add dummy plugs for dlopen and co.
  for the code that needs them to work in static builds
mysys/Makefile.am:
  be csh-friendly
plugin/auth/dialog.c:
  typo fixed
2010-03-29 17:13:53 +02:00
Alexander Nozdrin
5676713687 Manual merge from mysql-trunk.
Conflicts:
  - client/mysqltest.cc
  - mysql-test/collections/default.experimental
  - mysql-test/suite/rpl/t/disabled.def
  - sql/mysqld.cc
  - sql/opt_range.cc
  - sql/sp.cc
  - sql/sql_acl.cc
  - sql/sql_partition.cc
  - sql/sql_table.cc
2009-12-11 12:39:38 +03:00
Tatiana A. Nurnberg
be04d1a479 Bug#48319: Server crashes on "GRANT/REVOKE ... TO CURRENT_USER"
CURRENT_USER() in GRANT ... TO CURRENT_USER() only gave us a definer,
not a full user (i.e., password-element was not initiliazed). Hence
dereferencing the password led to a crash.

Properly initializes definers now, just so there are no misunderstandings.
Also does some magic so IDENTIFIED BY ... works with CURRENT_USER().

mysql-test/r/grant2.result:
  Show GRANT ... TO CURRENT_USER() no longer crashes.
  Show it to work with IDENTIFIED BY to boot.
mysql-test/t/grant2.test:
  Show GRANT ... TO CURRENT_USER() no longer crashes.
  Show it to work with IDENTIFIED BY to boot.
sql/sql_acl.cc:
  Make IDENTIFIED BY ... work with CURRENT_USER()
sql/sql_parse.cc:
  Zero password-part of definer just in case somebody mistakes this for
  a complete LEX_USER!
2009-10-29 22:06:10 -07:00
Alexander Nozdrin
22fe8e10e2 Merge from mysql-next-mr. 2009-10-28 10:55:44 +03:00
Kristofer Pettersson
0659b857e7 Bug#27145 EXTRA_ACL troubles
The flag EXTRA_ACL is used in conjugation with our access checks, yet it is
not clear what impact this flag has.
This is a code clean up which replaces use of EXTRA_ACL with an explicit
function parameter.
The patch also fixes privilege checks for:
- SHOW CREATE TABLE: The new privilege requirement is any privilege on
  the table-level.
- CHECKSUM TABLE: Requires SELECT on the table level.
- SHOW CREATE VIEW: Requires SHOW_VIEW and SELECT on the table level
  (just as the manual claims)
- SHOW INDEX: Requires any privilege on any column combination.


mysql-test/r/grant.result:
  * Error message now shows correct command (SHOW instead of SELECT)
mysql-test/r/grant2.result:
  * Error message now shows correct command (SHOW instead of SELECT)
mysql-test/r/grant4.result:
  * This test file tests privilege requirements for
    SHOW COLUMNS
    CREATE TABLE .. LIKE
    SHOW CREATE TABLE
    SHOW INDEX
    CHECKSUM TABLE
    SHOW CREATE VIEW
mysql-test/r/information_schema_db.result:
  * Added SELECT privilege to testdb_2 as
    SHOW CREATE VIEW now demands this privilege
    as well as SHOW VIEW.
mysql-test/r/outfile.result:
  * Changed error code
mysql-test/r/view_grant.result:
  * Additional SELECT privilege is now needed
    for SHOW CREATE VIEW
mysql-test/t/grant4.test:
  * This test file tests privilege requirements for
    SHOW COLUMNS
    CREATE TABLE .. LIKE
    SHOW CREATE TABLE
    SHOW INDEX
    CHECKSUM TABLE
    SHOW CREATE VIEW
mysql-test/t/information_schema_db.test:
  * Added SELECT privilege to testdb_2 as
    SHOW CREATE VIEW now demands this privilege
    as well as SHOW VIEW.
mysql-test/t/outfile.test:
  * Changed error code
mysql-test/t/view_grant.test:
  * Additional SELECT privilege is now needed
    for SHOW CREATE VIEW
sql/mysql_priv.h:
  * Replaced EXTRA_ACL with a parameter
sql/sp_head.cc:
  * Replaced EXTRA_ACL with a parameter
sql/sql_acl.cc:
  * Converted function documentation to doxygen and clarified some behaviors.
  * Changed value from uint to bool to better reflect its meaning.
  * Removed pointless variable orig_want_access
  * Added function has_any_table_level_privileges to help with requirements
    checks during SHOW CREATE TABLE.
sql/sql_acl.h:
  * changed signature of check_grant()
  * introduced access control function has_any_table_leevl_privileges()
sql/sql_base.cc:
  * Check_table_access has new signature
sql/sql_cache.cc:
  * Check_table_access has new signature
sql/sql_parse.cc:
  * Rewrote function documentation in doxygen comments for: check_access,
    check_table_acces, check_grant.
  * Removed EXTRA_ACL flag where it doesn't hold any meaningful purpose anymore
    and replaced it with a function parameter where any privileges on any column
    combination would satisfy the requirement.
  * Fixed privilege check for SHOW COLUMNS and SHOW INDEX
  * Modified check_table_access to gain clarity in what EXTRA_ACL actually does.
  * Modified check_access to gain clarity in what EXTRA_ACL actually does.
  * Fixed privilege check for CREATE TABLE .. LIKE .. ; It now requires SELECT
    privileges on the table.
  * Fixed privilege check for SHOW CREATE TABLE ..; It now requires any privilege
    on the table level.
sql/sql_plugin.cc:
  * check_table_access has new signature
sql/sql_prepare.cc:
  * check_table_access has new signature
sql/sql_show.cc:
  * check_table_access has new signature
sql/sql_trigger.cc:
  * check_table_access has new signature
sql/sql_update.cc:
  * check grant has new signature
sql/sql_view.cc:
  * check_table_access has new signature
2009-10-19 14:58:13 +02:00
He Zhenxing
280bf1cee6 Backport Post fix of result files after push of BUG#34227 2009-10-02 17:12:10 +08:00
Matthias Leich
99685a0b79 Merge 5.0 -> 5.1
+ fix wrong resultfile have_outfile.require
2009-02-03 14:45:17 +01:00
Matthias Leich
1a04fc03fe 1. Slice of fix for Bug#42003 tests missing the disconnect of connections <> default
- If missing: add "disconnect <session>"
   - If physical disconnect of non "default" sessions is not finished
     at test end: add routine which waits till this happened
+ additional improvements like
  - remove superfluous files created by the test
  - replace error numbers by error names
  - remove trailing spaces, replace tabs by spaces
  - unify writing of bugs within comments
  - correct comments
  - minor changes of formatting
Modifications according to the code review are included.
Fixed tests:
grant2
grant3
lock_tables_lost_commit
mysqldump
openssl_1
outfile
2009-02-02 22:20:25 +01:00
Mats Kindahl
bcaf5e0cf5 Merging 5.1 main into 5.1-rpl. 2008-10-06 10:27:36 +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
Sven Sandberg
6e69536956 BUG#37975: wait_for_slave_* should increase the timeout
Problem 1: tests often fail in pushbuild with a timeout when waiting
for the slave to start/stop/receive error.
Fix 1: Updated the wait_for_slave_* macros in the following way:
- The timeout is increased by a factor ten
- Refactored the macros so that wait_for_slave_param does the work for
the other macros.
Problem 2: Tests are often incorrectly written, lacking a
source include/wait_for_slave_to_[start|stop].inc.
Fix 2: Improved the chance to get it right by adding
include/start_slave.inc and include/stop_slave.inc, and updated tests
to use these.
Problem 3: The the built-in test language command
wait_for_slave_to_stop is a misnomer (does not wait for the slave io
thread) and does not give as much debug info in case of failure as
the otherwise equivalent macro
source include/wait_for_slave_sql_to_stop.inc
Fix 3: Replaced all calls to the built-in command by a call to the
macro.
Problem 4: Some, but not all, of the wait_for_slave_* macros had an
implicit connection slave. This made some tests confusing to read,
and made it more difficult to use the macro in circular replication
scenarios, where the connection named master needs to wait.
Fix 4: Removed the implicit connection slave from all
wait_for_slave_* macros, and updated tests to use an explicit
connection slave where necessary.
Problem 5: The macros wait_slave_status.inc and wait_show_pattern.inc
were unused. Moreover, using them is difficult and error-prone.
Fix 5: remove these macros.
Problem 6: log_bin_trust_function_creators_basic failed when running
tests because it assumed @@global.log_bin_trust_function_creators=1,
and some tests modified this variable without resetting it to its
original value.
Fix 6: All tests that use this variable have been updated so that
they reset the value at end of test.


mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test:
  Replaced wait_for_slave_to_stop by include/wait_for_slave_sql_to_stop.inc
mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test:
  Replaced wait_for_slave_to_stop by include/wait_for_slave_sql_to_stop.inc
  Added connection slave since includ/wait_for_slave_sql_to_stop.inc
  does not do that anymore.
mysql-test/extra/rpl_tests/rpl_log.test:
  Replaced start slave+wait_slave_status by start_slave.inc
mysql-test/include/reset_master_and_slave.inc:
  replaced start/stop slave by start_slave.inc/stop_slave.inc
mysql-test/include/sync_slave_io_with_master.inc:
  Improved comments and error message.
mysql-test/include/wait_for_slave_io_to_stop.inc:
  Refactored to use wait_for_slave_param.inc.
  Removed connection slave.
mysql-test/include/wait_for_slave_param.inc:
  - Improved usage instructions
  - Added more debug info in case of timeout
  - Added parameters $slave_param_comparison, $slave_timeout,
  $slave_keep_connection, $slave_error_message
mysql-test/include/wait_for_slave_sql_error.inc:
  Refactored to use wait_for_slave_param.inc.
  Removed connection slave.
mysql-test/include/wait_for_slave_sql_to_start.inc:
  Refactored to use wait_for_slave_param.inc.
  Removed connection slave.
mysql-test/include/wait_for_slave_sql_to_stop.inc:
  Refactored to use wait_for_slave_param.inc.
  Removed connection slave.
mysql-test/include/wait_for_slave_to_start.inc:
  Refactored to use wait_for_slave_param.inc.
  Removed connection slave.
mysql-test/include/wait_for_slave_to_stop.inc:
  Refactored to use wait_for_slave_param.inc.
  Removed connection slave.
mysql-test/include/wait_show_pattern.inc:
  Removed unused (and error-prone) file
mysql-test/include/wait_slave_status.inc:
  Removed unused (and error-prone) file
mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test:
  Renamed $keep_connection to $slave_keep_connection.
mysql-test/suite/rpl/t/rpl_bug26395.test:
  Replace stop slave by stop_slave.inc
mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test:
  Replace start/stop slave by start_slave.inc/stop_slave.inc.
  Replace wait_for_slave_param by wait_for_slave_sql_to_stop.inc.
mysql-test/suite/rpl/t/rpl_dual_pos_advance.test:
  Renamed $keep_connection to $slave_keep_connection.
mysql-test/suite/rpl/t/rpl_flushlog_loop.test:
  Replace wait_slave_status by start_slave.inc
mysql-test/suite/rpl/t/rpl_idempotency.test:
  Added connection slave since wait_for_slave_sql_to_stop.inc does not
  do that any more.
mysql-test/suite/rpl/t/rpl_incident.test:
  Replaced wait_for_slave_to_stop by wait_for_slave_sql_to_stop.inc
mysql-test/suite/rpl/t/rpl_init_slave.test:
  Replaced start/stop slave by start_slave.inc/stop_slave.inc.
  Replaced save_master_pos;connection slave;sync_with_master by
  sync_slave_with_master.
mysql-test/suite/rpl/t/rpl_log_pos.test:
  Replaced start/stop slave by start_slave.inc/stop_slave.inc.
  Replaced wait_for_slave_param by other wait_for_slave_* macros.
mysql-test/suite/rpl/t/rpl_packet.test:
  Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test:
  Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test:
  Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/suite/rpl/t/rpl_row_until.test:
  Replaced start/stop slave by start_slave.inc/stop_slave.inc.
  Replaced save_master_pos;connection slave;sync_with_master by
  sync_slave_with_master.
mysql-test/suite/rpl/t/rpl_server_id1.test:
  Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/suite/rpl/t/rpl_slave_grp_exec.test:
  Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/suite/rpl/t/rpl_slave_skip.test:
  Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/suite/rpl/t/rpl_slave_status.test:
  Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/suite/rpl/t/rpl_sp.test:
  Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/suite/rpl/t/rpl_sp_effects.test:
  Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/suite/rpl/t/rpl_stm_until.test:
  Replaced start/stop slave by start_slave.inc/stop_slave.inc.
  Replaced save_master_pos;connection slave;sync_with_master by
  sync_slave_with_master.
mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test:
  Replaced start slave by start_slave.inc.
  Added explicit connection slave since wait_for_slave_sql_to_stop.inc
  does not do that anymore.
mysql-test/t/disabled.def:
  Disabled failing test.
mysql-test/t/func_time.test:
  Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/t/grant.test:
  Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/t/grant2.test:
  Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/t/innodb_notembedded.test:
  Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/t/log_bin_trust_function_creators_func.test:
  Restore @@global.log_bin_trust_function_creators at end of test.
  Clean up at end of test by dropping the created user.
mysql-test/t/query_cache.test:
  Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/t/query_cache_notembedded.test:
  Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/t/rpl_init_slave_func.test:
  Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/t/timezone2.test:
  Restore @@global.log_bin_trust_function_creators at end of test.
2008-07-10 18:09:39 +02:00
unknown
2e57478d92 merged the fix for bug 30468 to 5.1-opt
mysql-test/t/grant2.test:
  Auto merged
sql/sql_acl.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
2007-09-27 12:32:59 +03:00
unknown
66f13d9120 Bug #30468: column level privileges not respected when joining tables
When expanding a * in a USING/NATURAL join the check for table access
for both tables in the join was done using the grant information of the
first one.
Fixed by getting the grant information for the current table while 
iterating through the columns of the join.


mysql-test/r/grant2.result:
  Bug #30468: test case
mysql-test/t/grant2.test:
  Bug #30468: test case
sql/sql_acl.cc:
  Bug #30468: correctly check column grants
sql/sql_acl.h:
  Bug #30468: correctly check column grants
sql/sql_base.cc:
  Bug #30468: correctly check column grants
sql/sql_insert.cc:
  Bug #30468: correctly check column grants
2007-09-27 12:15:19 +03:00
unknown
023f3dd0df grant2.result:
Post merge fix.


mysql-test/r/grant2.result:
  Post merge fix.
2007-06-11 22:55:21 +04:00
unknown
bbef78f412 Merge moonbone.local:/mnt/gentoo64/work/test-5.0-opt-mysql
into  moonbone.local:/mnt/gentoo64/work/test-5.1-opt-mysql


mysql-test/r/view.result:
  Auto merged
mysql-test/t/grant2.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
mysql-test/r/grant2.result:
  SCCS merged
mysql-test/r/information_schema.result:
  SCCS merged
mysql-test/t/information_schema.test:
  SCCS merged
sql/sql_table.cc:
  SCCS merged
2007-06-11 17:14:16 +04:00
unknown
5031a418e5 Bug#18660 Can't grant any privileges on single table in database with underscore char
In case of database level grant the database name may be a pattern,
in case of table|column level grant the database name can not be a pattern.
We use 'dont_check_global_grants' as a flag to determine
if it's database level grant command 
(see SQLCOM_GRANT case, mysql_execute_command() function) and
set db_is_pattern according to 'dont_check_global_grants' value.


mysql-test/r/grant2.result:
  test result
mysql-test/t/grant2.test:
  test case
sql/sql_parse.cc:
  In case of database level grant the database name may be a pattern,
  in case of table|column level grant the database name can not be a pattern.
  We use 'dont_check_global_grants' as a flag to determine
  if it's database level grant command 
  (see SQLCOM_GRANT case, mysql_execute_command() function) and
  set db_is_pattern according to 'dont_check_global_grants' value.
2007-06-08 14:42:08 +05:00
unknown
b24c1b04ed Merge mockturtle.local:/home/dlenev/src/mysql-5.0-like
into  mockturtle.local:/home/dlenev/src/mysql-5.1-like-2


sql/handler.h:
  Auto merged
sql/mysql_priv.h:
  5.1 version of mysql_priv.h already contains all necessary changes.
sql/sql_parse.cc:
  5.1 version of sql_parse.cc already contains all necessary changes.
sql/sql_table.cc:
  5.1 version of sql_table.cc already contains all necessary changes.
sql/sql_yacc.yy:
  SCCS merged
mysql-test/r/grant2.result:
  Manual merge.
mysql-test/t/grant2.test:
  Manual merge.
2007-05-23 15:55:36 +04:00
unknown
206a6bb176 5.1 version of fix for:
Bug #23667 "CREATE TABLE LIKE is not isolated from alteration
              by other connections"
  Bug #18950 "CREATE TABLE LIKE does not obtain LOCK_open"
As well as:
  Bug #25578 "CREATE TABLE LIKE does not require any privileges
              on source table".

The first and the second bugs resulted in various errors and wrong
binary log order when one tried to execute concurrently CREATE TABLE LIKE
statement and DDL statements on source table or DML/DDL statements on its
target table.

The problem was caused by incomplete protection/table-locking against
concurrent statements implemented in mysql_create_like_table() routine.
We solve it by simply implementing such protection in proper way.
Most of actual work for 5.1 was already done by fix for bug 20662 and
preliminary patch changing locking in ALTER TABLE.

The third bug allowed user who didn't have any privileges on table create
its copy and therefore circumvent privilege check for SHOW CREATE TABLE.

This patch solves this problem by adding privilege check, which was missing.

Finally it also removes some duplicated code from mysql_create_like_table()
and thus fixes bug #26869 "TABLE_LIST::table_name_length inconsistent with
TABLE_LIST::table_name".


mysql-test/r/create-big.result:
  Added test coverage for concurrency-related issues with CREATE TABLE LIKE.
mysql-test/r/create.result:
  Adjusted error-code in the test case after refactoring code that
  implements CREATE TABLE ... LIKE.
mysql-test/r/grant2.result:
  Added test for bug#25578 "CREATE TABLE LIKE does not require any privileges
  on source table".
mysql-test/t/create-big.test:
  Added test coverage for concurrency-related issues with CREATE TABLE LIKE.
mysql-test/t/create.test:
  Adjusted error-code in the test case after refactoring code that
  implements CREATE TABLE ... LIKE.
mysql-test/t/disabled.def:
  Recent code changes ensured that CREATE TABLE LIKE statement is properly
  isolated against other statements, so synchronization.test should no
  longer fail (see fix for bug 20662 and preliminary patch for bug 23667
  changing ALTER TABLE locking).
mysql-test/t/grant2.test:
  Added test for bug#25578 "CREATE TABLE LIKE does not require any privileges
  on source table".
sql/handler.h:
  Introduced new flag for HA_CREATE_INFO::options in order to be able to
  distinguish CREATE TABLE ... LIKE from other types of CREATE TABLE.
sql/mysql_priv.h:
  mysql_create_like_table() now takes source table name not as a
  Table_ident object but as regular table list element.
sql/sql_lex.h:
  Removed LEX::like_name member. Now we use special flag in
  LEX::create_info::options for distinguishing CREATE TABLE ... LIKE
  from other types of CREATE TABLE and store name of source table as
  regular element in statement's table list.
sql/sql_parse.cc:
  CREATE TABLE ... LIKE implementation now uses statement's table list
  for storing information about the source table. We also use flag
  in LEX::create_info.options for distinguishing it from other types
  of CREATE TABLE.
  Finally CREATE TABLE ... LIKE now requires the same privileges on
  the source tables as SHOW CREATE TABLE. Moved this privilege check
  to check_show_create_table_access() function.
sql/sql_partition.cc:
  Now we use special flag in LEX::create_info::options for distinguishing
  CREATE TABLE ... LIKE from other types of CREATE TABLE and store name
  of source table as regular element in statement's table list.
sql/sql_table.cc:
  mysql_create_like_table():  
   - Commented and cleaned-up a bit code which is responsible for achieving
     isolation from concurrent statements. Most of actual work was done by
     fix for bug 20662 and preliminary patch changing locking locking in
     ALTER TABLE, so here we do minor things like relaxing locking on
     source table (we don't need lock on it, to have it open is enough) and
     adjusting code to make it more friendly against code implementing I_S.
   - Get rid of duplicated code related to source database/table name
     handling. All these operations are already done in
     st_select_lex::add_table_to_list(), so we achieve the same effect
     by including source table into the statement's table list.
sql/sql_yacc.yy:
  Now we use special flag in LEX::create_info::options for distinguishing
  CREATE TABLE ... LIKE from other types of CREATE TABLE and store name
  of source table as regular element in statement's table list.
2007-05-23 15:26:16 +04:00
unknown
f9d7642e7b 5.0 version of fix for:
Bug #23667 "CREATE TABLE LIKE is not isolated from alteration
             by other connections"
 Bug #18950 "CREATE TABLE LIKE does not obtain LOCK_open"
As well as:
 Bug #25578 "CREATE TABLE LIKE does not require any privileges
             on source table".

The first and the second bugs resulted in various errors and wrong
binary log order when one tried to execute concurrently CREATE TABLE LIKE
statement and DDL statements on source table or DML/DDL statements on its
target table.

The problem was caused by incomplete protection/table-locking against
concurrent statements implemented in mysql_create_like_table() routine.
We solve it by simply implementing such protection in proper way (see
comment for sql_table.cc for details).

The third bug allowed user who didn't have any privileges on table create
its copy and therefore circumvent privilege check for SHOW CREATE TABLE.

This patch solves this problem by adding privilege check, which was missing.

Finally it also removes some duplicated code from mysql_create_like_table().

Note that, altough tests covering concurrency-related aspects of CREATE TABLE
LIKE behaviour will only be introduced in 5.1, they were run manually for
this patch as well.


mysql-test/r/grant2.result:
  Added test for bug#25578 "CREATE TABLE LIKE does not require any privileges
  on source table".
mysql-test/t/grant2.test:
  Added test for bug#25578 "CREATE TABLE LIKE does not require any privileges
  on source table".
sql/handler.h:
  Introduced new flag for HA_CREATE_INFO::options in order to be able to
  distinguish CREATE TABLE ... LIKE from other types of CREATE TABLE.
sql/mysql_priv.h:
  mysql_create_like_table() now takes source table name not as a
  Table_ident object but as regular table list element.
sql/sql_parse.cc:
  CREATE TABLE ... LIKE implementation now uses statement's table list
  for storing information about the source table. We also use flag
  in LEX::create_info.options for distinguishing it from other types
  of CREATE TABLE.
  Finally CREATE TABLE ... LIKE now requires the same privileges on
  the source tables as SHOW CREATE TABLE. Moved this privilege check
  to check_show_create_table_access() function.
sql/sql_table.cc:
  mysql_create_like_table():
   - Provided proper protection from concurrent statements.
     This is achieved by keeping name-lock on the source table and holding
     LOCK_open mutex during whole operation. This gives protection against
     concurrent DDL on source table. Also holding this mutex makes copying
     of .frm file, call to ha_create_table() and binlogging atomic against
     concurrent DML and DDL operations on target table.
   - Get rid of duplicated code related to source database/table name
     handling. All these operations are already done in
     st_select_lex::add_table_to_list(), so we achieve the same effect
     by including source table into the statement's table list.
sql/sql_yacc.yy:
  Now we use special flag in LEX::create_info::options for distinguishing
  CREATE TABLE ... LIKE from other types of CREATE TABLE and store name
  of source table as regular element in statement's table list.
2007-05-23 15:22:13 +04:00
unknown
b84e9d10b4 Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
Fix tests for new behaviour: an error is thrown if a NON DETERMINISTIC
stored function (SF) is called during statement-based replication (SBR).


mysql-test/r/func_time.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/r/gis.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Mark function as DETERMINISTIC so it can be called with no error while
  doing statement-based replication (SBR).
mysql-test/r/grant2.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/r/innodb_notembedded.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/r/ps.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Mark function as DETERMINISTIC so it can be called with no error while
  doing statement-based replication (SBR).
mysql-test/r/query_cache.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/r/query_cache_notembedded.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/r/rpl_sp.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Move test for SF-calls in different replication modes to its own file, rpl_sf.
mysql-test/r/rpl_sp_effects.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/r/sp.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Mark function as DETERMINISTIC so it can be called with no error while
  doing statement-based replication (SBR).
mysql-test/r/timezone2.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/func_time.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/gis.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Mark function as DETERMINISTIC so it can be called with no error while
  doing statement-based replication (SBR).
mysql-test/t/grant2.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/innodb_notembedded.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/ps.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/query_cache.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/query_cache_notembedded.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/rpl_sp.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/rpl_sp_effects.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/sp.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Mark function as DETERMINISTIC so it can be called with no error while
  doing statement-based replication (SBR).
mysql-test/t/timezone2.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
sql/item_func.cc:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  If 'log_bin_trust_function_creators' variable is set, don't throw an error
  on calling a non-deterministc function in statement-based replication (SBR).
sql/sql_parse.cc:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Do not throw an error on calling a NON DETERMINISTIC stored procedure (SP)
  while doing statement-based replication (SBR), as the routine body is
  executed statement-by-statement.
mysql-test/r/rpl_sf.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Test for stored function (SF) calls in different replication modes.
  NON DETERMINISTIC SFs are not allowed while doing
  statement-based replication (SBR).
mysql-test/t/rpl_sf.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Test for stored function (SF) calls in different replication modes.
  NON DETERMINISTIC SFs are not allowed while doing
  statement-based replication (SBR).
2006-11-17 21:30:28 +01:00
unknown
e8fae25e6b Merge neptunus.(none):/home/msvensson/mysql/same_tools/my50-same_tools
into  neptunus.(none):/home/msvensson/mysql/same_tools/my51-same_tools


BitKeeper/deleted/.del-mtr_stress.pl:
  Auto merged
BitKeeper/deleted/.del-ps_6bdb.result:
  Auto merged
BitKeeper/deleted/.del-rpl000018.result:
  Auto merged
BitKeeper/deleted/.del-rpl000018.test:
  Auto merged
BitKeeper/deleted/.del-rpl_chain_temp_table.result:
  Auto merged
BitKeeper/deleted/.del-rpl_chain_temp_table.test:
  Auto merged
BitKeeper/deleted/.del-rpl_failsafe.result:
  Auto merged
BitKeeper/deleted/.del-rpl_failsafe.test:
  Auto merged
BitKeeper/deleted/.del-rpl_heap.result:
  Auto merged
BitKeeper/deleted/.del-rpl_heap.test:
  Auto merged
mysql-test/include/have_ndb.inc:
  Auto merged
mysql-test/include/master-slave.inc:
  Auto merged
mysql-test/lib/mtr_misc.pl:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/r/binlog_stm_mix_innodb_myisam.result:
  Auto merged
mysql-test/r/connect.result:
  Auto merged
mysql-test/r/csv.result:
  Auto merged
mysql-test/r/drop.result:
  Auto merged
mysql-test/r/flush_block_commit.result:
  Auto merged
mysql-test/r/func_misc.result:
  Auto merged
mysql-test/r/grant2.result:
  Auto merged
mysql-test/r/handler_myisam.result:
  Auto merged
mysql-test/r/multi_update.result:
  Auto merged
mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/ps_7ndb.result:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
mysql-test/r/query_cache_notembedded.result:
  Auto merged
mysql-test/r/rpl_err_ignoredtable.result:
  Auto merged
mysql-test/r/rpl_master_pos_wait.result:
  Auto merged
mysql-test/r/rpl_stm_000001.result:
  Auto merged
mysql-test/r/sp-threads.result:
  Auto merged
mysql-test/r/sp_notembedded.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/synchronization.result:
  Auto merged
mysql-test/r/type_blob.result:
  Auto merged
mysql-test/t/connect.test:
  Auto merged
mysql-test/t/csv.test:
  Auto merged
mysql-test/t/mysql_client_test.test:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
mysql-test/t/ps_1general.test:
  Auto merged
mysql-test/t/ps_grant.test:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
mysql-test/t/rpl_trunc_temp.test:
  Auto merged
mysql-test/t/sp-error.test:
  Auto merged
mysql-test/t/sp_notembedded.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/view_grant.test:
  Auto merged
mysql-test/extra/rpl_tests/rpl_flsh_tbls.test:
  SCCS merged
2006-10-04 16:35:40 +02:00
unknown
9cf998e6a9 Update tests and result files after running with new mysqltest that better detects problems with test files
mysql-test/r/csv.result:
  Update after add of missing semicolon
mysql-test/r/drop.result:
  Update result file, no space before commands that has been "sent"
mysql-test/r/flush.result:
  Update result file, no space before commands that has been "sent"
mysql-test/r/flush_block_commit.result:
  Update result file, no space before commands that has been "sent"
mysql-test/r/flush_read_lock_kill.result:
  Update result file, no space before commands that has been "sent"
mysql-test/r/grant2.result:
  Update result file, no space before commands that has been "sent"
mysql-test/r/handler.result:
  Update result file, no space before commands that has been "sent"
mysql-test/r/innodb_notembedded.result:
  Update result file, no space before commands that has been "sent"
mysql-test/r/kill.result:
  Update result file, no space before commands that has been "sent"
mysql-test/r/lock_multi.result:
  Update result file, no space before commands that has been "sent"
mysql-test/r/multi_update.result:
  Update result file, no space before commands that has been "sent"
mysql-test/r/mysqltest.result:
  Update result
mysql-test/r/query_cache.result:
  Update after add of missing semicolon
mysql-test/r/query_cache_notembedded.result:
  Update result file, no space before commands that has been "sent"
mysql-test/r/sp-threads.result:
  Update result file, no space before commands that has been "sent"
mysql-test/r/sp_notembedded.result:
  Update after add of missing semicolon
mysql-test/r/type_blob.result:
  Remove extra drop table
mysql-test/t/csv.test:
  Add missing semicolon
mysql-test/t/query_cache.test:
  Add missing semicolon
mysql-test/t/sp-error.test:
  Remove "tab" from end of error declaration
mysql-test/t/sp.test:
  Wrong delimiter, used ; instead of |
mysql-test/t/sp_notembedded.test:
  Wrong delimiter, used ; instead of |
mysql-test/t/view_grant.test:
  An incomplete error name specification was used.
2006-10-04 13:09:37 +02:00
unknown
948a894327 Merge zim.(none):/home/brian/mysql/dep-5.0
into  zim.(none):/home/brian/mysql/dep-5.1


client/mysql.cc:
  Auto merged
mysql-test/r/grant.result:
  Auto merged
mysql-test/r/grant2.result:
  Auto merged
mysql-test/r/heap_btree.result:
  Auto merged
mysql-test/t/grant.test:
  Auto merged
mysql-test/t/grant2.test:
  Auto merged
mysql-test/t/mysqlbinlog.test:
  Auto merged
mysql-test/t/repair.test:
  Auto merged
scripts/fill_func_tables.sh:
  Auto merged
scripts/mysql_install_db.sh:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
storage/heap/hp_delete.c:
  Auto merged
storage/myisam/mi_update.c:
  Auto merged
storage/myisam/sort.c:
  Auto merged
mysql-test/r/mysqldump.result:
  Fixing Result
mysql-test/r/repair.result:
  Fixing result
mysql-test/t/mysqldump.test:
  Merging change
storage/archive/ha_archive.cc:
  Merging in change
2006-08-14 15:24:29 -07:00
unknown
12eb42acf9 Merge updates.
mysql-test/r/grant2.result:
  Merge update:  Change between versions, it appears.
mysql-test/r/heap_btree.result:
  Merge update:  Add deterministic ordering of data, as the order is different 
  between versions.
mysql-test/r/mysql_client.result:
  Merge update: Help options changed between versions.
mysql-test/t/heap_btree.test:
  Merge update:  Add deterministic ordering of data, as the order is different 
  between versions.
BitKeeper/deleted/.del-bug20328.test~c76d766fe3e1eb5:
  Delete: mysql-test/t/bug20328.test
BitKeeper/deleted/.del-bug20328.result~4fee68989442c2a3:
  Delete: mysql-test/r/bug20328.result
2006-08-10 12:39:18 -04:00
unknown
d278381ec8 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0


client/mysql.cc:
  Auto merged
heap/hp_delete.c:
  Auto merged
mysql-test/t/mysqlbinlog.test:
  Auto merged
scripts/fill_func_tables.sh:
  Auto merged
scripts/mysql_install_db.sh:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
mysql-test/r/grant2.result:
  Manual merge
mysql-test/r/heap_btree.result:
  Manual merge
mysql-test/r/mysql_client.result:
  Manual merge
mysql-test/t/grant2.test:
  Manual merge
mysql-test/t/heap_btree.test:
  Manual merge
mysql-test/t/mysql_client.test:
  Manual merge
2006-08-09 22:23:41 -04:00
unknown
0f9725ad1f Bug#16180 Setting SQL_LOG_OFF without SUPER privilege is silently ignored
mysql-test/r/grant2.result:
  Added results for bug#16180
mysql-test/t/grant2.test:
  Added test for bug# 16180
sql/set_var.cc:
  Verify user has appropiate rights before setting the sql_log_off system variable.
2006-06-27 20:10:49 -04:00
unknown
c3c5f8d6d7 Merge mysql.com:/home/jimw/my/mysql-5.0-clean
into  mysql.com:/home/jimw/my/mysql-5.1-clean


BitKeeper/etc/ignore:
  auto-union
BitKeeper/deleted/.del-mysql_upgrade.dsp:
  Delete: VC++Files/client/mysql_upgrade.dsp
BitKeeper/deleted/.del-mysql_upgrade_ia64.dsp:
  Delete: VC++Files/client/mysql_upgrade_ia64.dsp
BitKeeper/deleted/.del-mysql_upgrade.c:
  Delete: client/mysql_upgrade.c
VC++Files/mysql.dsw:
  Auto merged
VC++Files/mysql.sln:
  Auto merged
VC++Files/mysql_ia64.dsw:
  Auto merged
client/mysql.cc:
  Auto merged
config/ac-macros/zlib.m4:
  Auto merged
configure.in:
  Auto merged
extra/yassl/Makefile.am:
  Auto merged
extra/yassl/taocrypt/Makefile.am:
  Auto merged
include/my_global.h:
  Auto merged
include/mysql.h:
  Auto merged
libmysql/libmysql.def:
  Auto merged
libmysqld/libmysqld.def:
  Auto merged
mysql-test/r/grant2.result:
  Auto merged
mysql-test/r/sp-security.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/trigger.result:
  Auto merged
mysql-test/r/udf.result:
  Auto merged
mysql-test/t/grant2.test:
  Auto merged
mysql-test/t/rpl_openssl.test:
  Auto merged
mysql-test/t/rpl_rotate_logs.test:
  Auto merged
mysql-test/t/sp-security.test:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql-common/client.c:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
client/Makefile.am:
  Resolve conflict
config/ac-macros/yassl.m4:
  Resolve conflict
mysql-test/include/have_udf.inc:
  Resolve conflict
mysql-test/lib/mtr_process.pl:
  Resolve conflict
mysql-test/mysql-test-run.pl:
  Resolve conflict
mysql-test/r/have_udf.require:
  Resolve conflict
mysql-test/r/rpl_openssl.result:
  Resolve conflict
mysql-test/t/disabled.def:
  Resolve conflict
mysql-test/t/information_schema.test:
  Resolve conflict
server-tools/instance-manager/instance_options.cc:
  Resolve conflict
sql/mysql_priv.h:
  Resolve conflict
sql/set_var.cc:
  Resolve conflict
support-files/mysql.spec.sh:
  Resolve conflict
2006-04-30 13:27:38 -07:00
unknown
f909f9965b Cleanup test cases that leaves "stuff" behind
mysql-test/r/ctype_latin2_ch.result:
  Drot table at end of test
mysql-test/r/grant2.result:
  Drop users
mysql-test/r/openssl_1.result:
  Drop users
mysql-test/r/rpl_openssl.result:
  Drop users
mysql-test/r/sp-security.result:
  Drop users
mysql-test/r/sp_notembedded.result:
  Drop table
mysql-test/r/trigger.result:
  Drop table
mysql-test/t/ctype_latin2_ch.test:
  Drop table
mysql-test/t/grant2.test:
  Drop users
mysql-test/t/openssl_1.test:
  Drop users
mysql-test/t/rpl_openssl.test:
  Drop users
mysql-test/t/sp-security.test:
  Drop users
mysql-test/t/sp_notembedded.test:
  Drop table
mysql-test/t/trigger.test:
  Drop table
2006-04-18 18:10:47 +02:00
unknown
3bcbf91376 BUG#13310 incorrect user parsing by SP
- Strip surrounding ''s from username when a new user connects. There
   is no user 'a@', it should be a@


mysql-test/r/grant2.result:
  Update test result
mysql-test/t/grant2.test:
  Add tests for bug 13310
sql/sql_parse.cc:
  Strip surrounding ''s from username when a new user connects. There 
  is no user 'a@', it should be a@
2006-04-18 10:46:17 +02:00
unknown
5a78cd7a72 Merge mysql.com:/extern/mysql/5.0/bug17476/mysql-5.0
into  mysql.com:/extern/mysql/5.1/generic/mysql-5.1-new


mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
mysql-test/r/grant2.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
mysql-test/t/grant2.test:
  Auto merged
mysql-test/t/skip_grants.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
scripts/make_binary_distribution.sh:
  Auto merged
sql/field_conv.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
VC++Files/mysql.sln:
  Manual merge (use local).
configure.in:
  Manual merge.
sql/table.cc:
  Manual merge.
2006-03-03 12:03:27 +01:00
unknown
d5a27fd86f Bug#17279 user with no global privs and with create priv in db can create
database
 - Fix test case for systems with "lowercase names"


mysql-test/r/grant2.result:
  Fix for system with "lowercase names", allow error 1007 to be returned
mysql-test/t/grant2.test:
  Fix for system with "lowercase names", allow error 1007 to be returned
2006-03-02 11:01:58 +01:00
unknown
26dab541e1 Merge 5.0 -> 5.1
mysql-test/r/grant2.result:
  Update test result
mysql-test/t/grant2.test:
  Explicitly specify "columns" when inserting into mysql.user and mysql.db
2006-02-28 13:54:32 +01:00
unknown
79fbd66582 Bug#17279 user with no global privs and with create priv in db can create databases
- Use binary charset in acl_cache, to make searches case sensitive
 - Add testcase 


mysql-test/r/grant2.result:
  Update test result
mysql-test/t/grant2.test:
  Add test case for bug#17279, checking that user with access to TESTDB can't create TEStdb
sql/sql_acl.cc:
  Use binary charset for the acl_cache to make the hash lookups case sensitive.
  Thus denying user with access to "TESTDB" access to "TEStdb"
2006-02-27 16:41:58 +01:00
unknown
313ea47da4 Add new option "check-testcases" to mysql-test-run.pl
Cleanup the sideeffects from most of the  testcases with sideeffects.


mysql-test/mysql-test-run.pl:
  Add option "check-testcases" to mysql-test-run.pl
  Will execute "include/check-testcase.test" once before each tescase and record the output into "var/tmp/check-testcase.result"
  After the teastcase it will run again and this time compare the output with previously recorded file.
mysql-test/r/analyze.result:
  Drop table t1 at end of test
mysql-test/r/create_select_tmp.result:
  Drop table t1 at end of test
mysql-test/r/ctype_cp932.result:
  Drop table t1 at end of test
mysql-test/r/ctype_recoding.result:
  Drop table t1 at end of test
mysql-test/r/grant2.result:
  Drop user mysqltest_2 and mysqltest_A@'%'
mysql-test/r/join_outer.result:
  Drop view v1 to cleanup
mysql-test/r/ps_1general.result:
  Drop table t1 at end of test
mysql-test/r/query_cache.result:
  Drop function "f1"
mysql-test/r/read_only.result:
  Reset the "read_only" flag
mysql-test/r/rpl000001.result:
  Remove user "blafasel2"
mysql-test/r/rpl000017.result:
  Remove user "replicate"
mysql-test/r/rpl_failed_optimize.result:
  Drop table t1 to cleanup
mysql-test/r/rpl_flush_tables.result:
  Drop tables t3, t4, t5
mysql-test/r/rpl_ignore_revoke.result:
  Delete user "user_foo"
mysql-test/r/rpl_insert_id.result:
  Drop table t1 to cleanup
mysql-test/r/rpl_loaddata.result:
  Drop tyable t1 to cleanup
mysql-test/r/rpl_loaddata_rule_m.result:
  Drop tyable t1 to cleanup
mysql-test/r/rpl_loaddata_rule_s.result:
  Drop tyable t1 to cleanup
mysql-test/r/rpl_misc_functions.result:
  Drop tyable t1 to cleanup
mysql-test/r/rpl_multi_update3.result:
  Drop tyable t1 and t2 to cleanup
mysql-test/r/rpl_replicate_do.result:
  Drop tyable t1 to cleanup
mysql-test/r/rpl_skip_error.result:
  Drop tyable t1 to cleanup
mysql-test/r/rpl_slave_status.result:
  Drop tyable t1 to cleanup
mysql-test/r/sp-prelocking.result:
  Drop view v1 and tables t1, t2, t3 and t4 to cleanup
mysql-test/r/sp-security.result:
  Delete users to cleanup
  Delete remaining traces in tables_priv and procs_priv
mysql-test/r/subselect_innodb.result:
  Drop procedure p1 to cleanup
mysql-test/r/trigger-compat.result:
  Drop trigger wl2818_trg1 and wl2818_trg2.
  Drop table t1, t2
  Drop database mysqltest_db1
  And the users "mysqltest_dfn@localhost" and "mysqltest_inv@localhost"
mysql-test/r/type_bit.result:
  Drop tables t1 and t2 to cleanup
mysql-test/r/variables.result:
  Set GLOBAL max_join_size to 10 as it originally was in variables-master.opt
mysql-test/r/view_grant.result:
  Dop user "test@localhost" to cleanup
mysql-test/t/analyze.test:
  Drop table t1 to cleanup
mysql-test/t/create_select_tmp.test:
  Drop table t1 to cleanup
mysql-test/t/ctype_cp932.test:
  Drop table t1 to cleanup
mysql-test/t/ctype_recoding.test:
  Drop table t1 to cleanup
mysql-test/t/fulltext_var.test:
  Restore the original ft_boolean_syntax
mysql-test/t/grant2.test:
  Drop users "mysqltest_2" and "mysqltest_A@'%'" to cleanup
mysql-test/t/innodb_cache.test:
  Reset query_cache_size to original value
mysql-test/t/join_outer.test:
  Drop view v1 to cleanup
mysql-test/t/ps_1general.test:
  Drop table t1 to cleanup
mysql-test/t/query_cache.test:
  Drop function "f1" to cleanup
mysql-test/t/read_only.test:
  Reset the readonly flag
mysql-test/t/rpl000001.test:
  Delete user "blafasel2" to cleanup
mysql-test/t/rpl000017.test:
  Delete user "replicate" to cleanup
mysql-test/t/rpl_failed_optimize.test:
  Drop table t1 to cleanup
mysql-test/t/rpl_flush_tables.test:
  Droip table t3, t4 and t5 to cleanup
mysql-test/t/rpl_ignore_revoke.test:
  Delet user "user_foo" to cleanup
mysql-test/t/rpl_insert_id.test:
  drop table t1 to cleanup
mysql-test/t/rpl_loaddata.test:
  Drop table t1 to cleanup
mysql-test/t/rpl_loaddata_rule_m.test:
  Drop table t1 to cleanup
mysql-test/t/rpl_loaddata_rule_s.test:
  Drop table t1 to cleanup
mysql-test/t/rpl_misc_functions.test:
  Drop table t1 to cleanup
mysql-test/t/rpl_multi_update3.test:
  Drop table t1 and t2 to cleanup
mysql-test/t/rpl_replicate_do.test:
  Drop table t1 to cleanup
mysql-test/t/rpl_skip_error.test:
  Drop table t1 to cleanup
mysql-test/t/rpl_slave_status.test:
  Drop table t1 to cleanup
mysql-test/t/sp-prelocking.test:
  Drop table t1, t2 t3 and t4 to cleanup
  Drop view v1
mysql-test/t/sp-security.test:
  Delete  test users from mysql.user, mysql.db, mysql.procs_priv and mysql.tables_priv
  Drop table t1 to cleanup
mysql-test/t/subselect_innodb.test:
  Drop procedure p1 to cleanup
mysql-test/t/trigger-compat.test:
  Drop trigger wl2818_trg1 and wl2818_trg2 to cleanup
  Drop table t1, t2
  Drop users
  drop database mysqltest_db1
mysql-test/t/type_bit.test:
  drop table t1 and t2 to cleanup
mysql-test/t/variables-master.opt:
  Increase max_join_size to 100.
mysql-test/t/variables.test:
  Set max_join_size to 10, which was the original value in variables-master.opt
mysql-test/t/view_grant.test:
  Drop the user "test@localhost"
mysql-test/include/check-testcase.test:
  New BitKeeper file ``mysql-test/include/check-testcase.test''
2006-01-26 17:54:34 +01:00
unknown
93bedc1fc3 Bug #15775 "drop user" command does not refresh acl_check_hosts
- Update patch for 5.0 
 - Added common function to be called when 'acl_users' has been modified


mysql-test/r/grant2.result:
  Use "create user" to avoid warnings about missing fields
mysql-test/t/grant2.test:
  Use "create user" to avoid warnings about missing fields
sql/sql_acl.cc:
  Add new function "rebuild_check_host" that is to be called when the 'acl_users'
  list has changed.
  Call function "rebuild_check_host" from mysql_drop_user, mysql_rename_user and acl_insert_user.
  Use "acl_user->host.hostname" as key when searching the acl_check_hosts in init_check_host.
2005-12-28 14:43:50 +01:00
unknown
50545a1825 Merge neptunus.(none):/home/msvensson/mysql/bug15775_part2/my41-bug15775_part2
into  neptunus.(none):/home/msvensson/mysql/bug15775_part2/my50-bug15775_part2


mysql-test/r/grant2.result:
  Merge test results
mysql-test/t/grant2.test:
  Merge tests
sql/sql_acl.cc:
  Removing the 4.1 version patch
2005-12-28 09:31:40 +01:00
unknown
9a8dde9bc7 BUG#15775 "drop user" command does not refresh acl_check_hosts
- DROP USER command didn't reload the acl_check_hosts cache causing subsequent 
     connect's via TCP to fail randomly.
   - 4.1 version


mysql-test/r/grant2.result:
  Update test results
mysql-test/t/grant2.test:
  Add test for to check that connect via TCP work after "drop user"
sql/sql_acl.cc:
  Reload acl_check_hosts as its memory is mapped to acl_user
  Use acl_user->host.hostname when searching the acl_check_hosts list
2005-12-28 09:23:27 +01:00
unknown
97bfd41fe1 Don't use PATH_MAX for FN_REFLEN as this uses too much stack space
Larger stack size neaded for open table on x86 64 bit
Fix failing test cases
Deleted symlink from bk


BitKeeper/etc/ignore:
  added libmysqld/ha_blackhole.cc
BitKeeper/deleted/.del-ha_blackhole.cc~727c69ef7846623a:
  Delete: libmysqld/ha_blackhole.cc
include/my_global.h:
  Don't use PATH_MAX for FN_REFLEN as this uses too much stack space.
  (With a PATH_MAX of 4096, we use 80K for opening a table as there is several objects of size FN_REFLEN on stack)
mysql-test/r/federated.result:
  Update results after error message changes
mysql-test/r/grant.result:
  Update results after error message changes
mysql-test/r/grant2.result:
  Update results after error message changes
sql/ha_federated.cc:
  Fix error messages to be more consistent
sql/mysql_priv.h:
  Stack size to have when opening a table
  (This was needed on x86 64 bit Linux)
sql/share/errmsg.txt:
  Remove quotes around error string for federated as two quotes in the output looks strange
sql/sql_base.cc:
  More correct stack size
sql/sql_parse.cc:
  Set thread_stack before store_globals()
sql/unireg.h:
  More correct MAX_DBKEY_LENGTH
2005-11-24 02:36:28 +02:00
unknown
7783dbbcdc Merge mysql.com:/home/dlenev/src/mysql-4.1-bg12423
into  mysql.com:/home/dlenev/src/mysql-5.0-merges


mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/lib/mtr_timer.pl:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_acl.h:
  Auto merged
sql/examples/ha_archive.cc:
  Auto merged
mysql-test/lib/mtr_process.pl:
  Manual merge.
mysql-test/mysql-test-run.pl:
  Manual merge.
mysql-test/r/grant2.result:
  Manual merge.
mysql-test/t/grant2.test:
  Manual merge.
sql/sql_acl.cc:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
2005-09-01 23:25:29 +04:00