Merge heikki@bk-internal.mysql.com:/home/bk/mysql-5.0

into hundin.mysql.fi:/home/heikki/mysql-5.0
This commit is contained in:
unknown 2005-06-27 16:14:24 +03:00
commit d94c774531
53 changed files with 884 additions and 196 deletions

View file

@ -57,6 +57,7 @@
#define EX_CONSCHECK 3
#define EX_EOM 4
#define EX_EOF 5 /* ferror for output file was got */
#define EX_ILLEGAL_TABLE 6
/* index into 'show fields from table' */
@ -142,14 +143,6 @@ const char *compatible_mode_names[]=
TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1,
"", compatible_mode_names, NULL};
#define TABLE_RULE_HASH_SIZE 16
typedef struct st_table_rule_ent
{
char* key; /* dbname.tablename */
uint key_len;
} TABLE_RULE_ENT;
HASH ignore_table;
static struct my_option my_long_options[] =
@ -476,7 +469,10 @@ static void write_header(FILE *sql_file, char *db_name)
if (opt_xml)
{
fputs("<?xml version=\"1.0\"?>\n", sql_file);
fputs("<mysqldump>\n", sql_file);
fputs("<mysqldump ", sql_file);
fputs("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"",
sql_file);
fputs(">\n", sql_file);
check_io(sql_file);
}
else if (!opt_compact)
@ -544,29 +540,21 @@ static void write_footer(FILE *sql_file)
} /* write_footer */
static void free_table_ent(TABLE_RULE_ENT* e)
byte* get_table_key(const char *entry, uint *length,
my_bool not_used __attribute__((unused)))
{
my_free((gptr) e, MYF(0));
}
static byte* get_table_key(TABLE_RULE_ENT* e, uint* len,
my_bool not_used __attribute__((unused)))
{
*len= e->key_len;
return (byte*)e->key;
*length= strlen(entry);
return (byte*) entry;
}
void init_table_rule_hash(HASH* h)
{
if(hash_init(h, charset_info, TABLE_RULE_HASH_SIZE, 0, 0,
(hash_get_key) get_table_key,
(hash_free_key) free_table_ent, 0))
if(hash_init(h, charset_info, 16, 0, 0,
(hash_get_key) get_table_key, 0, 0))
exit(EX_EOM);
}
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
@ -639,25 +627,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case (int) OPT_IGNORE_TABLE:
{
uint len= (uint)strlen(argument);
TABLE_RULE_ENT* e;
if (!strchr(argument, '.'))
{
fprintf(stderr, "Illegal use of option --ignore-table=<database>.<table>\n");
exit(1);
}
/* len is always > 0 because we know the there exists a '.' */
e= (TABLE_RULE_ENT*)my_malloc(sizeof(TABLE_RULE_ENT) + len, MYF(MY_WME));
if (!e)
exit(EX_EOM);
e->key= (char*)e + sizeof(TABLE_RULE_ENT);
e->key_len= len;
memcpy(e->key, argument, len);
if (!hash_inited(&ignore_table))
init_table_rule_hash(&ignore_table);
if(my_hash_insert(&ignore_table, (byte*)e))
if (my_hash_insert(&ignore_table, (byte*)my_strdup(argument, MYF(0))))
exit(EX_EOM);
break;
}
@ -980,7 +958,28 @@ static char *quote_name(const char *name, char *buff, my_bool force)
return buff;
} /* quote_name */
/*
Quote a table name so it can be used in "SHOW TABLES LIKE <tabname>"
SYNOPSIS
quote_for_like
name - name of the table
buff - quoted name of the table
DESCRIPTION
Quote \, _, ' and % characters
Note: Because MySQL uses the C escape syntax in strings
(for example, '\n' to represent newline), you must double
any '\' that you use in your LIKE strings. For example, to
search for '\n', specify it as '\\n'. To search for '\', specify
it as '\\\\' (the backslashes are stripped once by the parser
and another time when the pattern match is done, leaving a
single backslash to be matched).
Example: "t\1" => "t\\\\1"
*/
static char *quote_for_like(const char *name, char *buff)
{
@ -988,7 +987,13 @@ static char *quote_for_like(const char *name, char *buff)
*to++= '\'';
while (*name)
{
if (*name == '\'' || *name == '_' || *name == '\\' || *name == '%')
if (*name == '\\')
{
*to++='\\';
*to++='\\';
*to++='\\';
}
else if (*name == '\'' || *name == '_' || *name == '%')
*to++= '\\';
*to++= *name++;
}
@ -1073,6 +1078,40 @@ static void print_xml_tag1(FILE * xml_file, const char* sbeg,
}
/*
Print xml tag with for a field that is null
SYNOPSIS
print_xml_null_tag()
xml_file - output file
sbeg - line beginning
stag_atr - tag and attribute
sval - value of attribute
send - line ending
DESCRIPTION
Print tag with one attribute to the xml_file. Format is:
<stag_atr="sval" xsi:nil="true"/>
NOTE
sval MUST be a NULL terminated string.
sval string will be qouted before output.
*/
static void print_xml_null_tag(FILE * xml_file, const char* sbeg,
const char* stag_atr, const char* sval,
const char* send)
{
fputs(sbeg, xml_file);
fputs("<", xml_file);
fputs(stag_atr, xml_file);
fputs("\"", xml_file);
print_quoted_xml(xml_file, sval, strlen(sval));
fputs("\" xsi:nil=\"true\" />", xml_file);
fputs(send, xml_file);
check_io(xml_file);
}
/*
Print xml tag with many attributes.
@ -1139,6 +1178,7 @@ static uint get_table_structure(char *table, char *db)
FILE *sql_file = md_result_file;
int len;
DBUG_ENTER("get_table_structure");
DBUG_PRINT("enter", ("db: %s, table: %s", db, table));
if (!insert_pat_inited)
{
@ -1592,6 +1632,26 @@ static void dump_table(uint numFields, char *table)
const char *table_type;
int error= 0;
/* Check --no-data flag */
if (dFlag)
{
if (verbose)
fprintf(stderr,
"-- Skipping dump data for table '%s', --no-data was used\n",
table);
return;
}
/* Check that there are any fields in the table */
if(numFields == 0)
{
if (verbose)
fprintf(stderr,
"-- Skipping dump data for table '%s', it has no fields\n",
table);
return;
}
result_table= quote_name(table,table_buff, 1);
opt_quoted_table= quote_name(table, table_buff2, 0);
@ -1912,7 +1972,14 @@ static void dump_table(uint numFields, char *table)
}
}
else
fputs("NULL", md_result_file);
{
/* The field value is NULL */
if (!opt_xml)
fputs("NULL", md_result_file);
else
print_xml_null_tag(md_result_file, "\t\t", "field name=",
field->name, "\n");
}
check_io(md_result_file);
}
}
@ -2201,8 +2268,7 @@ static int dump_all_tables_in_db(char *database)
if (include_table(hash_key, end - hash_key))
{
numrows = get_table_structure(table, database);
if (!dFlag && numrows > 0)
dump_table(numrows,table);
dump_table(numrows,table);
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
order_by= 0;
}
@ -2327,27 +2393,60 @@ static int get_actual_table_name(const char *old_table_name,
static int dump_selected_tables(char *db, char **table_names, int tables)
{
uint numrows;
int i;
uint numrows, i;
char table_buff[NAME_LEN*+3];
char new_table_name[NAME_LEN];
DYNAMIC_STRING lock_tables_query;
HASH dump_tables;
DBUG_ENTER("dump_selected_tables");
if (init_dumping(db))
return 1;
/* Init hash table for storing the actual name of tables to dump */
if (hash_init(&dump_tables, charset_info, 16, 0, 0,
(hash_get_key) get_table_key, 0, 0))
exit(EX_EOM);
init_dynamic_string(&lock_tables_query, "LOCK TABLES ", 256, 1024);
for (; tables > 0 ; tables-- , table_names++)
{
/* the table name passed on commandline may be wrong case */
if (!get_actual_table_name( *table_names,
new_table_name, sizeof(new_table_name) ))
{
/* Add found table name to lock_tables_query */
if (lock_tables)
{
dynstr_append(&lock_tables_query,
quote_name(new_table_name, table_buff, 1));
dynstr_append(&lock_tables_query, " READ /*!32311 LOCAL */,");
}
/* Add found table name to dump_tables list */
if (my_hash_insert(&dump_tables,
(byte*)my_strdup(new_table_name, MYF(0))))
exit(EX_EOM);
}
else
{
my_printf_error(0,"Couldn't find table: \"%s\"\n", MYF(0),
*table_names);
safe_exit(EX_ILLEGAL_TABLE);
/* We shall countinue here, if --force was given */
}
}
if (lock_tables)
{
DYNAMIC_STRING query;
init_dynamic_string(&query, "LOCK TABLES ", 256, 1024);
for (i=0 ; i < tables ; i++)
{
dynstr_append(&query, quote_name(table_names[i], table_buff, 1));
dynstr_append(&query, " READ /*!32311 LOCAL */,");
}
if (mysql_real_query(sock, query.str, query.length-1))
if (mysql_real_query(sock, lock_tables_query.str,
lock_tables_query.length-1))
DB_error(sock, "when doing LOCK TABLES");
/* We shall countinue here, if --force was given */
dynstr_free(&query);
}
dynstr_free(&lock_tables_query);
if (flush_logs)
{
if (mysql_refresh(sock, REFRESH_LOG))
@ -2356,25 +2455,29 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
}
if (opt_xml)
print_xml_tag1(md_result_file, "", "database name=", db, "\n");
for (i=0 ; i < tables ; i++)
{
char new_table_name[NAME_LEN];
/* the table name passed on commandline may be wrong case */
if (!get_actual_table_name( table_names[i], new_table_name,
sizeof(new_table_name)))
{
numrows= get_table_structure(new_table_name, db);
dump_table(numrows, new_table_name);
}
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
order_by= 0;
/* Dump each selected table */
const char *table_name;
for (i= 0; i < dump_tables.records; i++)
{
table_name= hash_element(&dump_tables, i);
DBUG_PRINT("info",("Dumping table %s", table_name));
numrows = get_table_structure(table_name, db);
dump_table(numrows, table_name);
}
/* Dump each selected view */
if (was_views)
{
for (i=0 ; i < tables ; i++)
get_view_structure(table_names[i], db);
for(i=0; i < dump_tables.records; i++)
{
table_name= hash_element(&dump_tables, i);
get_view_structure(table_name, db);
}
}
hash_free(&dump_tables);
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
order_by= 0;
if (opt_xml)
{
fputs("</database>\n", md_result_file);
@ -2382,7 +2485,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
}
if (lock_tables)
mysql_query_with_error_report(sock, 0, "UNLOCK TABLES");
return 0;
DBUG_RETURN(0);
} /* dump_selected_tables */
@ -2776,7 +2879,7 @@ int main(int argc, char **argv)
compatible_mode_normal_str[0]= 0;
default_charset= (char *)mysql_universal_client_charset;
MY_INIT(argv[0]);
MY_INIT("mysqldump");
if (get_options(&argc, &argv))
{
my_end(0);

View file

@ -60,6 +60,7 @@
#include <sys/stat.h>
#include <violite.h>
#include <regex.h> /* Our own version of lib */
#include <sys/wait.h>
#define MAX_QUERY 131072
#define MAX_VAR_NAME 256
#define MAX_COLUMNS 256
@ -986,9 +987,38 @@ static void do_exec(struct st_query* q)
replace_dynstr_append(ds, buf);
}
error= pclose(res_file);
if (error != 0)
die("command \"%s\" failed", cmd);
{
uint status= WEXITSTATUS(error);
if(q->abort_on_error)
die("At line %u: command \"%s\" failed", start_lineno, cmd);
else
{
DBUG_PRINT("info",
("error: %d, status: %d", error, status));
bool ok= 0;
uint i;
for (i=0 ; (uint) i < q->expected_errors ; i++)
{
DBUG_PRINT("info", ("expected error: %d", q->expected_errno[i].code.errnum));
if ((q->expected_errno[i].type == ERR_ERRNO) &&
(q->expected_errno[i].code.errnum == status))
ok= 1;
verbose_msg("At line %u: command \"%s\" failed with expected error: %d",
start_lineno, cmd, status);
}
if (!ok)
die("At line: %u: command \"%s\" failed with wrong error: %d",
start_lineno, cmd, status);
}
}
else if (q->expected_errno[0].type == ERR_ERRNO &&
q->expected_errno[0].code.errnum != 0)
{
/* Error code we wanted was != 0, i.e. not an expected success */
die("At line: %u: command \"%s\" succeeded - should have failed with errno %d...",
start_lineno, cmd, q->expected_errno[0].code.errnum);
}
if (!disable_result_log)
{

View file

@ -0,0 +1,4 @@
-- require r/not_openssl.require
disable_query_log;
show variables like "have_openssl";
enable_query_log;

View file

@ -33,7 +33,7 @@ eval create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,

View file

@ -707,6 +707,9 @@ MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --soc
if [ "x$USE_EMBEDDED_SERVER" = "x1" ]; then
MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST -A --language=$LANGUAGE -A --datadir=$SLAVE_MYDDIR -A --character-sets-dir=$CHARSETSDIR"
fi
# Save path and name of mysqldump
MYSQL_DUMP_DIR="$MYSQL_DUMP"
export MYSQL_DUMP_DIR
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
MYSQL_SHOW="$MYSQL_SHOW -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSHOW_OPT"
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT"

View file

@ -27,7 +27,7 @@ hdl_name varchar(30) default NULL,
prov_hdl_nr int(11) NOT NULL default '0',
auto_wirknetz varchar(50) default NULL,
auto_billing varchar(50) default NULL,
touch timestamp(14) NOT NULL,
touch timestamp NOT NULL,
kategorie varchar(50) default NULL,
kundentyp varchar(20) NOT NULL default '',
sammel_rech_msisdn varchar(30) NOT NULL default '',

View file

@ -15,7 +15,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
</row>
</resultset>
<?xml version="1.0"?>
<mysqldump>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="a&amp;b" Type="int(11)" Null="YES" Key="" Extra="" />

View file

@ -4,7 +4,7 @@ visitor_id int(10) unsigned DEFAULT '0' NOT NULL,
group_id int(10) unsigned DEFAULT '0' NOT NULL,
hits int(10) unsigned DEFAULT '0' NOT NULL,
sessions int(10) unsigned DEFAULT '0' NOT NULL,
ts timestamp(14),
ts timestamp,
PRIMARY KEY (visitor_id,group_id)
)/*! engine=MyISAM */;
INSERT INTO t1 VALUES (465931136,7,2,2,20000318160952);

View file

@ -120,6 +120,60 @@ hello
select des_decrypt(des_encrypt("hello",4),'password4');
des_decrypt(des_encrypt("hello",4),'password4')
hello
select des_encrypt("hello",10);
des_encrypt("hello",10)
NULL
Warnings:
Error 1108 Incorrect parameters to procedure 'des_encrypt'
select des_encrypt(NULL);
des_encrypt(NULL)
NULL
Warnings:
Error 1108 Incorrect parameters to procedure 'des_encrypt'
select des_encrypt(NULL, 10);
des_encrypt(NULL, 10)
NULL
Warnings:
Error 1108 Incorrect parameters to procedure 'des_encrypt'
select des_encrypt(NULL, NULL);
des_encrypt(NULL, NULL)
NULL
Warnings:
Error 1108 Incorrect parameters to procedure 'des_encrypt'
select des_encrypt(10, NULL);
des_encrypt(10, NULL)
NULL
Warnings:
Error 1108 Incorrect parameters to procedure 'des_encrypt'
select des_encrypt("hello", NULL);
des_encrypt("hello", NULL)
NULL
Warnings:
Error 1108 Incorrect parameters to procedure 'des_encrypt'
select des_decrypt("hello",10);
des_decrypt("hello",10)
hello
select des_decrypt(NULL);
des_decrypt(NULL)
NULL
Warnings:
Error 1108 Incorrect parameters to procedure 'des_decrypt'
select des_decrypt(NULL, 10);
des_decrypt(NULL, 10)
NULL
Warnings:
Error 1108 Incorrect parameters to procedure 'des_decrypt'
select des_decrypt(NULL, NULL);
des_decrypt(NULL, NULL)
NULL
Warnings:
Error 1108 Incorrect parameters to procedure 'des_decrypt'
select des_decrypt(10, NULL);
des_decrypt(10, NULL)
10
select des_decrypt("hello", NULL);
des_decrypt("hello", NULL)
hello
SET @a=des_decrypt(des_encrypt("hello"));
flush des_key_file;
select @a = des_decrypt(des_encrypt("hello"));
@ -134,6 +188,8 @@ NULL
select hex(des_decrypt(des_encrypt("hello","hidden")));
hex(des_decrypt(des_encrypt("hello","hidden")))
NULL
Warnings:
Error 1108 Incorrect parameters to procedure 'des_decrypt'
explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_decrypt(des_encrypt("hello","hidden"));
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used

View file

@ -0,0 +1,93 @@
select des_encrypt("test", 'akeystr');
des_encrypt("test", 'akeystr')
NULL
Warnings:
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", 1);
des_encrypt("test", 1)
NULL
Warnings:
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", 9);
des_encrypt("test", 9)
NULL
Warnings:
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", 100);
des_encrypt("test", 100)
NULL
Warnings:
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", NULL);
des_encrypt("test", NULL)
NULL
Warnings:
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt("test", 'anotherkeystr');
des_decrypt("test", 'anotherkeystr')
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(1, 1);
des_decrypt(1, 1)
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("test", 'thekey'));
des_decrypt(des_encrypt("test", 'thekey'))
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select hex(des_encrypt("hello")),des_decrypt(des_encrypt("hello"));
hex(des_encrypt("hello")) des_decrypt(des_encrypt("hello"))
NULL NULL
Warnings:
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello",4));
des_decrypt(des_encrypt("hello",4))
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello",'test'),'test');
des_decrypt(des_encrypt("hello",'test'),'test')
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select hex(des_encrypt("hello")),hex(des_encrypt("hello",5)),hex(des_encrypt("hello",'default_password'));
hex(des_encrypt("hello")) hex(des_encrypt("hello",5)) hex(des_encrypt("hello",'default_password'))
NULL NULL NULL
Warnings:
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello"),'default_password');
des_decrypt(des_encrypt("hello"),'default_password')
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello",4),'password4');
des_decrypt(des_encrypt("hello",4),'password4')
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
SET @a=des_decrypt(des_encrypt("hello"));
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
flush des_key_file;
select @a = des_decrypt(des_encrypt("hello"));
@a = des_decrypt(des_encrypt("hello"))
NULL
select hex("hello");
hex("hello")
68656C6C6F
select hex(des_decrypt(des_encrypt("hello",4),'password2'));
hex(des_decrypt(des_encrypt("hello",4),'password2'))
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select hex(des_decrypt(des_encrypt("hello","hidden")));
hex(des_decrypt(des_encrypt("hello","hidden")))
NULL
Warnings:
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working

View file

@ -264,7 +264,7 @@ category int(10) unsigned default NULL,
program int(10) unsigned default NULL,
bugdesc text,
created datetime default NULL,
modified timestamp(14) NOT NULL,
modified timestamp NOT NULL,
bugstatus int(10) unsigned default NULL,
submitter int(10) unsigned default NULL
) ENGINE=MyISAM;

View file

@ -465,7 +465,7 @@ extract(MONTH FROM "0000-00-00") extract(MONTH FROM d) extract(MONTH FROM dt) ex
drop table t1;
CREATE TABLE t1 ( start datetime default NULL);
INSERT INTO t1 VALUES ('2002-10-21 00:00:00'),('2002-10-28 00:00:00'),('2002-11-04 00:00:00');
CREATE TABLE t2 ( ctime1 timestamp(14) NOT NULL, ctime2 timestamp(14) NOT NULL);
CREATE TABLE t2 ( ctime1 timestamp NOT NULL, ctime2 timestamp NOT NULL);
INSERT INTO t2 VALUES (20021029165106,20021105164731);
CREATE TABLE t3 (ctime1 char(19) NOT NULL, ctime2 char(19) NOT NULL);
INSERT INTO t3 VALUES ("2002-10-29 16:51:06","2002-11-05 16:47:31");

View file

@ -117,7 +117,7 @@ bug_file_loc text,
bug_severity enum('blocker','critical','major','normal','minor','trivial','enhancement') DEFAULT 'blocker' NOT NULL,
bug_status enum('','NEW','ASSIGNED','REOPENED','RESOLVED','VERIFIED','CLOSED') DEFAULT 'NEW' NOT NULL,
creation_ts datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
delta_ts timestamp(14),
delta_ts timestamp,
short_desc mediumtext,
long_desc mediumtext,
op_sys enum('All','Windows 3.1','Windows 95','Windows 98','Windows NT','Windows 2000','Linux','other') DEFAULT 'All' NOT NULL,

View file

@ -972,9 +972,9 @@ number bigint(20) NOT NULL default '0',
cname char(15) NOT NULL default '',
carrier_id smallint(6) NOT NULL default '0',
privacy tinyint(4) NOT NULL default '0',
last_mod_date timestamp(14) NOT NULL,
last_mod_date timestamp NOT NULL,
last_mod_id smallint(6) NOT NULL default '0',
last_app_date timestamp(14) NOT NULL,
last_app_date timestamp NOT NULL,
last_app_id smallint(6) default '-1',
version smallint(6) NOT NULL default '0',
assigned_scps int(11) default '0',
@ -991,9 +991,9 @@ number bigint(20) NOT NULL default '0',
cname char(15) NOT NULL default '',
carrier_id smallint(6) NOT NULL default '0',
privacy tinyint(4) NOT NULL default '0',
last_mod_date timestamp(14) NOT NULL,
last_mod_date timestamp NOT NULL,
last_mod_id smallint(6) NOT NULL default '0',
last_app_date timestamp(14) NOT NULL,
last_app_date timestamp NOT NULL,
last_app_id smallint(6) default '-1',
version smallint(6) NOT NULL default '0',
assigned_scps int(11) default '0',

View file

@ -5,7 +5,7 @@ drop view if exists v1, v2;
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1), (2);
<?xml version="1.0"?>
<mysqldump>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
@ -108,7 +108,7 @@ DROP TABLE t1;
CREATE TABLE t1(a int, b text, c varchar(3));
INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
<?xml version="1.0"?>
<mysqldump>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
@ -133,7 +133,7 @@ DROP TABLE t1;
CREATE TABLE t1 (`a"b"` char(2));
INSERT INTO t1 VALUES ("1\""), ("\"2");
<?xml version="1.0"?>
<mysqldump>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="a&quot;b&quot;" Type="char(2)" Null="YES" Key="" Extra="" />
@ -1471,3 +1471,169 @@ CREATE ALGORITHM=UNDEFINED VIEW `db1`.`v2` AS select `db1`.`t2`.`a` AS `a` from
drop table t2;
drop view v2;
drop database db1;
CREATE DATABASE mysqldump_test_db;
USE mysqldump_test_db;
CREATE TABLE t1 ( a INT );
CREATE TABLE t2 ( a INT );
INSERT INTO t1 VALUES (1), (2);
INSERT INTO t2 VALUES (1), (2);
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `t2`;
CREATE TABLE `t2` (
`a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `t2`;
CREATE TABLE `t2` (
`a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
<?xml version="1.0"?>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="mysqldump_test_db">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
</table_structure>
<table_structure name="t2">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
</table_structure>
</database>
</mysqldump>
<?xml version="1.0"?>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="mysqldump_test_db">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
</table_structure>
<table_structure name="t2">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
</table_structure>
</database>
</mysqldump>
DROP TABLE t1, t2;
DROP DATABASE mysqldump_test_db;
create database mysqldump_test_db;
use mysqldump_test_db;
create table t1(a varchar(30) primary key, b int not null);
create table t2(a varchar(30) primary key, b int not null);
create table t3(a varchar(30) primary key, b int not null);
test_sequence
------ Testing with illegal table names ------
mysqldump: Couldn't find table: "\d-2-1.sql"
mysqldump: Couldn't find table: "\t1"
mysqldump: Couldn't find table: "\t1"
mysqldump: Couldn't find table: "\\t1"
mysqldump: Couldn't find table: "t\1"
mysqldump: Couldn't find table: "t\1"
mysqldump: Couldn't find table: "t/1"
test_sequence
------ Testing with illegal database names ------
mysqldump: Got error: 1049: Unknown database 'mysqldump_test_d' when selecting the database
mysqldump: Got error: 1102: Incorrect database name 'mysqld\ump_test_db' when selecting the database
drop table t1, t2, t3;
drop database mysqldump_test_db;
use test;
create table t1 (a int(10));
create table t2 (pk int primary key auto_increment,
a int(10), b varchar(30), c datetime, d blob, e text);
insert into t1 values (NULL), (10), (20);
insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thirty");
<?xml version="1.0"?>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_data name="t1">
<row>
<field name="a" xsi:nil="true" />
</row>
<row>
<field name="a">10</field>
</row>
<row>
<field name="a">20</field>
</row>
</table_data>
<table_data name="t2">
<row>
<field name="pk">1</field>
<field name="a" xsi:nil="true" />
<field name="b" xsi:nil="true" />
<field name="c" xsi:nil="true" />
<field name="d" xsi:nil="true" />
<field name="e" xsi:nil="true" />
</row>
<row>
<field name="pk">2</field>
<field name="a">10</field>
<field name="b" xsi:nil="true" />
<field name="c" xsi:nil="true" />
<field name="d" xsi:nil="true" />
<field name="e" xsi:nil="true" />
</row>
<row>
<field name="pk">3</field>
<field name="a" xsi:nil="true" />
<field name="b">twenty</field>
<field name="c" xsi:nil="true" />
<field name="d" xsi:nil="true" />
<field name="e" xsi:nil="true" />
</row>
<row>
<field name="pk">4</field>
<field name="a">30</field>
<field name="b">thirty</field>
<field name="c" xsi:nil="true" />
<field name="d" xsi:nil="true" />
<field name="e" xsi:nil="true" />
</row>
</table_data>
</database>
</mysqldump>
drop table t1, t2;

View file

@ -93,7 +93,7 @@ name char(20), a int, b float, c char(24)
ERROR 42S01: Table 't3' already exists
show status like 'handler_discover%';
Variable_name Value
Handler_discover 1
Handler_discover 0
create table IF NOT EXISTS t3(
id int not null primary key,
id2 int not null,
@ -101,7 +101,7 @@ name char(20)
) engine=ndb;
show status like 'handler_discover%';
Variable_name Value
Handler_discover 2
Handler_discover 0
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
@ -114,7 +114,7 @@ id name
1 Explorer
show status like 'handler_discover%';
Variable_name Value
Handler_discover 2
Handler_discover 1
drop table t3;
flush status;
create table t7(
@ -383,6 +383,20 @@ select * from t1;
ERROR HY000: Can't lock file (errno: 4009)
use test;
drop database test_only_ndb_tables;
CREATE TABLE sys.SYSTAB_0 (a int);
ERROR 42S01: Table 'SYSTAB_0' already exists
select * from sys.SYSTAB_0;
ERROR HY000: Failed to open 'SYSTAB_0', error while unpacking from engine
CREATE TABLE IF NOT EXISTS sys.SYSTAB_0 (a int);
show warnings;
Level Code Message
select * from sys.SYSTAB_0;
ERROR HY000: Failed to open 'SYSTAB_0', error while unpacking from engine
drop table sys.SYSTAB_0;
ERROR 42S02: Unknown table 'SYSTAB_0'
drop table IF EXISTS sys.SYSTAB_0;
Warnings:
Note 1051 Unknown table 'SYSTAB_0'
CREATE TABLE t9 (
a int NOT NULL PRIMARY KEY,
b int

View file

@ -0,0 +1,2 @@
Variable_name Value
have_openssl NO

View file

@ -138,7 +138,7 @@ create table t1
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 bit, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,

View file

@ -17,7 +17,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,

View file

@ -10,7 +10,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,

View file

@ -10,7 +10,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,

View file

@ -11,7 +11,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 varchar(100), c24 varchar(100),
c25 varchar(100), c26 varchar(100), c27 varchar(100), c28 varchar(100),

View file

@ -12,7 +12,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
@ -32,7 +32,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
@ -52,7 +52,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
@ -3064,7 +3064,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,

View file

@ -10,7 +10,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,

View file

@ -10,7 +10,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,

View file

@ -2073,7 +2073,7 @@ INSERT INTO t1 (pseudo) VALUES ('test1');
SELECT 1 as rnd1 from t1 where rand() > 2;
rnd1
DROP TABLE t1;
CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp(14) NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL);
CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35);

View file

@ -99,6 +99,14 @@ drop table t1;
create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6),
t8 timestamp(8), t10 timestamp(10), t12 timestamp(12),
t14 timestamp(14));
Warnings:
Warning 1287 'TIMESTAMP(2)' is deprecated; use 'TIMESTAMP' instead
Warning 1287 'TIMESTAMP(4)' is deprecated; use 'TIMESTAMP' instead
Warning 1287 'TIMESTAMP(6)' is deprecated; use 'TIMESTAMP' instead
Warning 1287 'TIMESTAMP(8)' is deprecated; use 'TIMESTAMP' instead
Warning 1287 'TIMESTAMP(10)' is deprecated; use 'TIMESTAMP' instead
Warning 1287 'TIMESTAMP(12)' is deprecated; use 'TIMESTAMP' instead
Warning 1287 'TIMESTAMP(14)' is deprecated; use 'TIMESTAMP' instead
insert t1 values (0,0,0,0,0,0,0),
("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",

View file

@ -58,7 +58,7 @@ ushows int(10) unsigned DEFAULT '0' NOT NULL,
clicks int(10) unsigned DEFAULT '0' NOT NULL,
iclicks int(10) unsigned DEFAULT '0' NOT NULL,
uclicks int(10) unsigned DEFAULT '0' NOT NULL,
ts timestamp(14),
ts timestamp,
PRIMARY KEY (place_id,ts)
);
INSERT INTO t1 (place_id,shows,ishows,ushows,clicks,iclicks,uclicks,ts)
@ -75,7 +75,7 @@ client varchar(255) NOT NULL default '',
replyto varchar(255) NOT NULL default '',
subject varchar(100) NOT NULL default '',
timestamp int(10) unsigned NOT NULL default '0',
tstamp timestamp(14) NOT NULL,
tstamp timestamp NOT NULL,
status int(3) NOT NULL default '0',
type varchar(15) NOT NULL default '',
assignment int(10) unsigned NOT NULL default '0',

View file

@ -30,7 +30,7 @@ CREATE TABLE t1 (
prov_hdl_nr int(11) NOT NULL default '0',
auto_wirknetz varchar(50) default NULL,
auto_billing varchar(50) default NULL,
touch timestamp(14) NOT NULL,
touch timestamp NOT NULL,
kategorie varchar(50) default NULL,
kundentyp varchar(20) NOT NULL default '',
sammel_rech_msisdn varchar(30) NOT NULL default '',

View file

@ -11,7 +11,7 @@ CREATE TABLE t1 (
group_id int(10) unsigned DEFAULT '0' NOT NULL,
hits int(10) unsigned DEFAULT '0' NOT NULL,
sessions int(10) unsigned DEFAULT '0' NOT NULL,
ts timestamp(14),
ts timestamp,
PRIMARY KEY (visitor_id,group_id)
)/*! engine=MyISAM */;
INSERT INTO t1 VALUES (465931136,7,2,2,20000318160952);

View file

@ -59,6 +59,22 @@ select hex(des_encrypt("hello")),hex(des_encrypt("hello",5)),hex(des_encrypt("he
select des_decrypt(des_encrypt("hello"),'default_password');
select des_decrypt(des_encrypt("hello",4),'password4');
# Test use of invalid parameters
select des_encrypt("hello",10);
select des_encrypt(NULL);
select des_encrypt(NULL, 10);
select des_encrypt(NULL, NULL);
select des_encrypt(10, NULL);
select des_encrypt("hello", NULL);
select des_decrypt("hello",10);
select des_decrypt(NULL);
select des_decrypt(NULL, 10);
select des_decrypt(NULL, NULL);
select des_decrypt(10, NULL);
select des_decrypt("hello", NULL);
# Test flush
SET @a=des_decrypt(des_encrypt("hello"));
flush des_key_file;

View file

@ -0,0 +1,36 @@
-- source include/not_openssl.inc
#
# Test output from des_encrypt and des_decrypt when server is
# compiled without openssl suuport
#
select des_encrypt("test", 'akeystr');
select des_encrypt("test", 1);
select des_encrypt("test", 9);
select des_encrypt("test", 100);
select des_encrypt("test", NULL);
select des_decrypt("test", 'anotherkeystr');
select des_decrypt(1, 1);
select des_decrypt(des_encrypt("test", 'thekey'));
#
# Test default keys
#
select hex(des_encrypt("hello")),des_decrypt(des_encrypt("hello"));
select des_decrypt(des_encrypt("hello",4));
select des_decrypt(des_encrypt("hello",'test'),'test');
select hex(des_encrypt("hello")),hex(des_encrypt("hello",5)),hex(des_encrypt("hello",'default_password'));
select des_decrypt(des_encrypt("hello"),'default_password');
select des_decrypt(des_encrypt("hello",4),'password4');
# Test flush
SET @a=des_decrypt(des_encrypt("hello"));
flush des_key_file;
select @a = des_decrypt(des_encrypt("hello"));
# Test usage of wrong password
select hex("hello");
select hex(des_decrypt(des_encrypt("hello",4),'password2'));
select hex(des_decrypt(des_encrypt("hello","hidden")));

View file

@ -128,7 +128,7 @@ CREATE TABLE t1 (
program int(10) unsigned default NULL,
bugdesc text,
created datetime default NULL,
modified timestamp(14) NOT NULL,
modified timestamp NOT NULL,
bugstatus int(10) unsigned default NULL,
submitter int(10) unsigned default NULL
) ENGINE=MyISAM;

View file

@ -211,7 +211,7 @@ drop table t1;
CREATE TABLE t1 ( start datetime default NULL);
INSERT INTO t1 VALUES ('2002-10-21 00:00:00'),('2002-10-28 00:00:00'),('2002-11-04 00:00:00');
CREATE TABLE t2 ( ctime1 timestamp(14) NOT NULL, ctime2 timestamp(14) NOT NULL);
CREATE TABLE t2 ( ctime1 timestamp NOT NULL, ctime2 timestamp NOT NULL);
INSERT INTO t2 VALUES (20021029165106,20021105164731);
CREATE TABLE t3 (ctime1 char(19) NOT NULL, ctime2 char(19) NOT NULL);
INSERT INTO t3 VALUES ("2002-10-29 16:51:06","2002-11-05 16:47:31");

View file

@ -135,7 +135,7 @@ CREATE TABLE t1 (
bug_severity enum('blocker','critical','major','normal','minor','trivial','enhancement') DEFAULT 'blocker' NOT NULL,
bug_status enum('','NEW','ASSIGNED','REOPENED','RESOLVED','VERIFIED','CLOSED') DEFAULT 'NEW' NOT NULL,
creation_ts datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
delta_ts timestamp(14),
delta_ts timestamp,
short_desc mediumtext,
long_desc mediumtext,
op_sys enum('All','Windows 3.1','Windows 95','Windows 98','Windows NT','Windows 2000','Linux','other') DEFAULT 'All' NOT NULL,

View file

@ -660,9 +660,9 @@ CREATE TABLE t1 (
cname char(15) NOT NULL default '',
carrier_id smallint(6) NOT NULL default '0',
privacy tinyint(4) NOT NULL default '0',
last_mod_date timestamp(14) NOT NULL,
last_mod_date timestamp NOT NULL,
last_mod_id smallint(6) NOT NULL default '0',
last_app_date timestamp(14) NOT NULL,
last_app_date timestamp NOT NULL,
last_app_id smallint(6) default '-1',
version smallint(6) NOT NULL default '0',
assigned_scps int(11) default '0',
@ -679,9 +679,9 @@ CREATE TABLE t2 (
cname char(15) NOT NULL default '',
carrier_id smallint(6) NOT NULL default '0',
privacy tinyint(4) NOT NULL default '0',
last_mod_date timestamp(14) NOT NULL,
last_mod_date timestamp NOT NULL,
last_mod_id smallint(6) NOT NULL default '0',
last_app_date timestamp(14) NOT NULL,
last_app_date timestamp NOT NULL,
last_app_id smallint(6) default '-1',
version smallint(6) NOT NULL default '0',
assigned_scps int(11) default '0',

View file

@ -565,7 +565,6 @@ INSERT INTO t1 VALUES (1),(2),(3);
--exec $MYSQL_DUMP --add-drop-database --skip-comments --databases test
DROP TABLE t1;
#
# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
#
@ -588,3 +587,94 @@ create view v2 as select * from t2 where a like 'a%' with check option;
drop table t2;
drop view v2;
drop database db1;
#
# Bug #9558 mysqldump --no-data db t1 t2 format still dumps data
#
CREATE DATABASE mysqldump_test_db;
USE mysqldump_test_db;
CREATE TABLE t1 ( a INT );
CREATE TABLE t2 ( a INT );
INSERT INTO t1 VALUES (1), (2);
INSERT INTO t2 VALUES (1), (2);
--exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db
--exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db t1 t2
--exec $MYSQL_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db
--exec $MYSQL_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db t1 t2
DROP TABLE t1, t2;
DROP DATABASE mysqldump_test_db;
#
# Testing with tables and databases that don't exists
# or contains illegal characters
# (Bug #9358 mysqldump crashes if tablename starts with \)
#
create database mysqldump_test_db;
use mysqldump_test_db;
create table t1(a varchar(30) primary key, b int not null);
create table t2(a varchar(30) primary key, b int not null);
create table t3(a varchar(30) primary key, b int not null);
--disable_query_log
select '------ Testing with illegal table names ------' as test_sequence ;
--enable_query_log
--error 6
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\d-2-1.sql" 2>&1
--error 6
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\t1" 2>&1
--error 6
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\t1" 2>&1
--error 6
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\\\t1" 2>&1
--error 6
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t\1" 2>&1
--error 6
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t\\1" 2>&1
--error 6
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t/1" 2>&1
--error 6
--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T_1"
--error 6
--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T%1"
--error 6
--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T'1"
--error 6
--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T_1"
--error 6
--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T_"
--disable_query_log
select '------ Testing with illegal database names ------' as test_sequence ;
--enable_query_log
--error 2
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_d 2>&1
--error 2
--exec $MYSQL_DUMP --compact --skip-comments "mysqld\ump_test_db" 2>&1
drop table t1, t2, t3;
drop database mysqldump_test_db;
use test;
#
# Bug #9657 mysqldump xml ( -x ) does not format NULL fields correctly
#
create table t1 (a int(10));
create table t2 (pk int primary key auto_increment,
a int(10), b varchar(30), c datetime, d blob, e text);
insert into t1 values (NULL), (10), (20);
insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thirty");
--exec $MYSQL_DUMP --skip-comments --xml --no-create-info test
drop table t1, t2;

View file

@ -494,6 +494,27 @@ select * from t1;
use test;
drop database test_only_ndb_tables;
#####################################################
# Test that it's not possible to create tables
# with same name as NDB internal tables
# This will also test that it's not possible to create
# a table with tha same name as a table that can't be
# discovered( for example a table created via NDBAPI)
--error 1050
CREATE TABLE sys.SYSTAB_0 (a int);
--error 1105
select * from sys.SYSTAB_0;
CREATE TABLE IF NOT EXISTS sys.SYSTAB_0 (a int);
show warnings;
--error 1105
select * from sys.SYSTAB_0;
--error 1051
drop table sys.SYSTAB_0;
drop table IF EXISTS sys.SYSTAB_0;
######################################################
# Note! This should always be the last step in this
# file, the table t9 will be used and dropped

View file

@ -149,7 +149,7 @@ create table t1
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 bit, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,

View file

@ -31,7 +31,7 @@ eval create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 varchar(100), c24 varchar(100),
c25 varchar(100), c26 varchar(100), c27 varchar(100), c28 varchar(100),

View file

@ -31,7 +31,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
@ -62,7 +62,7 @@ create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
c13 date, c14 datetime, c15 timestamp(14), c16 time,
c13 date, c14 datetime, c15 timestamp, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,

View file

@ -1789,7 +1789,7 @@ DROP TABLE t1;
# Test of bug with SUM(CASE...)
#
CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp(14) NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL);
CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35);

View file

@ -31,7 +31,7 @@ CREATE TABLE t1
clicks int(10) unsigned DEFAULT '0' NOT NULL,
iclicks int(10) unsigned DEFAULT '0' NOT NULL,
uclicks int(10) unsigned DEFAULT '0' NOT NULL,
ts timestamp(14),
ts timestamp,
PRIMARY KEY (place_id,ts)
);
@ -52,7 +52,7 @@ CREATE TABLE t1 (
replyto varchar(255) NOT NULL default '',
subject varchar(100) NOT NULL default '',
timestamp int(10) unsigned NOT NULL default '0',
tstamp timestamp(14) NOT NULL,
tstamp timestamp NOT NULL,
status int(3) NOT NULL default '0',
type varchar(15) NOT NULL default '',
assignment int(10) unsigned NOT NULL default '0',

View file

@ -4445,7 +4445,7 @@ int ndbcluster_discover(THD* thd, const char *db, const char *name,
{
const NdbError err= dict->getNdbError();
if (err.code == 709)
DBUG_RETURN(1);
DBUG_RETURN(-1);
ERR_RETURN(err);
}
DBUG_PRINT("info", ("Found table %s", tab->getName()));
@ -4453,13 +4453,15 @@ int ndbcluster_discover(THD* thd, const char *db, const char *name,
len= tab->getFrmLength();
if (len == 0 || tab->getFrmData() == NULL)
{
DBUG_PRINT("No frm data found",
("Table is probably created via NdbApi"));
DBUG_RETURN(2);
DBUG_PRINT("error", ("No frm data found."));
DBUG_RETURN(1);
}
if (unpackfrm(&data, &len, tab->getFrmData()))
DBUG_RETURN(3);
{
DBUG_PRINT("error", ("Could not unpack table"));
DBUG_RETURN(1);
}
*frmlen= len;
*frmblob= data;
@ -4472,11 +4474,11 @@ int ndbcluster_discover(THD* thd, const char *db, const char *name,
*/
int ndbcluster_table_exists(THD* thd, const char *db, const char *name)
int ndbcluster_table_exists_in_engine(THD* thd, const char *db, const char *name)
{
const NDBTAB* tab;
Ndb* ndb;
DBUG_ENTER("ndbcluster_table_exists");
DBUG_ENTER("ndbcluster_table_exists_in_engine");
DBUG_PRINT("enter", ("db: %s, name: %s", db, name));
if (!(ndb= check_ndb_in_thd(thd)))
@ -4655,7 +4657,7 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path,
DBUG_PRINT("info", ("%s existed on disk", name));
// The .ndb file exists on disk, but it's not in list of tables in ndb
// Verify that handler agrees table is gone.
if (ndbcluster_table_exists(thd, db, file_name) == 0)
if (ndbcluster_table_exists_in_engine(thd, db, file_name) == 0)
{
DBUG_PRINT("info", ("NDB says %s does not exists", file_name));
it.remove();
@ -4709,7 +4711,7 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path,
while ((file_name=it2++))
{
DBUG_PRINT("info", ("Table %s need discovery", name));
if (ha_create_table_from_engine(thd, db, file_name, TRUE) == 0)
if (ha_create_table_from_engine(thd, db, file_name) == 0)
files->push_back(thd->strdup(file_name));
}

View file

@ -681,7 +681,8 @@ int ndbcluster_discover(THD* thd, const char* dbname, const char* name,
const void** frmblob, uint* frmlen);
int ndbcluster_find_files(THD *thd,const char *db,const char *path,
const char *wild, bool dir, List<char> *files);
int ndbcluster_table_exists(THD* thd, const char *db, const char *name);
int ndbcluster_table_exists_in_engine(THD* thd,
const char *db, const char *name);
int ndbcluster_drop_database(const char* path);
void ndbcluster_print_error(int error, const NdbOperation *error_op);

View file

@ -1928,21 +1928,19 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
}
/*
Try to discover table from engine and
Try to discover table from engine and
if found, write the frm file to disk.
RETURN VALUES:
0 : Table existed in engine and created
on disk if so requested
1 : Table does not exist
>1 : error
-1 : Table did not exists
0 : Table created ok
> 0 : Error, table existed but could not be created
*/
int ha_create_table_from_engine(THD* thd,
const char *db,
const char *name,
bool create_if_found)
int ha_create_table_from_engine(THD* thd,
const char *db,
const char *name)
{
int error;
const void *frmblob;
@ -1951,45 +1949,47 @@ int ha_create_table_from_engine(THD* thd,
HA_CREATE_INFO create_info;
TABLE table;
DBUG_ENTER("ha_create_table_from_engine");
DBUG_PRINT("enter", ("name '%s'.'%s' create_if_found: %d",
db, name, create_if_found));
DBUG_PRINT("enter", ("name '%s'.'%s'",
db, name));
bzero((char*) &create_info,sizeof(create_info));
if ((error= ha_discover(thd, db, name, &frmblob, &frmlen)))
DBUG_RETURN(error);
/*
Table exists in handler
frmblob and frmlen are set
*/
if (create_if_found)
if(error= ha_discover(thd, db, name, &frmblob, &frmlen))
{
(void)strxnmov(path,FN_REFLEN,mysql_data_home,"/",db,"/",name,NullS);
// Save the frm file
if ((error = writefrm(path, frmblob, frmlen)))
goto err_end;
if (openfrm(thd, path,"",0,(uint) READ_ALL, 0, &table))
DBUG_RETURN(1);
update_create_info_from_table(&create_info, &table);
create_info.table_options|= HA_CREATE_FROM_ENGINE;
if (lower_case_table_names == 2 &&
!(table.file->table_flags() & HA_FILE_BASED))
{
/* Ensure that handler gets name in lower case */
my_casedn_str(files_charset_info, path);
}
error=table.file->create(path,&table,&create_info);
VOID(closefrm(&table));
// Table could not be discovered and thus not created
DBUG_RETURN(error);
}
err_end:
/*
Table exists in handler and could be discovered
frmblob and frmlen are set, write the frm to disk
*/
(void)strxnmov(path,FN_REFLEN,mysql_data_home,"/",db,"/",name,NullS);
// Save the frm file
if (writefrm(path, frmblob, frmlen))
{
my_free((char*) frmblob, MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN(2);
}
if (openfrm(thd, path,"",0,(uint) READ_ALL, 0, &table))
DBUG_RETURN(3);
update_create_info_from_table(&create_info, &table);
create_info.table_options|= HA_CREATE_FROM_ENGINE;
if (lower_case_table_names == 2 &&
!(table.file->table_flags() & HA_FILE_BASED))
{
/* Ensure that handler gets name in lower case */
my_casedn_str(files_charset_info, path);
}
error=table.file->create(path,&table,&create_info);
VOID(closefrm(&table));
my_free((char*) frmblob, MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN(error);
DBUG_RETURN(error != 0);
}
void st_ha_check_opt::init()
@ -2092,14 +2092,15 @@ int ha_change_key_cache(KEY_CACHE *old_key_cache,
Try to discover one table from handler(s)
RETURN
0 ok. In this case *frmblob and *frmlen are set
1 error. frmblob and frmlen may not be set
-1 : Table did not exists
0 : OK. In this case *frmblob and *frmlen are set
>0 : error. frmblob and frmlen may not be set
*/
int ha_discover(THD *thd, const char *db, const char *name,
const void **frmblob, uint *frmlen)
{
int error= 1; // Table does not exist in any handler
int error= -1; // Table does not exist in any handler
DBUG_ENTER("ha_discover");
DBUG_PRINT("enter", ("db: %s, name: %s", db, name));
#ifdef HAVE_NDBCLUSTER_DB
@ -2131,11 +2132,8 @@ ha_find_files(THD *thd,const char *db,const char *path,
error= ndbcluster_find_files(thd, db, path, wild, dir, files);
#endif
DBUG_RETURN(error);
}
#ifdef NOT_YET_USED
/*
Ask handler if the table exists in engine
@ -2146,20 +2144,19 @@ ha_find_files(THD *thd,const char *db,const char *path,
# Error code
*/
int ha_table_exists(THD* thd, const char* db, const char* name)
int ha_table_exists_in_engine(THD* thd, const char* db, const char* name)
{
int error= 2;
DBUG_ENTER("ha_table_exists");
int error= 0;
DBUG_ENTER("ha_table_exists_in_engine");
DBUG_PRINT("enter", ("db: %s, name: %s", db, name));
#ifdef HAVE_NDBCLUSTER_DB
if (have_ndbcluster == SHOW_OPTION_YES)
error= ndbcluster_table_exists(thd, db, name);
error= ndbcluster_table_exists_in_engine(thd, db, name);
#endif
DBUG_PRINT("exit", ("error: %d", error));
DBUG_RETURN(error);
}
#endif
/*
Read the first row of a multi-range set.

View file

@ -831,13 +831,12 @@ int ha_delete_table(THD *thd, enum db_type db_type, const char *path,
const char *alias, bool generate_warning);
/* discovery */
int ha_create_table_from_engine(THD* thd, const char *db, const char *name,
bool create_if_found);
int ha_create_table_from_engine(THD* thd, const char *db, const char *name);
int ha_discover(THD* thd, const char* dbname, const char* name,
const void** frmblob, uint* frmlen);
int ha_find_files(THD *thd,const char *db,const char *path,
const char *wild, bool dir,List<char>* files);
int ha_table_exists(THD* thd, const char* db, const char* name);
int ha_table_exists_in_engine(THD* thd, const char* db, const char* name);
/* key cache */
int ha_init_key_cache(const char *name, KEY_CACHE *key_cache);

View file

@ -363,6 +363,7 @@ String *Item_func_des_encrypt::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
#ifdef HAVE_OPENSSL
uint code= ER_WRONG_PARAMETERS_TO_PROCEDURE;
DES_cblock ivec;
struct st_des_keyblock keyblock;
struct st_des_keyschedule keyschedule;
@ -371,7 +372,7 @@ String *Item_func_des_encrypt::val_str(String *str)
String *res= args[0]->val_str(str);
if ((null_value=args[0]->null_value))
return 0;
goto error;
if ((res_length=res->length()) == 0)
return &my_empty_string;
@ -419,6 +420,7 @@ String *Item_func_des_encrypt::val_str(String *str)
tail= (8-(res_length) % 8); // 1..8 marking extra length
res_length+=tail;
code= ER_OUT_OF_RESOURCES;
if (tail && res->append(append_str, tail) || tmp_value.alloc(res_length+1))
goto error;
(*res)[res_length-1]=tail; // save extra length
@ -436,6 +438,13 @@ String *Item_func_des_encrypt::val_str(String *str)
return &tmp_value;
error:
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
code, ER(code),
"des_encrypt");
#else
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_FEATURE_DISABLED, ER(ER_FEATURE_DISABLED),
"des_encrypt","--with-openssl");
#endif /* HAVE_OPENSSL */
null_value=1;
return 0;
@ -446,6 +455,7 @@ String *Item_func_des_decrypt::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
#ifdef HAVE_OPENSSL
uint code= ER_WRONG_PARAMETERS_TO_PROCEDURE;
DES_key_schedule ks1, ks2, ks3;
DES_cblock ivec;
struct st_des_keyblock keyblock;
@ -454,7 +464,7 @@ String *Item_func_des_decrypt::val_str(String *str)
uint length=res->length(),tail;
if ((null_value=args[0]->null_value))
return 0;
goto error;
length=res->length();
if (length < 9 || (length % 8) != 1 || !((*res)[0] & 128))
return res; // Skip decryption if not encrypted
@ -485,6 +495,7 @@ String *Item_func_des_decrypt::val_str(String *str)
DES_set_key_unchecked(&keyblock.key2,&keyschedule.ks2);
DES_set_key_unchecked(&keyblock.key3,&keyschedule.ks3);
}
code= ER_OUT_OF_RESOURCES;
if (tmp_value.alloc(length-1))
goto error;
@ -498,11 +509,19 @@ String *Item_func_des_decrypt::val_str(String *str)
&ivec, FALSE);
/* Restore old length of key */
if ((tail=(uint) (uchar) tmp_value[length-2]) > 8)
goto error; // Wrong key
goto wrong_key; // Wrong key
tmp_value.length(length-1-tail);
return &tmp_value;
error:
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
code, ER(code),
"des_decrypt");
wrong_key:
#else
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_FEATURE_DISABLED, ER(ER_FEATURE_DISABLED),
"des_decrypt","--with-openssl");
#endif /* HAVE_OPENSSL */
null_value=1;
return 0;

View file

@ -5021,7 +5021,7 @@ ER_NON_UPDATABLE_TABLE
por "A tabela destino %-.100s do %s não é atualizável"
rus "ôÁÂÌÉÃÁ %-.100s × %s ÎÅ ÍÏÖÅÔ ÉÚÍÅÎÑÔÓÑ"
spa "La tabla destino %-.100s del %s no es actualizable"
swe "Tabel %-.100s använd med '%s' är inte uppdateringsbar"
swe "Tabell %-.100s använd med '%s' är inte uppdateringsbar"
ukr "ôÁÂÌÉÃÑ %-.100s Õ %s ÎÅ ÍÏÖÅ ÏÎÏ×ÌÀ×ÁÔÉÓØ"
ER_FEATURE_DISABLED
eng "The '%s' feature is disabled; you need MySQL built with '%s' to have it working"

View file

@ -1611,8 +1611,18 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
*/
if (discover_retry_count++ != 0)
goto err;
if (ha_create_table_from_engine(thd, db, name, TRUE) != 0)
if (ha_create_table_from_engine(thd, db, name) > 0)
{
/* Give right error message */
thd->clear_error();
DBUG_PRINT("error", ("Dicovery of %s/%s failed", db, name));
my_printf_error(ER_UNKNOWN_ERROR,
"Failed to open '%-.64s', error while "
"unpacking from engine",
MYF(0), name);
goto err;
}
mysql_reset_errors(thd, 1); // Clear warnings
thd->clear_error(); // Clear error message

View file

@ -5493,6 +5493,21 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
DBUG_RETURN(1);
}
if (type == FIELD_TYPE_TIMESTAMP && length)
{
/* Display widths are no longer supported for TIMSTAMP as of MySQL 4.1.
In other words, for declarations such as TIMESTAMP(2), TIMESTAMP(4),
and so on, the display width is ignored.
*/
char buf[32];
my_snprintf(buf, sizeof(buf),
"TIMESTAMP(%s)", length, system_charset_info);
push_warning_printf(thd,MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DEPRECATED_SYNTAX,
ER(ER_WARN_DEPRECATED_SYNTAX),
buf, "TIMESTAMP");
}
if (!(new_field= new_create_field(thd, field_name, type, length, decimals,
type_modifier, default_value, on_update_value,
comment, change, interval_list, cs, uint_geom_type)))

View file

@ -5986,6 +5986,8 @@ void JOIN::cleanup(bool full)
*/
if (full)
{
if (tmp_join)
tmp_table_param.copy_field= 0;
group_fields.delete_elements();
/*
We can't call delete_elements() on copy_funcs as this will cause

View file

@ -256,16 +256,18 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
build_table_path(path, sizeof(path), db, alias, reg_ext);
}
if (drop_temporary ||
(access(path,F_OK) &&
ha_create_table_from_engine(thd,db,alias,TRUE)) ||
(access(path,F_OK) &&
ha_create_table_from_engine(thd,db,alias)) ||
(!drop_view && mysql_frm_type(path) != FRMTYPE_TABLE))
{
// Table was not found on disk and table can't be created from engine
if (if_exists)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_BAD_TABLE_ERROR, ER(ER_BAD_TABLE_ERROR),
table->table_name);
else
error= 1;
error= 1;
}
else
{
@ -1604,15 +1606,14 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
{
bool create_if_not_exists =
create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS;
if (!ha_create_table_from_engine(thd, db, table_name,
create_if_not_exists))
if (ha_table_exists_in_engine(thd, db, table_name))
{
DBUG_PRINT("info", ("Table already existed in handler"));
DBUG_PRINT("info", ("Table with same name already existed in handler"));
if (create_if_not_exists)
{
create_info->table_existed= 1; // Mark that table existed
error= FALSE;
create_info->table_existed= 1; // Mark that table existed
error= FALSE;
}
else
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);