Commit 8dcefa6f authored by unknown's avatar unknown
Browse files

Merge vvagin@bk-internal.mysql.com:/home/bk/mysql-4.0

into eagle.mysql.r18.ru:/home/vva/work/BUG_2874/mysql-4.0


mysql-test/install_test_db.sh:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
parents b2147e25 12f5e3eb
Loading
Loading
Loading
Loading
+34 −24
Original line number Diff line number Diff line
@@ -867,6 +867,15 @@ int do_exec(struct st_query* q)
  if (!*cmd)
    die("Missing argument in exec\n");

  if (disable_result_log)
  {
    if (!(res_file= popen(cmd, "r")) && q->abort_on_error)
      die("popen() failed\n");
    while (fgets(buf, sizeof(buf), res_file));
    pclose(res_file);
  }
  else
  {
    if (q->record_file[0])
    {
      init_dynamic_string(&ds_tmp, "", 16384, 65536);
@@ -897,6 +906,7 @@ int do_exec(struct st_query* q)
    }
    if (ds == &ds_tmp)
      dynstr_free(&ds_tmp);
  }
  
  return error;
}
@@ -2251,7 +2261,7 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
      {
	if (i)
	  dynstr_append_mem(ds, "\t", 1);
	dynstr_append(ds, fields[i].name);
	replace_dynstr_append_mem(ds, fields[i].name, strlen(fields[i].name));
      }
      dynstr_append_mem(ds, "\n", 1);
      append_result(ds, res);
+12 −0
Original line number Diff line number Diff line
#
# This test must examine structure of current system database
#

-- replace_result Tables_in_mysql Tables_in_db Tables_in_test Tables_in_db
show tables;
show create table db;
show create table host;
show create table user;
show create table func;
show create table tables_priv;
show create table columns_priv;
+14 −14
Original line number Diff line number Diff line
@@ -72,9 +72,9 @@ if test ! -f $mdata/db.frm
then
  # mysqld --bootstrap wants one command/line
  c_d="$c_d CREATE TABLE db ("
  c_d="$c_d   Host char(60) DEFAULT '' NOT NULL,"
  c_d="$c_d   Db char(64) DEFAULT '' NOT NULL,"
  c_d="$c_d   User char(16) DEFAULT '' NOT NULL,"
  c_d="$c_d   Host char(60) binary DEFAULT '' NOT NULL,"
  c_d="$c_d   Db char(64) binary DEFAULT '' NOT NULL,"
  c_d="$c_d   User char(16) binary DEFAULT '' NOT NULL,"
  c_d="$c_d   Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
  c_d="$c_d   Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
  c_d="$c_d   Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
@@ -99,8 +99,8 @@ fi
if test ! -f $mdata/host.frm
then
  c_h="$c_h CREATE TABLE host ("
  c_h="$c_h  Host char(60) DEFAULT '' NOT NULL,"
  c_h="$c_h  Db char(64) DEFAULT '' NOT NULL,"
  c_h="$c_h  Host char(60) binary DEFAULT '' NOT NULL,"
  c_h="$c_h  Db char(64) binary DEFAULT '' NOT NULL,"
  c_h="$c_h  Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
  c_h="$c_h  Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
  c_h="$c_h  Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
@@ -178,10 +178,10 @@ fi
if test ! -f $mdata/tables_priv.frm
then
  c_t="$c_t CREATE TABLE tables_priv ("
  c_t="$c_t   Host char(60) DEFAULT '' NOT NULL,"
  c_t="$c_t   Db char(64) DEFAULT '' NOT NULL,"
  c_t="$c_t   User char(16) DEFAULT '' NOT NULL,"
  c_t="$c_t   Table_name char(60) DEFAULT '' NOT NULL,"
  c_t="$c_t   Host char(60) binary DEFAULT '' NOT NULL,"
  c_t="$c_t   Db char(64) binary DEFAULT '' NOT NULL,"
  c_t="$c_t   User char(16) binary DEFAULT '' NOT NULL,"
  c_t="$c_t   Table_name char(64) binary DEFAULT '' NOT NULL,"
  c_t="$c_t   Grantor char(77) DEFAULT '' NOT NULL,"
  c_t="$c_t   Timestamp timestamp(14),"
  c_t="$c_t   Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL,"
@@ -195,11 +195,11 @@ fi
if test ! -f $mdata/columns_priv.frm
then
  c_c="$c_c CREATE TABLE columns_priv ("
  c_c="$c_c   Host char(60) DEFAULT '' NOT NULL,"
  c_c="$c_c   Db char(64) DEFAULT '' NOT NULL,"
  c_c="$c_c   User char(16) DEFAULT '' NOT NULL,"
  c_c="$c_c   Table_name char(64) DEFAULT '' NOT NULL,"
  c_c="$c_c   Column_name char(64) DEFAULT '' NOT NULL,"
  c_c="$c_c   Host char(60) binary DEFAULT '' NOT NULL,"
  c_c="$c_c   Db char(64) binary DEFAULT '' NOT NULL,"
  c_c="$c_c   User char(16) binary DEFAULT '' NOT NULL,"
  c_c="$c_c   Table_name char(64) binary DEFAULT '' NOT NULL,"
  c_c="$c_c   Column_name char(64) binary DEFAULT '' NOT NULL,"
  c_c="$c_c   Timestamp timestamp(14),"
  c_c="$c_c   Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,"
  c_c="$c_c   PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
+14 −2
Original line number Diff line number Diff line
@@ -470,6 +470,7 @@ if [ x$SOURCE_DIST = x1 ] ; then
 LANGUAGE="$BASEDIR/sql/share/english/"
 CHARSETSDIR="$BASEDIR/sql/share/charsets"
 INSTALL_DB="./install_test_db"
 MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables"
else
 if test -x "$BASEDIR/libexec/mysqld"
 then
@@ -487,6 +488,7 @@ else
 MYSQL_MANAGER_PWGEN="$BASEDIR/bin/mysqlmanager-pwgen"
 MYSQL="$BASEDIR/bin/mysql"
 INSTALL_DB="./install_test_db -bin"
 MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/bin/mysql_fix_privilege_tables"
 if test -d "$BASEDIR/share/mysql/english"
 then
   LANGUAGE="$BASEDIR/share/mysql/english/"
@@ -499,8 +501,12 @@ fi

MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK"
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR"
MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password="
MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password="
export MYSQL
export MYSQL_DUMP
export MYSQL_BINLOG
export MYSQL_FIX_SYSTEM_TABLES

if [ -z "$MASTER_MYSQLD" ]
then
@@ -1177,6 +1183,7 @@ run_testcase ()
 master_init_script=$TESTDIR/$tname-master.sh
 slave_init_script=$TESTDIR/$tname-slave.sh
 slave_master_info_file=$TESTDIR/$tname.slave-mi
 result_file=$tname
 echo $tname > $CURRENT_TEST
 SKIP_SLAVE=`$EXPR \( $tname : rpl \) = 0`
 if [ $USE_MANAGER = 1 ] ; then
@@ -1226,6 +1233,11 @@ run_testcase ()
	 # Note that this must be set to space, not "" for test-reset to work
	 EXTRA_MASTER_OPT=" "
	 ;;
       --result-file=*)
         result_file=`$ECHO "$EXTRA_MASTER_OPT" | $SED -e "s;--result-file=;;"`
	 # Note that this must be set to space, not "" for test-reset to work
	 EXTRA_MASTER_OPT=" "
         ;;
     esac
     stop_master
     echo "CURRENT_TEST: $tname" >> $MASTER_MYERR
@@ -1283,7 +1295,7 @@ run_testcase ()

 if [ -f $tf ] ; then
    $RM -f r/$tname.*reject
    mysql_test_args="-R r/$tname.result $EXTRA_MYSQL_TEST_OPT"
    mysql_test_args="-R r/$result_file.result $EXTRA_MYSQL_TEST_OPT"
    if [ -z "$DO_CLIENT_GDB" ] ; then
      `$MYSQL_TEST  $mysql_test_args < $tf 2> $TIMEFILE`;
    else
@@ -1315,7 +1327,7 @@ run_testcase ()
	$ECHO "$RES$RES_SPACE [ fail ]"
        $ECHO
	error_is
	show_failed_diff $tname
	show_failed_diff $result_file
	$ECHO
	if [ x$FORCE != x1 ] ; then
	 $ECHO "Aborting. To continue, re-run with '--force'."
+119 −0
Original line number Diff line number Diff line
show tables;
Tables_in_db
columns_priv
db
func
host
tables_priv
user
show create table db;
Table	Create Table
db	CREATE TABLE `db` (
  `Host` char(60) binary NOT NULL default '',
  `Db` char(64) binary NOT NULL default '',
  `User` char(16) binary NOT NULL default '',
  `Select_priv` enum('N','Y') NOT NULL default 'N',
  `Insert_priv` enum('N','Y') NOT NULL default 'N',
  `Update_priv` enum('N','Y') NOT NULL default 'N',
  `Delete_priv` enum('N','Y') NOT NULL default 'N',
  `Create_priv` enum('N','Y') NOT NULL default 'N',
  `Drop_priv` enum('N','Y') NOT NULL default 'N',
  `Grant_priv` enum('N','Y') NOT NULL default 'N',
  `References_priv` enum('N','Y') NOT NULL default 'N',
  `Index_priv` enum('N','Y') NOT NULL default 'N',
  `Alter_priv` enum('N','Y') NOT NULL default 'N',
  `Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N',
  `Lock_tables_priv` enum('N','Y') NOT NULL default 'N',
  PRIMARY KEY  (`Host`,`Db`,`User`),
  KEY `User` (`User`)
) TYPE=MyISAM COMMENT='Database privileges'
show create table host;
Table	Create Table
host	CREATE TABLE `host` (
  `Host` char(60) binary NOT NULL default '',
  `Db` char(64) binary NOT NULL default '',
  `Select_priv` enum('N','Y') NOT NULL default 'N',
  `Insert_priv` enum('N','Y') NOT NULL default 'N',
  `Update_priv` enum('N','Y') NOT NULL default 'N',
  `Delete_priv` enum('N','Y') NOT NULL default 'N',
  `Create_priv` enum('N','Y') NOT NULL default 'N',
  `Drop_priv` enum('N','Y') NOT NULL default 'N',
  `Grant_priv` enum('N','Y') NOT NULL default 'N',
  `References_priv` enum('N','Y') NOT NULL default 'N',
  `Index_priv` enum('N','Y') NOT NULL default 'N',
  `Alter_priv` enum('N','Y') NOT NULL default 'N',
  `Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N',
  `Lock_tables_priv` enum('N','Y') NOT NULL default 'N',
  PRIMARY KEY  (`Host`,`Db`)
) TYPE=MyISAM COMMENT='Host privileges;  Merged with database privileges'
show create table user;
Table	Create Table
user	CREATE TABLE `user` (
  `Host` varchar(60) binary NOT NULL default '',
  `User` varchar(16) binary NOT NULL default '',
  `Password` varchar(16) binary NOT NULL default '',
  `Select_priv` enum('N','Y') NOT NULL default 'N',
  `Insert_priv` enum('N','Y') NOT NULL default 'N',
  `Update_priv` enum('N','Y') NOT NULL default 'N',
  `Delete_priv` enum('N','Y') NOT NULL default 'N',
  `Create_priv` enum('N','Y') NOT NULL default 'N',
  `Drop_priv` enum('N','Y') NOT NULL default 'N',
  `Reload_priv` enum('N','Y') NOT NULL default 'N',
  `Shutdown_priv` enum('N','Y') NOT NULL default 'N',
  `Process_priv` enum('N','Y') NOT NULL default 'N',
  `File_priv` enum('N','Y') NOT NULL default 'N',
  `Grant_priv` enum('N','Y') NOT NULL default 'N',
  `References_priv` enum('N','Y') NOT NULL default 'N',
  `Index_priv` enum('N','Y') NOT NULL default 'N',
  `Alter_priv` enum('N','Y') NOT NULL default 'N',
  `Show_db_priv` enum('N','Y') NOT NULL default 'N',
  `Super_priv` enum('N','Y') NOT NULL default 'N',
  `Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N',
  `Lock_tables_priv` enum('N','Y') NOT NULL default 'N',
  `Execute_priv` enum('N','Y') NOT NULL default 'N',
  `Repl_slave_priv` enum('N','Y') NOT NULL default 'N',
  `Repl_client_priv` enum('N','Y') NOT NULL default 'N',
  `ssl_type` enum('','ANY','X509','SPECIFIED') NOT NULL default '',
  `ssl_cipher` blob NOT NULL,
  `x509_issuer` blob NOT NULL,
  `x509_subject` blob NOT NULL,
  `max_questions` int(11) unsigned NOT NULL default '0',
  `max_updates` int(11) unsigned NOT NULL default '0',
  `max_connections` int(11) unsigned NOT NULL default '0',
  PRIMARY KEY  (`Host`,`User`)
) TYPE=MyISAM COMMENT='Users and global privileges'
show create table func;
Table	Create Table
func	CREATE TABLE `func` (
  `name` char(64) NOT NULL default '',
  `ret` tinyint(1) NOT NULL default '0',
  `dl` char(128) NOT NULL default '',
  `type` enum('function','aggregate') NOT NULL default 'function',
  PRIMARY KEY  (`name`)
) TYPE=MyISAM COMMENT='User defined functions'
show create table tables_priv;
Table	Create Table
tables_priv	CREATE TABLE `tables_priv` (
  `Host` char(60) binary NOT NULL default '',
  `Db` char(64) binary NOT NULL default '',
  `User` char(16) binary NOT NULL default '',
  `Table_name` char(64) binary NOT NULL default '',
  `Grantor` char(77) NOT NULL default '',
  `Timestamp` timestamp(14) NOT NULL,
  `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') NOT NULL default '',
  `Column_priv` set('Select','Insert','Update','References') NOT NULL default '',
  PRIMARY KEY  (`Host`,`Db`,`User`,`Table_name`),
  KEY `Grantor` (`Grantor`)
) TYPE=MyISAM COMMENT='Table privileges'
show create table columns_priv;
Table	Create Table
columns_priv	CREATE TABLE `columns_priv` (
  `Host` char(60) binary NOT NULL default '',
  `Db` char(64) binary NOT NULL default '',
  `User` char(16) binary NOT NULL default '',
  `Table_name` char(64) binary NOT NULL default '',
  `Column_name` char(64) binary NOT NULL default '',
  `Timestamp` timestamp(14) NOT NULL,
  `Column_priv` set('Select','Insert','Update','References') NOT NULL default '',
  PRIMARY KEY  (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
) TYPE=MyISAM COMMENT='Column privileges'
Loading