Commit 55ae2e78 authored by unknown's avatar unknown
Browse files

After merge fixes


client/mysqldump.c:
  Merge with 4.0 (and reordering of options)
client/mysqltest.c:
  Added DB as a user variable
myisam/mi_check.c:
  Trivial cleanup
mysql-test/r/grant.result:
  Move test to be in same order as in 4.0
mysql-test/r/mix_innodb_myisam_binlog.result:
  Updated results
mysql-test/r/ps_1general.result:
  Updated tests to work after privilege fixes
mysql-test/r/timezone3.result:
  Updated results to 4.1
mysql-test/t/ps_1general.test:
  Updated tests to work after privilege fixes
sql-common/my_time.c:
  Applied sub-second patch from 4.0
sql/sql_acl.cc:
  More debugging
parent 44070705
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -255,6 +255,14 @@ static struct my_option my_long_options[] =
   "Option automatically turns --lock-tables off.",
   (gptr*) &opt_master_data, (gptr*) &opt_master_data, 0,
   GET_UINT, REQUIRED_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0},
  {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "",
    (gptr*) &opt_max_allowed_packet, (gptr*) &opt_max_allowed_packet, 0,
    GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096, 
   (longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
  {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "",
    (gptr*) &opt_net_buffer_length, (gptr*) &opt_net_buffer_length, 0,
    GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L,
   MALLOC_OVERHEAD-1024, 1024, 0},
  {"no-autocommit", OPT_AUTOCOMMIT,
   "Wrap tables with autocommit/commit statements.",
   (gptr*) &opt_autocommit, (gptr*) &opt_autocommit, 0, GET_BOOL, NO_ARG,
@@ -343,14 +351,7 @@ static struct my_option my_long_options[] =
   (gptr*) &where, (gptr*) &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
  {"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG,
   NO_ARG, 0, 0, 0, 0, 0, 0},
  {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "",
    (gptr*) &opt_max_allowed_packet, (gptr*) &opt_max_allowed_packet, 0,
    GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096, 
   (longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
  {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "",
    (gptr*) &opt_net_buffer_length, (gptr*) &opt_net_buffer_length, 0,
    GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L,
    MALLOC_OVERHEAD-1024, 1024, 0}
  { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};

static const char *load_default_groups[]= { "mysqldump","client",0 };
@@ -1679,7 +1680,6 @@ static void dumpTable(uint numFields, char *table)
	      else if (opt_hex_blob && is_blob)
              {
                /* sakaik got the idea to to provide blob's in hex notation. */
                ulong counter;
                unsigned char *ptr= row[i], *end= ptr+ lengths[i];
                fputs("0x", md_result_file);
                for (; ptr < end ; ptr++)
+2 −1
Original line number Diff line number Diff line
@@ -3351,7 +3351,8 @@ static void init_var_hash(MYSQL *mysql)
  my_hash_insert(&var_hash, (byte*) v);
  v= var_init(0,"SERVER_VERSION", 0, mysql_get_server_info(mysql), 0);
  my_hash_insert(&var_hash, (byte*) v);
  
  v= var_init(0,"DB", 2, db, 0);
  my_hash_insert(&var_hash, (byte*) v);
  DBUG_VOID_RETURN;
}

+5 −4
Original line number Diff line number Diff line
@@ -658,10 +658,11 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
          goto err;
        if (tmp_keys + subkeys)
        {
          mi_check_print_error(param,"Number of words in the 2nd level tree "
          mi_check_print_error(param,
                               "Number of words in the 2nd level tree "
                               "does not match the number in the header. "
                                  "Parent word in on the page %s, offset %d",
                                  llstr(page,llbuff), old_keypos-buff);
                               "Parent word in on the page %s, offset %u",
                               llstr(page,llbuff), (uint) (old_keypos-buff));
          goto err;
        }
        (*keys)+=tmp_keys-1;
+25 −25
Original line number Diff line number Diff line
@@ -134,6 +134,31 @@ ERROR HY000: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
select 1;
1
1
insert into mysql.user (host, user) values ('localhost', 'test11');
insert into mysql.db (host, db, user, select_priv) values 
('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y');
alter table mysql.db order by db asc;
flush privileges;
show grants for test11@localhost;
Grants for test11@localhost
GRANT USAGE ON *.* TO 'test11'@'localhost'
GRANT SELECT ON `ab%`.* TO 'test11'@'localhost'
GRANT SELECT ON `a%`.* TO 'test11'@'localhost'
alter table mysql.db order by db desc;
flush privileges;
show grants for test11@localhost;
Grants for test11@localhost
GRANT USAGE ON *.* TO 'test11'@'localhost'
GRANT SELECT ON `ab%`.* TO 'test11'@'localhost'
GRANT SELECT ON `a%`.* TO 'test11'@'localhost'
delete from mysql.user where user='test11';
delete from mysql.db where user='test11';
create database mysqltest1;
grant usage on mysqltest1.* to test6123 identified by 'magic123';
select host,db,user,select_priv,insert_priv from mysql.db where db="mysqltest1";
host	db	user	select_priv	insert_priv
delete from mysql.user where user='test6123';
drop database mysqltest1;
create table t1 (a int);
grant ALL PRIVILEGES on *.* to drop_user2@localhost with GRANT OPTION;
show grants for drop_user2@localhost;
@@ -229,31 +254,6 @@ GRANT SELECT (
REVOKE SELECT () ON . FROM @localhost;
DROP DATABASE ;
SET NAMES latin1;
insert into mysql.user (host, user) values ('localhost', 'test11');
insert into mysql.db (host, db, user, select_priv) values 
('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y');
alter table mysql.db order by db asc;
flush privileges;
show grants for test11@localhost;
Grants for test11@localhost
GRANT USAGE ON *.* TO 'test11'@'localhost'
GRANT SELECT ON `ab%`.* TO 'test11'@'localhost'
GRANT SELECT ON `a%`.* TO 'test11'@'localhost'
alter table mysql.db order by db desc;
flush privileges;
show grants for test11@localhost;
Grants for test11@localhost
GRANT USAGE ON *.* TO 'test11'@'localhost'
GRANT SELECT ON `ab%`.* TO 'test11'@'localhost'
GRANT SELECT ON `a%`.* TO 'test11'@'localhost'
delete from mysql.user where user='test11';
delete from mysql.db where user='test11';
create database db6123;
grant usage on db6123.* to test6123 identified by 'magic123';
select host,db,user,select_priv,insert_priv from mysql.db where db="db6123";
host	db	user	select_priv	insert_priv
delete from mysql.user where user='test6123';
drop database db6123;
USE test;
CREATE TABLE t1 (a int );
CREATE TABLE t2 LIKE t1;
+1 −1
Original line number Diff line number Diff line
@@ -194,7 +194,7 @@ select (@before:=unix_timestamp())*0;
begin;
 select * from t1 for update;
insert into t2 values (20);
Lock wait timeout exceeded; Try restarting transaction
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select (@after:=unix_timestamp())*0;
(@after:=unix_timestamp())*0
0
Loading