Commit b1f07034 authored by psergey@psergey-rh8.(none)'s avatar psergey@psergey-rh8.(none)

Merge psergey-rh8.(none):/home/psergey/mysql-5.0-latest-pull

into psergey-rh8.(none):/home/psergey/mysql-5.0-imerge-unique
parents 67c6d511 ecf54df9
......@@ -49,6 +49,7 @@ jani@dsl-kpogw4gb5.dial.inet.fi
jani@hynda.(none)
jani@hynda.mysql.fi
jani@janikt.pp.saunalahti.fi
jani@linux.local
jani@rhols221.adsl.netsonic.fi
jani@rhols221.arenanet.fi
jani@ua126d19.elisa.omakaista.fi
......@@ -105,6 +106,7 @@ peter@mysql.com
peterg@mysql.com
pgulutzan@linux.local
pmartin@build.mysql2.com
psergey@psergey-rh8.(none)
psergey@psergey.(none)
ram@deer.(none)
ram@gw.mysql.r18.ru
......
......@@ -1052,4 +1052,49 @@
/* Remove an SP from cache */
void sp_cache_remove(sp_cache **cp, sp_head *sp);
--
- The mysql.proc schema:
CREATE TABLE proc (
db char(64) binary DEFAULT '' NOT NULL,
name char(64) binary DEFAULT '' NOT NULL,
type enum('FUNCTION','PROCEDURE') NOT NULL,
specific_name char(64) binary DEFAULT '' NOT NULL,
language enum('SQL') DEFAULT 'SQL' NOT NULL,
sql_data_access enum('CONTAINS_SQL') DEFAULT 'CONTAINS_SQL' NOT NULL,
is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL,
security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL,
param_list blob DEFAULT '' NOT NULL,
returns char(64) DEFAULT '' NOT NULL,
body blob DEFAULT '' NOT NULL,
definer char(77) binary DEFAULT '' NOT NULL,
created timestamp,
modified timestamp,
sql_mode set(
'REAL_AS_FLOAT',
'PIPES_AS_CONCAT',
'ANSI_QUOTES',
'IGNORE_SPACE',
'NOT_USED',
'ONLY_FULL_GROUP_BY',
'NO_UNSIGNED_SUBTRACTION',
'NO_DIR_IN_CREATE',
'POSTGRESQL',
'ORACLE',
'MSSQL',
'DB2',
'MAXDB',
'NO_KEY_OPTIONS',
'NO_TABLE_OPTIONS',
'NO_FIELD_OPTIONS',
'MYSQL323',
'MYSQL40',
'ANSI',
'NO_AUTO_VALUE_ON_ZERO'
) DEFAULT 0 NOT NULL,
comment char(64) binary DEFAULT '' NOT NULL,
PRIMARY KEY (db,name,type)
) comment='Stored Procedures';
--
\ No newline at end of file
Stored Procedures implemented 2003-09-16:
Stored Procedures implemented 2003-12-10:
Summary of Not Yet Implemented:
- SQL queries (like SELECT, INSERT, UPDATE etc) in FUNCTION bodies
- SQL statements using table (like SELECT, INSERT, UPDATE etc)
in FUNCTIONs
- External languages
- Access control
- Routine characteristics (mostly used for external languages)
......@@ -25,18 +26,28 @@ Summary of what's implemented:
- Prepared SP caching
- CONDITIONs and HANDLERs
- Simple read-only CURSORs.
- SHOW DECLARE PROCEDURE/FUNCTION and SHOW PROCEDURE/FUNCTION STATUS
List of what's implemented:
- CREATE PROCEDURE|FUNCTION name ( args ) body
No routine characteristics yet.
List of what's implemented:
- ALTER PROCEDURE|FUNCTION name ...
Is parsed, but a no-op (as there are no characteristics implemented yet).
CASCADE/RESTRICT is not implemented (and CASCADE probably will not be).
- CREATE PROCEDURE|FUNCTION name ( args ) characteristics body
where characteristics is:
LANGUAGE SQL |
[NOT] DETERMINISTIC |
SQL SECURITY [DEFINER|INVOKER] |
COMMENT string
However the DETERMINISTIC setting is not currently used.
- ALTER PROCEDURE|FUNCTION name characteristics
CASCADE/RESTRICT is not implemented.
characteristics is:
COMMENT string |
SQL SECURITY [DEFINER|INVOKER] |
NAME newname
- DROP PROCEDURE|FUNCTION [IF EXISTS] name
CASCADE/RESTRICT is not implemented (and CASCADE probably will not be).
CASCADE/RESTRICT is not implemented.
- CALL name (args)
OUT and INOUT parameters are only supported for local variables, and
......@@ -92,23 +103,9 @@ List of what's implemented:
(The additional syntax will be added for completeness, but for the
most part unsupported with the current underlying cursor mechanism.)
Closed questions:
- What is the expected result when creating a procedure with a name that
already exists? An error or overwrite?
Answer: Error
- Do PROCEDUREs and FUNCTIONs share namespace or not? I think not, but the
we need to flag the type in the mysql.proc table and the name alone is
not a unique key any more, or, we have separate tables.
(Unfortunately, mysql.func is already taken. Use "sfunc" and maybe even
rename "proc" into "sproc" while we still can, for consistency?)
Answer: Same tables, with an additional key-field for the type.
Open questions/issues:
- SQL-99 variables and parameters are typed. For the present we don't do
any type checking, since this is the way MySQL works. I still don't know
if we should keep it this way, or implement type checking. Possibly we
should have optional, uset-settable, type checking.
- SHOW procedures and functions
SHOW DECLARE PROCEDURE|FUNCTION <name>
returns the definition of a routine.
SHOW PROCEDURE|FUNCTION STATUS [LIKE <pattern>]
returns characteristics of routines, like the name, type, creator,
creation and modification dates, etc.
......@@ -160,10 +160,22 @@ SOURCE="..\strings\ctype-tis620.c"
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-ucs2.c"
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-ujis.c"
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-utf8.c"
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-win1250ch.c"
# End Source File
# Begin Source File
SOURCE=..\strings\ctype.c
# End Source File
# Begin Source File
......
......@@ -179,10 +179,22 @@ SOURCE="..\strings\ctype-tis620.c"
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-ucs2.c"
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-ujis.c"
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-utf8.c"
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-win1250ch.c"
# End Source File
# Begin Source File
SOURCE=..\strings\ctype.c
# End Source File
# Begin Source File
......
......@@ -156,6 +156,10 @@ SOURCE=".\ctype-tis620.c"
# End Source File
# Begin Source File
SOURCE=".\ctype-ucs2.c"
# End Source File
# Begin Source File
SOURCE=".\ctype-ujis.c"
# End Source File
# Begin Source File
......
......@@ -37,7 +37,7 @@
** 10 Jun 2003: SET NAMES and --no-set-names by Alexander Barkov
*/
#define DUMP_VERSION "10.2"
#define DUMP_VERSION "10.3"
#include <my_global.h>
#include <my_sys.h>
......@@ -89,7 +89,11 @@ static char insert_pat[12 * 1024],*opt_password=0,*current_user=0,
*where=0,
*opt_compatible_mode_str= 0,
*err_ptr= 0;
#ifdef HAVE_CHARSET_utf8
static char *default_charset= (char*) "utf8";
#else
static char *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
#endif
static ulong opt_compatible_mode= 0;
static uint opt_mysql_port= 0, err_len= 0;
static my_string opt_mysql_unix_port=0;
......@@ -351,7 +355,7 @@ static void write_header(FILE *sql_file, char *db_name)
fprintf(sql_file, "-- Server version\t%s\n",
mysql_get_server_info(&mysql_connection));
if (!opt_set_names)
fprintf(sql_file,"\n/*!40101 SET NAMES %s*/;\n",default_charset);
fprintf(sql_file,"\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=%s */;\n",default_charset);
fprintf(md_result_file,"\
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n\
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n\
......@@ -372,6 +376,7 @@ static void write_footer(FILE *sql_file)
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\n\
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\n\
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;\n\
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n\
");
}
fputs("\n", sql_file);
......
This diff is collapsed.
......@@ -18,6 +18,7 @@
#include "heapdef.h"
#include <m_ctype.h>
#include <assert.h>
ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key,
uint start_key_len,
......@@ -566,50 +567,87 @@ my_bool hp_if_null_in_key(HP_KEYDEF *keydef, const byte *record)
return 0;
}
/*
Update auto_increment info
SYNOPSIS
update_auto_increment()
info MyISAM handler
record Row to update
IMPLEMENTATION
Only replace the auto_increment value if it is higher than the previous
one. For signed columns we don't update the auto increment value if it's
less than zero.
*/
void heap_update_auto_increment(HP_INFO *info, const byte *record)
{
ulonglong value;
ulonglong value= 0; /* Store unsigned values here */
longlong s_value= 0; /* Store signed values here */
HA_KEYSEG *keyseg= info->s->keydef[info->s->auto_key - 1].seg;
const uchar *key= (uchar*) record + keyseg->start;
switch (info->s->auto_key_type) {
case HA_KEYTYPE_INT8:
s_value= (longlong) *(char*)key;
break;
case HA_KEYTYPE_BINARY:
value= (ulonglong) *(uchar*) key;
value=(ulonglong) *(uchar*) key;
break;
case HA_KEYTYPE_SHORT_INT:
s_value= (longlong) sint2korr(key);
break;
case HA_KEYTYPE_USHORT_INT:
value= (ulonglong) uint2korr(key);
value=(ulonglong) uint2korr(key);
break;
case HA_KEYTYPE_LONG_INT:
s_value= (longlong) sint4korr(key);
break;
case HA_KEYTYPE_ULONG_INT:
value= (ulonglong) uint4korr(key);
value=(ulonglong) uint4korr(key);
break;
case HA_KEYTYPE_INT24:
s_value= (longlong) sint3korr(key);
break;
case HA_KEYTYPE_UINT24:
value= (ulonglong) uint3korr(key);
value=(ulonglong) uint3korr(key);
break;
case HA_KEYTYPE_FLOAT: /* This shouldn't be used */
case HA_KEYTYPE_FLOAT: /* This shouldn't be used */
{
float f_1;
float4get(f_1, key);
value= (ulonglong) f_1;
float4get(f_1,key);
/* Ignore negative values */
value = (f_1 < (float) 0.0) ? 0 : (ulonglong) f_1;
break;
}
case HA_KEYTYPE_DOUBLE: /* This shouldn't be used */
case HA_KEYTYPE_DOUBLE: /* This shouldn't be used */
{
double f_1;
float8get(f_1, key);
value= (ulonglong) f_1;
float8get(f_1,key);
/* Ignore negative values */
value = (f_1 < 0.0) ? 0 : (ulonglong) f_1;
break;
}
case HA_KEYTYPE_LONGLONG:
s_value= sint8korr(key);
break;
case HA_KEYTYPE_ULONGLONG:
value= uint8korr(key);
break;
default:
value= 0; /* Error */
DBUG_ASSERT(0);
value=0; /* Error */
break;
}
set_if_bigger(info->s->auto_increment, value);
/*
The following code works becasue if s_value < 0 then value is 0
and if s_value == 0 then value will contain either s_value or the
correct value.
*/
set_if_bigger(info->s->auto_increment,
(s_value > 0) ? (ulonglong) s_value : value);
}
......@@ -124,6 +124,8 @@ enum enum_server_command
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
#define SERVER_STATUS_MORE_RESULTS 4 /* More results on server */
#define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16
#define SERVER_QUERY_NO_INDEX_USED 32
#define MYSQL_ERRMSG_SIZE 512
#define NET_READ_TIMEOUT 30 /* Timeout on read */
......
......@@ -302,37 +302,38 @@
#define ER_UNKNOWN_KEY_CACHE 1283
#define ER_WARN_HOSTNAME_WONT_WORK 1284
#define ER_UNKNOWN_TABLE_ENGINE 1285
#define ER_SP_NO_RECURSIVE_CREATE 1286
#define ER_SP_ALREADY_EXISTS 1287
#define ER_SP_DOES_NOT_EXIST 1288
#define ER_SP_DROP_FAILED 1289
#define ER_SP_STORE_FAILED 1290
#define ER_SP_LILABEL_MISMATCH 1291
#define ER_SP_LABEL_REDEFINE 1292
#define ER_SP_LABEL_MISMATCH 1293
#define ER_SP_UNINIT_VAR 1294
#define ER_SP_BADSELECT 1295
#define ER_SP_BADRETURN 1296
#define ER_SP_BADSTATEMENT 1297
#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1298
#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1299
#define ER_QUERY_INTERRUPTED 1300
#define ER_SP_WRONG_NO_OF_ARGS 1301
#define ER_SP_COND_MISMATCH 1302
#define ER_SP_NORETURN 1303
#define ER_SP_NORETURNEND 1304
#define ER_SP_BAD_CURSOR_QUERY 1305
#define ER_SP_BAD_CURSOR_SELECT 1306
#define ER_SP_CURSOR_MISMATCH 1307
#define ER_SP_CURSOR_ALREADY_OPEN 1308
#define ER_SP_CURSOR_NOT_OPEN 1309
#define ER_SP_UNDECLARED_VAR 1310
#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1311
#define ER_SP_FETCH_NO_DATA 1312
#define ER_SP_DUP_PARAM 1313
#define ER_SP_DUP_VAR 1314
#define ER_SP_DUP_COND 1315
#define ER_SP_DUP_CURS 1316
#define ER_SP_CANT_ALTER 1317
#define ER_SP_SUBSELECT_NYI 1318
#define ER_ERROR_MESSAGES 319
#define ER_WARN_DEPRECATED_SYNTAX 1286
#define ER_SP_NO_RECURSIVE_CREATE 1287
#define ER_SP_ALREADY_EXISTS 1288
#define ER_SP_DOES_NOT_EXIST 1289
#define ER_SP_DROP_FAILED 1290
#define ER_SP_STORE_FAILED 1291
#define ER_SP_LILABEL_MISMATCH 1292
#define ER_SP_LABEL_REDEFINE 1293
#define ER_SP_LABEL_MISMATCH 1294
#define ER_SP_UNINIT_VAR 1295
#define ER_SP_BADSELECT 1296
#define ER_SP_BADRETURN 1297
#define ER_SP_BADSTATEMENT 1298
#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1299
#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1300
#define ER_QUERY_INTERRUPTED 1301
#define ER_SP_WRONG_NO_OF_ARGS 1302
#define ER_SP_COND_MISMATCH 1303
#define ER_SP_NORETURN 1304
#define ER_SP_NORETURNEND 1305
#define ER_SP_BAD_CURSOR_QUERY 1306
#define ER_SP_BAD_CURSOR_SELECT 1307
#define ER_SP_CURSOR_MISMATCH 1308
#define ER_SP_CURSOR_ALREADY_OPEN 1309
#define ER_SP_CURSOR_NOT_OPEN 1310
#define ER_SP_UNDECLARED_VAR 1311
#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1312
#define ER_SP_FETCH_NO_DATA 1313
#define ER_SP_DUP_PARAM 1314
#define ER_SP_DUP_VAR 1315
#define ER_SP_DUP_COND 1316
#define ER_SP_DUP_CURS 1317
#define ER_SP_CANT_ALTER 1318
#define ER_SP_SUBSELECT_NYI 1319
#define ER_ERROR_MESSAGES 320
......@@ -45,7 +45,7 @@ C_MODE_START
static my_bool org_my_init_done;
my_bool server_inited;
static my_bool STDCALL
static my_bool
emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
const char *header, ulong header_length,
const char *arg, ulong arg_length, my_bool skip_check)
......@@ -103,7 +103,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
return result;
}
static MYSQL_DATA * STDCALL
static MYSQL_DATA *
emb_read_rows(MYSQL *mysql, MYSQL_FIELD *mysql_fields __attribute__((unused)),
unsigned int fields __attribute__((unused)))
{
......@@ -126,12 +126,12 @@ emb_read_rows(MYSQL *mysql, MYSQL_FIELD *mysql_fields __attribute__((unused)),
return result;
}
static MYSQL_FIELD * STDCALL emb_list_fields(MYSQL *mysql)
static MYSQL_FIELD *emb_list_fields(MYSQL *mysql)
{
return mysql->fields;
}
static my_bool STDCALL emb_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
static my_bool emb_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
{
THD *thd= (THD*)mysql->thd;
if (mysql->net.last_errno)
......@@ -159,7 +159,8 @@ static my_bool STDCALL emb_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
else the lengths are calculated from the offset between pointers.
**************************************************************************/
static void STDCALL emb_fetch_lengths(ulong *to, MYSQL_ROW column, unsigned int field_count)
static void emb_fetch_lengths(ulong *to, MYSQL_ROW column,
unsigned int field_count)
{
MYSQL_ROW end;
......@@ -167,7 +168,7 @@ static void STDCALL emb_fetch_lengths(ulong *to, MYSQL_ROW column, unsigned int
*to= *column ? *(uint *)((*column) - sizeof(uint)) : 0;
}
static my_bool STDCALL emb_mysql_read_query_result(MYSQL *mysql)
static my_bool emb_mysql_read_query_result(MYSQL *mysql)
{
if (mysql->net.last_errno)
return -1;
......@@ -178,7 +179,7 @@ static my_bool STDCALL emb_mysql_read_query_result(MYSQL *mysql)
return 0;
}
static int STDCALL emb_stmt_execute(MYSQL_STMT *stmt)
static int emb_stmt_execute(MYSQL_STMT *stmt)
{
DBUG_ENTER("emb_stmt_execute");
THD *thd= (THD*)stmt->mysql->thd;
......@@ -205,7 +206,7 @@ MYSQL_DATA *emb_read_binary_rows(MYSQL_STMT *stmt)
return emb_read_rows(stmt->mysql, 0, 0);
}
int STDCALL emb_unbuffered_fetch(MYSQL *mysql, char **row)
int emb_unbuffered_fetch(MYSQL *mysql, char **row)
{
MYSQL_DATA *data= ((THD*)mysql->thd)->data;
if (!data || !data->data)
......@@ -225,7 +226,7 @@ int STDCALL emb_unbuffered_fetch(MYSQL *mysql, char **row)
return 0;
}
static void STDCALL emb_free_embedded_thd(MYSQL *mysql)
static void emb_free_embedded_thd(MYSQL *mysql)
{
THD *thd= (THD*)mysql->thd;
if (thd->data)
......@@ -234,18 +235,25 @@ static void STDCALL emb_free_embedded_thd(MYSQL *mysql)
delete thd;
}
static const char * STDCALL emb_read_statistic(MYSQL *mysql)
static const char * emb_read_statistic(MYSQL *mysql)
{
THD *thd= (THD*)mysql->thd;
return thd->net.last_error;
}
static MYSQL_RES * emb_mysql_store_result(MYSQL *mysql)
{
return mysql_store_result(mysql);
}
MYSQL_METHODS embedded_methods=
{
emb_mysql_read_query_result,
emb_advanced_command,
emb_read_rows,
mysql_store_result,
emb_mysql_store_result,
emb_fetch_lengths,
emb_list_fields,
emb_read_prepare_result,
......
......@@ -507,6 +507,36 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
DBUG_RETURN(result);
} /* chk_key */
static int chk_index_down(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
my_off_t page, uchar *buff, ha_rows *keys,
ha_checksum *key_checksum, uint level)
{
char llbuff[22],llbuff2[22];
if (page > info->state->key_file_length || (page & (info->s->blocksize -1)))
{
my_off_t max_length=my_seek(info->s->kfile,0L,MY_SEEK_END,MYF(0));
mi_check_print_error(param,"Wrong pagepointer: %s at page: %s",
llstr(page,llbuff),llstr(page,llbuff2));
if (page+info->s->blocksize > max_length)
goto err;
info->state->key_file_length=(max_length &
~ (my_off_t) (info->s->blocksize-1));
}
if (!_mi_fetch_keypage(info,keyinfo,page, DFLT_INIT_HITS,buff,0))
{
mi_check_print_error(param,"Can't read key from filepos: %s",
llstr(page,llbuff));
goto err;
}
param->key_file_blocks+=keyinfo->block_length;
if (chk_index(param,info,keyinfo,page,buff,keys,key_checksum,level))
goto err;
return 0;
err:
return 1;
}
/* Check if index is ok */
......@@ -553,27 +583,8 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
if (nod_flag)
{
next_page=_mi_kpos(nod_flag,keypos);
if (next_page > info->state->key_file_length ||
(nod_flag && (next_page & (info->s->blocksize -1))))
{
my_off_t max_length=my_seek(info->s->kfile,0L,MY_SEEK_END,MYF(0));
mi_check_print_error(param,"Wrong pagepointer: %s at page: %s",
llstr(next_page,llbuff),llstr(page,llbuff2));
if (next_page+info->s->blocksize > max_length)
goto err;
info->state->key_file_length=(max_length &
~ (my_off_t) (info->s->blocksize-1));
}
if (!_mi_fetch_keypage(info,keyinfo,next_page,
DFLT_INIT_HITS,temp_buff,0))
{
mi_check_print_error(param,"Can't read key from filepos: %s",llstr(next_page,llbuff));
goto err;
}
param->key_file_blocks+=keyinfo->block_length;
if (chk_index(param,info,keyinfo,next_page,temp_buff,keys,key_checksum,
level+1))
if (chk_index_down(param,info,keyinfo,next_page,
temp_buff,keys,key_checksum,level+1))
goto err;
}
old_keypos=keypos;
......@@ -615,6 +626,23 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
memcpy((char*) info->lastkey,(char*) key,key_length);
info->lastkey_length=key_length;
record= _mi_dpos(info,0,key+key_length);
if (keyinfo->flag & HA_FULLTEXT) /* special handling for ft2 */
{
uint off;
int subkeys;
get_key_full_length_rdonly(off, key);
subkeys=ft_sintXkorr(key+off);
if (subkeys < 0)
{
ha_rows tmp_keys=0;
if (chk_index_down(param,info,&info->s->ft2_keyinfo,record,
temp_buff,&tmp_keys,key_checksum,1))
goto err;
(*keys)+=tmp_keys-1;
continue;
}
/* fall through */
}
if (record >= info->state->data_file_length)
{
#ifndef DBUG_OFF
......
......@@ -805,7 +805,7 @@ manager_launch()
ident=$1
shift
if [ $USE_MANAGER = 0 ] ; then
$@ >> $CUR_MYERR 2>&1 &
echo $@ | /bin/sh >> $CUR_MYERR 2>&1 &
sleep 2 #hack
return
fi
......
......@@ -47,7 +47,7 @@ KEY prov_hdl_nr(prov_hdl_nr),
KEY mcbs_aufnr(mcbs_aufnr),
KEY kundentyp(kundentyp),
KEY p_nr(p_nr,suffix)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
......
......@@ -73,10 +73,10 @@ body text NOT NULL,
user_id int(11) unsigned NOT NULL default '0',
status enum('new','old') NOT NULL default 'new',
PRIMARY KEY (id)
) TYPE=MyISAM;
) ENGINE=MyISAM;
ALTER TABLE t1 ORDER BY t1.id, t1.status, t1.type_id, t1.user_id, t1.body;
DROP TABLE t1;
CREATE TABLE t1 (AnamneseId int(10) unsigned NOT NULL auto_increment,B BLOB,PRIMARY KEY (AnamneseId)) type=myisam;
CREATE TABLE t1 (AnamneseId int(10) unsigned NOT NULL auto_increment,B BLOB,PRIMARY KEY (AnamneseId)) engine=myisam;
insert into t1 values (null,"hello");
LOCK TABLES t1 WRITE;
ALTER TABLE t1 ADD Column new_col int not null;
......@@ -323,31 +323,31 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) character set koi8r default NULL
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 DEFAULT CHARACTER SET latin1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) character set koi8r default NULL
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 CHARACTER SET latin1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) default NULL
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 DEFAULT CHARACTER SET cp1251;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) character set latin1 default NULL
) TYPE=MyISAM DEFAULT CHARSET=cp1251
) ENGINE=MyISAM DEFAULT CHARSET=cp1251
drop table t1;
CREATE TABLE t1 (
Host varchar(16) binary NOT NULL default '',
User varchar(16) binary NOT NULL default '',
PRIMARY KEY (Host,User)
) TYPE=MyISAM;
) ENGINE=MyISAM;
ALTER TABLE t1 DISABLE KEYS;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES ('localhost','root'),('localhost',''),('games','monty');
......@@ -366,7 +366,7 @@ Host varchar(16) binary NOT NULL default '',
User varchar(16) binary NOT NULL default '',
PRIMARY KEY (Host,User),
KEY (Host)
) TYPE=MyISAM;
) ENGINE=MyISAM;
ALTER TABLE t1 DISABLE KEYS;
SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
......@@ -403,7 +403,7 @@ Host varchar(16) binary NOT NULL default '',
User varchar(16) binary NOT NULL default '',
PRIMARY KEY (Host,User),
KEY (Host)
) TYPE=MyISAM;
) ENGINE=MyISAM;
LOCK TABLES t1 WRITE;
ALTER TABLE t1 DISABLE KEYS;
SHOW INDEX FROM t1;
......
drop table if exists t1;
SET SQL_WARNINGS=1;
create table t1 (a int not null auto_increment,b int, primary key (a)) type=myisam auto_increment=3;
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=myisam auto_increment=3;
insert into t1 values (1,1),(NULL,3),(NULL,4);
delete from t1 where a=4;
insert into t1 values (NULL,5),(NULL,6);
......
drop table if exists t1;
create table t1(objid BIGINT not null, tablename varchar(64), oid BIGINT not null, test BIGINT, PRIMARY KEY (objid), UNIQUE(tablename)) type=BDB;
create table t1(objid BIGINT not null, tablename varchar(64), oid BIGINT not null, test BIGINT, PRIMARY KEY (objid), UNIQUE(tablename)) engine=BDB;
insert into t1 values(1, 't1',4,9);
insert into t1 values(2, 'metatable',1,9);
insert into t1 values(3, 'metaindex',1,9 );
......
......@@ -14,7 +14,7 @@ ChargeTimeStamp varchar(20),
PRIMARY KEY (ChargeID),
KEY ServiceID (ServiceID),
KEY ChargeDate (ChargeDate)
) type=BDB;
) engine=BDB;
BEGIN;
INSERT INTO t1
VALUES(NULL,1,'2001-03-01',1,1,1,'New',NULL,NULL,'now');
......
drop table if exists t1,t2;
create table t1 (id integer, x integer) type=BDB;
create table t2 (id integer, x integer) type=BDB;
create table t1 (id integer, x integer) engine=BDB;
create table t2 (id integer, x integer) engine=BDB;
insert into t1 values(0, 0);
insert into t2 values(0, 0);
set autocommit=0;
......
This diff is collapsed.
drop table if exists t1, t2, t3;
flush status;
set autocommit=0;
create table t1 (a int not null) type=bdb;
create table t1 (a int not null) engine=bdb;
insert into t1 values (1),(2),(3);
select * from t1;
a
......@@ -15,7 +15,7 @@ drop table t1;
commit;
set autocommit=1;
begin;
create table t1 (a int not null) type=bdb;
create table t1 (a int not null) engine=bdb;
insert into t1 values (1),(2),(3);
select * from t1;
a
......@@ -27,9 +27,9 @@ Variable_name Value
Qcache_queries_in_cache 0
drop table t1;
commit;
create table t1 (a int not null) type=bdb;
create table t2 (a int not null) type=bdb;
create table t3 (a int not null) type=bdb;
create table t1 (a int not null) engine=bdb;
create table t2 (a int not null) engine=bdb;
create table t3 (a int not null) engine=bdb;
insert into t1 values (1),(2);
insert into t2 values (1),(2);
insert into t3 values (1),(2);
......
......@@ -105,7 +105,7 @@ t1 CREATE TABLE `t1` (
`c7` double(3,1) NOT NULL default '0.0',
`c8` double(3,1) NOT NULL default '0.0',
`c9` double(3,1) default NULL
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SELECT CASE
WHEN 1
......@@ -152,5 +152,5 @@ t1 CREATE TABLE `t1` (
`COALESCE(1,'1')` char(1) NOT NULL default '',
`COALESCE(1.1,'1')` char(3) NOT NULL default '',
`COALESCE('a' COLLATE latin1_bin,'b')` char(1) character set latin1 collate latin1_bin NOT NULL default ''
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
......@@ -45,7 +45,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`t` char(4) character set cp1251 NOT NULL default ''
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select
cast(_latin1'ab' AS char) as c1,
......@@ -72,7 +72,7 @@ t1 CREATE TABLE `t1` (
`c3` char(2) binary NOT NULL default '',
`c4` char(2) binary NOT NULL default '',
`c5` char(2) binary NOT NULL default ''
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select
cast(_koi8r'' AS nchar) as c1,
......@@ -99,7 +99,7 @@ t1 CREATE TABLE `t1` (
`c3` char(2) character set utf8 NOT NULL default '',
`c4` char(2) character set utf8 NOT NULL default '',
`c5` char(2) character set utf8 NOT NULL default ''
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select cast("2001-1-1" as date) = "2001-01-01";
cast("2001-1-1" as date) = "2001-01-01"
......
......@@ -25,5 +25,5 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `constraint_1` (`a`),
UNIQUE KEY `key_1` (`a`),
UNIQUE KEY `key_2` (`a`)
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
......@@ -17,9 +17,9 @@ b
drop table t1;
create table t1 (a int not null auto_increment,primary key (a)) type=heap;
create table t1 (a int not null auto_increment,primary key (a)) engine=heap;
drop table t1;
create table t2 type=heap select * from t1;
create table t2 engine=heap select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
create table t2 select auto+1 from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
......@@ -29,12 +29,12 @@ Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
create table t1 (b char(0) not null, index(b));
ERROR 42000: The used storage engine can't index column 'b'
create table t1 (a int not null,b text) type=heap;
create table t1 (a int not null,b text) engine=heap;
ERROR 42000: The used table type doesn't support BLOB/TEXT columns
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) type=heap;
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap;
ERROR 42000: Incorrect table definition; There can only be one auto column and it must be defined as a key
create table not_existing_database.test (a int);
Got one of the listed errors
......@@ -180,7 +180,7 @@ t1 CREATE TABLE `t1` (
KEY `b_29` (`b`),
KEY `b_30` (`b`),
KEY `b_31` (`b`)
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 select if(1,'1','0'), month("2002-08-02");
drop table t1;
......@@ -198,7 +198,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0'
) TYPE=HEAP DEFAULT CHARSET=latin1
) ENGINE=HEAP DEFAULT CHARSET=latin1
drop table t1;
SET SESSION table_type="gemini";
ERROR 42000: Unknown table engine 'gemini'
......@@ -210,7 +210,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0'
) TYPE=HEAP DEFAULT CHARSET=latin1
) ENGINE=HEAP DEFAULT CHARSET=latin1
SET SESSION table_type=default;
drop table t1;
create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2));
......@@ -275,7 +275,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`id` int(11) NOT NULL default '0',
`name` char(20) default NULL
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t3;
id name
create table if not exists t3 like t1;
......@@ -289,7 +289,7 @@ show create table t3;
Table Create Table
t3 CREATE TEMPORARY TABLE `t3` (
`id` int(11) NOT NULL default '0'
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t3;
id
drop table t3;
......@@ -298,7 +298,7 @@ Table Create Table
t3 CREATE TABLE `t3` (
`id` int(11) NOT NULL default '0',
`name` char(20) default NULL
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t3;
id name
drop table t2, t3;
......@@ -310,14 +310,14 @@ Table Create Table
t3 CREATE TEMPORARY TABLE `t3` (
`id` int(11) NOT NULL default '0',
`name` char(20) default NULL
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create table t2 like t3;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`id` int(11) NOT NULL default '0',
`name` char(20) default NULL
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t2;
id name
create table t3 like t1;
......@@ -343,7 +343,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0'
) TYPE=HEAP DEFAULT CHARSET=latin1
) ENGINE=HEAP DEFAULT CHARSET=latin1
drop table t1;
SET SESSION table_type="gemini";
ERROR 42000: Unknown table engine 'gemini'
......@@ -355,7 +355,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0'
) TYPE=HEAP DEFAULT CHARSET=latin1
) ENGINE=HEAP DEFAULT CHARSET=latin1
SET SESSION table_type=default;
drop table t1;
create table t1(a int,b int,c int unsigned,d date,e char,f datetime,g time,h blob);
......@@ -407,6 +407,55 @@ a b c d e f g h dd
1 -7 7 2000-01-01 b 2000-01-01 00:00:00 05:04:03 yet another binary data 02:00:00
2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02 binary data 02:00:00
drop table t1, t2;
create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10));
create table t2 select ifnull(a,a), ifnull(b,b), ifnull(c,c), ifnull(d,d), ifnull(e,e), ifnull(f,f), ifnull(g,g), ifnull(h,h), ifnull(i,i), ifnull(j,j), ifnull(k,k), ifnull(l,l), ifnull(m,m), ifnull(n,n), ifnull(o,o) from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`ifnull(a,a)` tinyint(4) default NULL,
`ifnull(b,b)` smallint(6) default NULL,
`ifnull(c,c)` mediumint(9) default NULL,
`ifnull(d,d)` int(11) default NULL,
`ifnull(e,e)` bigint(20) default NULL,
`ifnull(f,f)` float(3,2) default NULL,
`ifnull(g,g)` double(4,3) default NULL,
`ifnull(h,h)` decimal(5,4) default NULL,
`ifnull(i,i)` year(4) default NULL,
`ifnull(j,j)` date default NULL,
`ifnull(k,k)` datetime NOT NULL default '0000-00-00 00:00:00',
`ifnull(l,l)` datetime default NULL,
`ifnull(m,m)` char(1) default NULL,
`ifnull(n,n)` char(3) default NULL,
`ifnull(o,o)` char(10) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1,t2;
create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14');
insert into t1 values ('','',0,0.0);
describe t1;
Field Type Null Key Default Extra
str varchar(10) YES def
strnull varchar(10) YES NULL
intg int(11) YES 10
rel double YES 3.14
create table t2 select default(str) as str, default(strnull) as strnull, default(intg) as intg, default(rel) as rel from t1;
describe t2;
Field Type Null Key Default Extra
str varchar(10) YES NULL
strnull varchar(10) YES NULL
intg int(11) YES NULL
rel double YES NULL
drop table t1, t2;
create table t1(name varchar(10), age smallint default -1);
describe t1;
Field Type Null Key Default Extra
name varchar(10) YES NULL
age smallint(6) YES -1
create table t2(name varchar(10), age smallint default - 1);
describe t2;
Field Type Null Key Default Extra
name varchar(10) YES NULL
age smallint(6) YES -1
drop table t1, t2;
create database test_$1;
use test_$1;
select database();
......
......@@ -491,7 +491,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`latin1_f` char(32) NOT NULL default ''
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW FIELDS FROM t1;
Field Type Null Key Default Extra
latin1_f char(32)
......@@ -501,7 +501,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`latin1_f` char(32) character set latin1 collate latin1_bin default NULL
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW FIELDS FROM t1;
Field Type Null Key Default Extra
latin1_f char(32) YES NULL
......@@ -510,7 +510,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`latin1_f` char(32) character set latin1 collate latin1_bin default NULL
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW FIELDS FROM t1;
Field Type Null Key Default Extra
latin1_f char(32) YES NULL
......
......@@ -225,7 +225,7 @@ t1 CREATE TABLE `t1` (
`word` varchar(255) collate latin1_german2_ci NOT NULL default '',
`word2` varchar(255) collate latin1_german2_ci NOT NULL default '',
KEY `word` (`word`)
) TYPE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
insert into t1 (word) values ('ss'),(0xDF),(0xE4),('ae');
update t1 set word2=word;
select word, word=binary 0xdf as t from t1 having t > 0;
......@@ -284,7 +284,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`s1` char(5) collate latin1_german2_ci default NULL
) TYPE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
INSERT INTO t1 VALUES ('');
INSERT INTO t1 VALUES ('ue');
SELECT DISTINCT s1 FROM t1;
......
......@@ -5,7 +5,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`c1` char(4) character set utf8 NOT NULL default '',
`c2` char(4) character set utf8 NOT NULL default ''
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DELETE FROM t1;
ALTER TABLE t1 ADD c3 CHAR(4) CHARACTER SET utf8;
SHOW CREATE TABLE t1;
......@@ -14,7 +14,7 @@ t1 CREATE TABLE `t1` (
`c1` char(4) character set utf8 NOT NULL default '',
`c2` char(4) character set utf8 NOT NULL default '',
`c3` char(4) character set utf8 default NULL
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('aaaabbbbccccdddd','aaaabbbbccccdddd','aaaabbbbccccdddd');
Warnings:
Warning 1264 Data truncated for column 'c1' at row 1
......@@ -30,7 +30,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` char(4) character set utf8 default NULL,
KEY `key_a` (`a`(3))
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW KEYS FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 key_a 1 a A NULL 9 NULL YES BTREE
......@@ -40,7 +40,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` char(4) default NULL,
KEY `key_a` (`a`(3))
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW KEYS FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 key_a 1 a A NULL 3 NULL YES BTREE
......@@ -50,7 +50,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` char(4) character set utf8 default NULL,
KEY `key_a` (`a`(3))
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW KEYS FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 key_a 1 a A NULL 9 NULL YES BTREE
......
SET CHARACTER SET koi8r;
DROP TABLE IF EXISTS , t1;
DROP TABLE IF EXISTS , t1, t2;
SET CHARACTER SET koi8r;
CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp1251) SELECT _koi8r'' AS a;
CREATE TABLE t2 (a CHAR(10) CHARACTER SET utf8);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) character set cp1251 default NULL
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT a FROM t1;
a
SELECT HEX(a) FROM t1;
HEX(a)
EFF0EEE1E0
DROP TABLE t1;
INSERT t2 SELECT * FROM t1;
SELECT HEX(a) FROM t2;
HEX(a)
D0BFD180D0BED0B1D0B0
DROP TABLE t1, t2;
CREATE TABLE t1 (a TEXT CHARACTER SET cp1251) SELECT _koi8r'' AS a;
CREATE TABLE t2 (a TEXT CHARACTER SET utf8);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` text character set cp1251
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT HEX(a) FROM t1;
HEX(a)
EFF0EEE1E0
INSERT t2 SELECT * FROM t1;
SELECT HEX(a) FROM t2;
HEX(a)
D0BFD180D0BED0B1D0B0
DROP TABLE t1, t2;
CREATE TABLE ``
(
CHAR(32) CHARACTER SET koi8r NOT NULL COMMENT " "
......@@ -25,7 +45,7 @@ SHOW CREATE TABLE
Table Create Table
CREATE TABLE `` (
`` char(32) character set koi8r NOT NULL default '' COMMENT ' '
) TYPE=MyISAM DEFAULT CHARSET=latin1 COMMENT=' '
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT=' '
SHOW FIELDS FROM ;
Field Type Null Key Default Extra
char(32)
......@@ -37,7 +57,7 @@ SHOW CREATE TABLE
Table Create Table
CREATE TABLE `` (
`` char(32) character set koi8r NOT NULL default '' COMMENT ' '
) TYPE=MyISAM DEFAULT CHARSET=latin1 COMMENT=' '
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT=' '
SHOW FIELDS FROM ;
Field Type Null Key Default Extra
char(32)
......@@ -49,7 +69,7 @@ SHOW CREATE TABLE таблица;
Table Create Table
таблица CREATE TABLE `таблица` (
`поле` char(32) character set koi8r NOT NULL default '' COMMENT 'комментарий поля'
) TYPE=MyISAM DEFAULT CHARSET=latin1 COMMENT='комментарий таблицы'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='комментарий таблицы'
SHOW FIELDS FROM таблица;
Field Type Null Key Default Extra
поле char(32)
......
......@@ -45,7 +45,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`l` char(10) character set ucs2 NOT NULL default '',
`r` char(10) character set ucs2 NOT NULL default ''
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SET NAMES koi8r;
SET character_set_connection=ucs2;
......@@ -155,7 +155,7 @@ a
DROP TABLE t1;
CREATE TABLE t1 (word varchar(64) NOT NULL, PRIMARY KEY (word))
TYPE=MyISAM CHARACTER SET ucs2 COLLATE ucs2_general_ci;
ENGINE=MyISAM CHARACTER SET ucs2 COLLATE ucs2_general_ci;
INSERT INTO t1 (word) VALUES ("cat");
SELECT * FROM t1 WHERE word LIKE "c%";
word
......@@ -178,7 +178,7 @@ CREATE TABLE t1 (
word VARCHAR(64),
bar INT(11) default 0,
PRIMARY KEY (word))
TYPE=MyISAM
ENGINE=MyISAM
CHARSET ucs2
COLLATE ucs2_general_ci ;
INSERT INTO t1 (word) VALUES ("aar");
......@@ -213,7 +213,7 @@ DROP TABLE t1;
CREATE TABLE t1 (
word VARCHAR(64) ,
PRIMARY KEY (word))
TYPE=MyISAM
ENGINE=MyISAM
CHARSET ucs2
COLLATE ucs2_general_ci;
INSERT INTO t1 (word) VALUES ("aar");
......@@ -238,7 +238,7 @@ CREATE TABLE t1 (
word TEXT,
bar INT(11) AUTO_INCREMENT,
PRIMARY KEY (bar))
TYPE=MyISAM
ENGINE=MyISAM
CHARSET ucs2
COLLATE ucs2_general_ci ;
INSERT INTO t1 (word) VALUES ("aar");
......
......@@ -37,7 +37,7 @@ bool char(0) default NULL,
not_null varchar(20) binary NOT NULL default '',
misc integer not null,
PRIMARY KEY (not_null)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7);
select * from t1 where misc > 5 and bool is null;
bool not_null misc
......
......@@ -360,7 +360,7 @@ a c
4 NULL
3 NULL
drop table t1;
create table t1 (a char(1), key(a)) type=myisam;
create table t1 (a char(1), key(a)) engine=myisam;
insert into t1 values('1'),('1');
select * from t1 where a >= '1';
a
......@@ -402,9 +402,9 @@ test2@testdomain.com Z001
test2@testdomain.com R002
test3@testdomain.com Z001
drop table t1,t2;
CREATE TABLE t1 (privatemessageid int(10) unsigned NOT NULL auto_increment, folderid smallint(6) NOT NULL default '0', userid int(10) unsigned NOT NULL default '0', touserid int(10) unsigned NOT NULL default '0', fromuserid int(10) unsigned NOT NULL default '0', title varchar(250) NOT NULL default '', message mediumtext NOT NULL, dateline int(10) unsigned NOT NULL default '0', showsignature smallint(6) NOT NULL default '0', iconid smallint(5) unsigned NOT NULL default '0', messageread smallint(6) NOT NULL default '0', readtime int(10) unsigned NOT NULL default '0', receipt smallint(6) unsigned NOT NULL default '0', deleteprompt smallint(6) unsigned NOT NULL default '0', multiplerecipients smallint(6) unsigned NOT NULL default '0', PRIMARY KEY (privatemessageid), KEY userid (userid)) TYPE=MyISAM;
CREATE TABLE t1 (privatemessageid int(10) unsigned NOT NULL auto_increment, folderid smallint(6) NOT NULL default '0', userid int(10) unsigned NOT NULL default '0', touserid int(10) unsigned NOT NULL default '0', fromuserid int(10) unsigned NOT NULL default '0', title varchar(250) NOT NULL default '', message mediumtext NOT NULL, dateline int(10) unsigned NOT NULL default '0', showsignature smallint(6) NOT NULL default '0', iconid smallint(5) unsigned NOT NULL default '0', messageread smallint(6) NOT NULL default '0', readtime int(10) unsigned NOT NULL default '0', receipt smallint(6) unsigned NOT NULL default '0', deleteprompt smallint(6) unsigned NOT NULL default '0', multiplerecipients smallint(6) unsigned NOT NULL default '0', PRIMARY KEY (privatemessageid), KEY userid (userid)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (128,0,33,33,8,':D','',996121863,1,0,2,996122850,2,0,0);
CREATE TABLE t2 (userid int(10) unsigned NOT NULL auto_increment, usergroupid smallint(5) unsigned NOT NULL default '0', username varchar(50) NOT NULL default '', password varchar(50) NOT NULL default '', email varchar(50) NOT NULL default '', styleid smallint(5) unsigned NOT NULL default '0', parentemail varchar(50) NOT NULL default '', coppauser smallint(6) NOT NULL default '0', homepage varchar(100) NOT NULL default '', icq varchar(20) NOT NULL default '', aim varchar(20) NOT NULL default '', yahoo varchar(20) NOT NULL default '', signature mediumtext NOT NULL, adminemail smallint(6) NOT NULL default '0', showemail smallint(6) NOT NULL default '0', invisible smallint(6) NOT NULL default '0', usertitle varchar(250) NOT NULL default '', customtitle smallint(6) NOT NULL default '0', joindate int(10) unsigned NOT NULL default '0', cookieuser smallint(6) NOT NULL default '0', daysprune smallint(6) NOT NULL default '0', lastvisit int(10) unsigned NOT NULL default '0', lastactivity int(10) unsigned NOT NULL default '0', lastpost int(10) unsigned NOT NULL default '0', posts smallint(5) unsigned NOT NULL default '0', timezoneoffset varchar(4) NOT NULL default '', emailnotification smallint(6) NOT NULL default '0', buddylist mediumtext NOT NULL, ignorelist mediumtext NOT NULL, pmfolders mediumtext NOT NULL, receivepm smallint(6) NOT NULL default '0', emailonpm smallint(6) NOT NULL default '0', pmpopup smallint(6) NOT NULL default '0', avatarid smallint(6) NOT NULL default '0', avatarrevision int(6) unsigned NOT NULL default '0', options smallint(6) NOT NULL default '15', birthday date NOT NULL default '0000-00-00', maxposts smallint(6) NOT NULL default '-1', startofweek smallint(6) NOT NULL default '1', ipaddress varchar(20) NOT NULL default '', referrerid int(10) unsigned NOT NULL default '0', nosessionhash smallint(6) NOT NULL default '0', autorefresh smallint(6) NOT NULL default '-1', messagepopup tinyint(2) NOT NULL default '0', inforum smallint(5) unsigned NOT NULL default '0', ratenum smallint(5) unsigned NOT NULL default '0', ratetotal smallint(5) unsigned NOT NULL default '0', allowrate smallint(5) unsigned NOT NULL default '1', PRIMARY KEY (userid), KEY usergroupid (usergroupid), KEY username (username), KEY inforum (inforum)) TYPE=MyISAM;
CREATE TABLE t2 (userid int(10) unsigned NOT NULL auto_increment, usergroupid smallint(5) unsigned NOT NULL default '0', username varchar(50) NOT NULL default '', password varchar(50) NOT NULL default '', email varchar(50) NOT NULL default '', styleid smallint(5) unsigned NOT NULL default '0', parentemail varchar(50) NOT NULL default '', coppauser smallint(6) NOT NULL default '0', homepage varchar(100) NOT NULL default '', icq varchar(20) NOT NULL default '', aim varchar(20) NOT NULL default '', yahoo varchar(20) NOT NULL default '', signature mediumtext NOT NULL, adminemail smallint(6) NOT NULL default '0', showemail smallint(6) NOT NULL default '0', invisible smallint(6) NOT NULL default '0', usertitle varchar(250) NOT NULL default '', customtitle smallint(6) NOT NULL default '0', joindate int(10) unsigned NOT NULL default '0', cookieuser smallint(6) NOT NULL default '0', daysprune smallint(6) NOT NULL default '0', lastvisit int(10) unsigned NOT NULL default '0', lastactivity int(10) unsigned NOT NULL default '0', lastpost int(10) unsigned NOT NULL default '0', posts smallint(5) unsigned NOT NULL default '0', timezoneoffset varchar(4) NOT NULL default '', emailnotification smallint(6) NOT NULL default '0', buddylist mediumtext NOT NULL, ignorelist mediumtext NOT NULL, pmfolders mediumtext NOT NULL, receivepm smallint(6) NOT NULL default '0', emailonpm smallint(6) NOT NULL default '0', pmpopup smallint(6) NOT NULL default '0', avatarid smallint(6) NOT NULL default '0', avatarrevision int(6) unsigned NOT NULL default '0', options smallint(6) NOT NULL default '15', birthday date NOT NULL default '0000-00-00', maxposts smallint(6) NOT NULL default '-1', startofweek smallint(6) NOT NULL default '1', ipaddress varchar(20) NOT NULL default '', referrerid int(10) unsigned NOT NULL default '0', nosessionhash smallint(6) NOT NULL default '0', autorefresh smallint(6) NOT NULL default '-1', messagepopup tinyint(2) NOT NULL default '0', inforum smallint(5) unsigned NOT NULL default '0', ratenum smallint(5) unsigned NOT NULL default '0', ratetotal smallint(5) unsigned NOT NULL default '0', allowrate smallint(5) unsigned NOT NULL default '1', PRIMARY KEY (userid), KEY usergroupid (usergroupid), KEY username (username), KEY inforum (inforum)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (33,6,'Kevin','0','kevin@stileproject.com',1,'',0,'http://www.stileproject.com','','','','',1,1,0,'Administrator',0,996120694,1,-1,1030996168,1031027028,1030599436,36,'-6',0,'','','',1,0,1,0,0,15,'0000-00-00',-1,1,'64.0.0.0',0,1,-1,0,0,4,19,1);
SELECT DISTINCT t1.*, t2.* FROM t1 LEFT JOIN t2 ON (t2.userid = t1.touserid);
privatemessageid folderid userid touserid fromuserid title message dateline showsignature iconid messageread readtime receipt deleteprompt multiplerecipients userid usergroupid username password email styleid parentemail coppauser homepage icq aim yahoo signature adminemail showemail invisible usertitle customtitle joindate cookieuser daysprune lastvisit lastactivity lastpost posts timezoneoffset emailnotification buddylist ignorelist pmfolders receivepm emailonpm pmpopup avatarid avatarrevision options birthday maxposts startofweek ipaddress referrerid nosessionhash autorefresh messagepopup inforum ratenum ratetotal allowrate
......@@ -418,7 +418,7 @@ SELECT DISTINCT t1.a, t2.b FROM t1, t2 WHERE t1.a=1 ORDER BY t2.c;
a b
1 4
DROP TABLE t1,t2;
CREATE table t1 ( `id` int(11) NOT NULL auto_increment, `name` varchar(50) NOT NULL default '', PRIMARY KEY (`id`)) TYPE=MyISAM AUTO_INCREMENT=3 ;
CREATE table t1 ( `id` int(11) NOT NULL auto_increment, `name` varchar(50) NOT NULL default '', PRIMARY KEY (`id`)) ENGINE=MyISAM AUTO_INCREMENT=3 ;
INSERT INTO t1 VALUES (1, 'aaaaa');
INSERT INTO t1 VALUES (3, 'aaaaa');
INSERT INTO t1 VALUES (2, 'eeeeeee');
......@@ -458,7 +458,7 @@ CREATE TABLE t1 (
html varchar(5) default NULL,
rin int(11) default '0',
rout int(11) default '0'
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('1',1,0);
SELECT DISTINCT html,SUM(rout)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
html prod
......
......@@ -218,7 +218,7 @@ t2 CREATE TABLE `t2` (
`inhalt` text,
KEY `tig` (`ticket`),
FULLTEXT KEY `tix` (`inhalt`)
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t2 where MATCH inhalt AGAINST (NULL);
ticket inhalt
select * from t2 where MATCH inhalt AGAINST ('foobar');
......@@ -251,7 +251,7 @@ id int(11) auto_increment,
title varchar(100) default '',
PRIMARY KEY (id),
KEY ind5 (title)
) TYPE=MyISAM;
) ENGINE=MyISAM;
CREATE FULLTEXT INDEX ft1 ON t1(title);
insert into t1 (title) values ('this is a test');
select * from t1 where match title against ('test' in boolean mode);
......@@ -267,7 +267,7 @@ id title
1 this test once revealed a bug
update t1 set title=NULL where id=1;
drop table t1;
CREATE TABLE t1 (a int(11), b text, FULLTEXT KEY (b)) TYPE=MyISAM;
CREATE TABLE t1 (a int(11), b text, FULLTEXT KEY (b)) ENGINE=MyISAM;
insert into t1 values (1,"I wonder why the fulltext index doesnt work?");
SELECT * from t1 where MATCH (b) AGAINST ('apples');
a b
......@@ -277,7 +277,7 @@ a b
2 fullaaa fullzzz
1 I wonder why the fulltext index doesnt work?
drop table t1;
CREATE TABLE t1 ( id int(11) NOT NULL auto_increment primary key, mytext text NOT NULL, FULLTEXT KEY mytext (mytext)) TYPE=MyISAM;
CREATE TABLE t1 ( id int(11) NOT NULL auto_increment primary key, mytext text NOT NULL, FULLTEXT KEY mytext (mytext)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,'my small mouse'),(2,'la-la-la'),(3,'It is so funny'),(4,'MySQL Tutorial');
select 8 from t1;
8
......
......@@ -3,7 +3,7 @@ CREATE TABLE t1 (
i int(10) unsigned not null auto_increment primary key,
a varchar(255) not null,
FULLTEXT KEY (a)
) TYPE=MyISAM;
) ENGINE=MyISAM;
repair table t1 quick;
Table Op Msg_type Msg_text
test.t1 repair status OK
......@@ -108,7 +108,7 @@ CREATE TABLE t1 (
i int(10) unsigned not null auto_increment primary key,
a varchar(255) not null,
FULLTEXT KEY (a)
) TYPE=MyISAM;
) ENGINE=MyISAM;
select count(*) from t1 where match a against ('aaaxxx');
count(*)
260
......
......@@ -7,14 +7,14 @@ PRIMARY KEY (id),
KEY kt(tag),
KEY kv(value(15)),
FULLTEXT KEY kvf(value)
) TYPE=MyISAM;
) ENGINE=MyISAM;
CREATE TABLE t2 (
id_t2 mediumint unsigned NOT NULL default '0',
id_t1 mediumint unsigned NOT NULL default '0',
field_number tinyint unsigned NOT NULL default '0',
PRIMARY KEY (id_t2,id_t1,field_number),
KEY id_t1(id_t1)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 (tag,value) VALUES ('foo123','bar111');
INSERT INTO t1 (tag,value) VALUES ('foo123','bar222');
INSERT INTO t1 (tag,value) VALUES ('bar345','baz333 ar');
......
......@@ -31,9 +31,9 @@ match(t1.texte,t1.sujet,t1.motsclefs) against('droit' IN BOOLEAN MODE)
1
0
drop table t1, t2;
create table t1 (venue_id int(11) default null, venue_text varchar(255) default null, dt datetime default null) type=myisam;
create table t1 (venue_id int(11) default null, venue_text varchar(255) default null, dt datetime default null) engine=myisam;
insert into t1 (venue_id, venue_text, dt) values (1, 'a1', '2003-05-23 19:30:00'),(null, 'a2', '2003-05-23 19:30:00');
create table t2 (name varchar(255) not null default '', entity_id int(11) not null auto_increment, primary key (entity_id), fulltext key name (name)) type=myisam;
create table t2 (name varchar(255) not null default '', entity_id int(11) not null auto_increment, primary key (entity_id), fulltext key name (name)) engine=myisam;
insert into t2 (name, entity_id) values ('aberdeen town hall', 1), ('glasgow royal concert hall', 2), ('queen\'s hall, edinburgh', 3);
select * from t1 left join t2 on venue_id = entity_id where match(name) against('aberdeen' in boolean mode) and dt = '2003-05-23 19:30:00';
venue_id venue_text dt name entity_id
......
......@@ -26,7 +26,7 @@ uncompressed_length(compress(@test_compress_string))
select length(compress(@test_compress_string))<length(@test_compress_string);
length(compress(@test_compress_string))<length(@test_compress_string)
1
create table t1 (a text, b char(255), c char(4)) type=myisam;
create table t1 (a text, b char(255), c char(4)) engine=myisam;
insert into t1 (a,b,c) values (compress(@test_compress_string),compress(@test_compress_string),'d ');
select uncompress(a) from t1;
uncompress(a)
......
......@@ -6,7 +6,7 @@ hits int(10) unsigned DEFAULT '0' NOT NULL,
sessions int(10) unsigned DEFAULT '0' NOT NULL,
ts timestamp(14),
PRIMARY KEY (visitor_id,group_id)
)/*! type=MyISAM */;
)/*! engine=MyISAM */;
INSERT INTO t1 VALUES (465931136,7,2,2,20000318160952);
INSERT INTO t1 VALUES (173865424,2,2,2,20000318233615);
INSERT INTO t1 VALUES (173865424,8,2,2,20000318233615);
......
......@@ -608,7 +608,7 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1003 select high_priority big_result test.t1.a AS `a`,count(test.t1.b) AS `count(b)`,sum(test.t1.b) AS `sum(b)`,avg(test.t1.b) AS `avg(b)`,std(test.t1.b) AS `std(b)`,min(test.t1.b) AS `min(b)`,max(test.t1.b) AS `max(b)`,bit_and(test.t1.b) AS `bit_and(b)`,bit_or(test.t1.b) AS `bit_or(b)`,bit_xor(test.t1.b) AS `bit_xor(b)` from test.t1 group by test.t1.a
drop table t1;
create table t1 (USR_ID integer not null, MAX_REQ integer not null, constraint PK_SEA_USER primary key (USR_ID)) type=InnoDB;
create table t1 (USR_ID integer not null, MAX_REQ integer not null, constraint PK_SEA_USER primary key (USR_ID)) engine=InnoDB;
insert into t1 values (1, 3);
select count(*) + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ from t1 group by MAX_REQ;
count(*) + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ
......
......@@ -2,7 +2,7 @@ drop table if exists t1;
select IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2,3)|0,IF(1,2.0,3.0)+0 ;
IF(0,"ERROR","this") IF(1,"is","ERROR") IF(NULL,"ERROR","a") IF(1,2,3)|0 IF(1,2.0,3.0)+0
this is a 2 2.0
CREATE TABLE t1 (st varchar(255) NOT NULL, u int(11) NOT NULL) TYPE=MyISAM;
CREATE TABLE t1 (st varchar(255) NOT NULL, u int(11) NOT NULL) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('a',1),('A',1),('aa',1),('AA',1),('a',1),('aaa',0),('BBB',0);
select if(1,st,st) s from t1 order by s;
s
......
......@@ -6,6 +6,12 @@ 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
Warnings:
Note 1003 select high_priority interval((55,10,20,30,40,50,60,70,80,90,100)) AS `INTERVAL(55,10,20,30,40,50,60,70,80,90,100)`,interval((3,1,(1 + 1),(((1 + 1) + 1) + 1))) AS `interval(3,1,1+1,1+1+1+1)`,field(_latin1'IBM',_latin1'NCA',_latin1'ICL',_latin1'SUN',_latin1'IBM',_latin1'DIGITAL') AS `field("IBM","NCA","ICL","SUN","IBM","DIGITAL")`,field(_latin1'A',_latin1'B',_latin1'C') AS `field("A","B","C")`,elt(2,_latin1'ONE',_latin1'TWO',_latin1'THREE') AS `elt(2,"ONE","TWO","THREE")`,interval((0,1,2,3,4)) AS `interval(0,1,2,3,4)`,(elt(1,1,2,3) | 0) AS `elt(1,1,2,3)|0`,(elt(1,1.1,1.2,1.3) + 0) AS `elt(1,1.1,1.2,1.3)+0`
SELECT INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56);
INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56)
1
SELECT INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56, 77);
INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56, 77)
1
select find_in_set("b","a,b,c"),find_in_set("c","a,b,c"),find_in_set("dd","a,bbb,dd"),find_in_set("bbb","a,bbb,dd");
find_in_set("b","a,b,c") find_in_set("c","a,b,c") find_in_set("dd","a,bbb,dd") find_in_set("bbb","a,bbb,dd")
2 3 3 2
......
......@@ -239,7 +239,7 @@ created datetime default NULL,
modified timestamp(14) NOT NULL,
bugstatus int(10) unsigned default NULL,
submitter int(10) unsigned default NULL
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,'Link',1,1,1,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa','2001-02-28 08:40:16',20010228084016,0,4);
SELECT CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified+0,bugstatus,submitter), '"') FROM t1;
CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified+0,bugstatus,submitter), '"')
......@@ -254,7 +254,7 @@ SELECT bugdesc, REPLACE(bugdesc, 'xxxxxxxxxxxxxxxxxxxx', 'bbbbbbbbbbbbbbbbbbbb')
bugdesc REPLACE(bugdesc, 'xxxxxxxxxxxxxxxxxxxx', 'bbbbbbbbbbbbbbbbbbbb')
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
drop table t1;
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, tmp text NOT NULL, KEY id (id)) TYPE=MyISAM;
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, tmp text NOT NULL, KEY id (id)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1, 'a545f661efdd1fb66fdee3aab79945bf');
SELECT 1 FROM t1 WHERE tmp=AES_DECRYPT(tmp,"password");
1
......@@ -539,7 +539,7 @@ t1 CREATE TABLE `t1` (
`substring(_latin2'ab',1)` char(2) character set latin2 NOT NULL default '',
`insert(_latin2'abcd',2,3,_latin2'ef')` char(6) character set latin2 NOT NULL default '',
`replace(_latin2'abcd',_latin2'b',_latin2'B')` char(4) character set latin2 NOT NULL default ''
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select SUBSTR('abcdefg',3,2);
SUBSTR('abcdefg',3,2)
......@@ -580,7 +580,7 @@ elt(status_wnio,data_podp)
NULL
NULL
DROP TABLE t1;
CREATE TABLE t1 (title text) TYPE=MyISAM;
CREATE TABLE t1 (title text) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('Congress reconvenes in September to debate welfare and adult education');
INSERT INTO t1 VALUES ('House passes the CAREERS bill');
SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from t1;
......
......@@ -49,7 +49,7 @@ t1 CREATE TABLE `t1` (
`database()` char(34) character set utf8 NOT NULL default '',
`user()` char(77) character set utf8 NOT NULL default '',
`version` char(40) default NULL
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select TRUE,FALSE,NULL;
TRUE FALSE NULL
......
......@@ -157,9 +157,9 @@ select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' COLLATE koi8r_bin;
ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'like'
select _koi8r'a' LIKE _latin1'A';
ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'like'
CREATE TABLE t1 ( faq_group_id int(11) NOT NULL default '0', faq_id int(11) NOT NULL default '0', title varchar(240) default NULL, keywords text, description longblob, solution longblob, status tinyint(4) NOT NULL default '0', access_id smallint(6) default NULL, lang_id smallint(6) NOT NULL default '0', created datetime NOT NULL default '0000-00-00 00:00:00', updated datetime default NULL, last_access datetime default NULL, last_notify datetime default NULL, solved_count int(11) NOT NULL default '0', static_solved int(11) default NULL, solved_1 int(11) default NULL, solved_2 int(11) default NULL, solved_3 int(11) default NULL, solved_4 int(11) default NULL, solved_5 int(11) default NULL, expires datetime default NULL, notes text, assigned_to smallint(6) default NULL, assigned_group smallint(6) default NULL, last_edited_by smallint(6) default NULL, orig_ref_no varchar(15) binary default NULL, c$fundstate smallint(6) default NULL, c$contributor smallint(6) default NULL, UNIQUE KEY t1$faq_id (faq_id), KEY t1$group_id$faq_id (faq_group_id,faq_id), KEY t1$c$fundstate (c$fundstate) ) TYPE=MyISAM;
CREATE TABLE t1 ( faq_group_id int(11) NOT NULL default '0', faq_id int(11) NOT NULL default '0', title varchar(240) default NULL, keywords text, description longblob, solution longblob, status tinyint(4) NOT NULL default '0', access_id smallint(6) default NULL, lang_id smallint(6) NOT NULL default '0', created datetime NOT NULL default '0000-00-00 00:00:00', updated datetime default NULL, last_access datetime default NULL, last_notify datetime default NULL, solved_count int(11) NOT NULL default '0', static_solved int(11) default NULL, solved_1 int(11) default NULL, solved_2 int(11) default NULL, solved_3 int(11) default NULL, solved_4 int(11) default NULL, solved_5 int(11) default NULL, expires datetime default NULL, notes text, assigned_to smallint(6) default NULL, assigned_group smallint(6) default NULL, last_edited_by smallint(6) default NULL, orig_ref_no varchar(15) binary default NULL, c$fundstate smallint(6) default NULL, c$contributor smallint(6) default NULL, UNIQUE KEY t1$faq_id (faq_id), KEY t1$group_id$faq_id (faq_group_id,faq_id), KEY t1$c$fundstate (c$fundstate) ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (82,82,'How to use the DynaVox Usage Counts Feature','usages count, number, corner, white, box, button','<as-html>\r\n<table width=\"100%\" border=\"0\">\r\n <tr>\r\n <td width=\"3%\"></td>\r\n <td width=\"97%\">\r\n <h3><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#000000\">How \r\n To</font><!-- #BeginEditable \"CS_troubleshoot_question\" --><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#000099\"><font color=\"#000000\">: \r\n Display or Hide the Usage Counts to find out how many times each button is being selected. </font></font><!-- #EndEditable --></h3>\r\n </td>\r\n </tr>\r\n</table>','<as-html>\r\n <table width=\"100%\" border=\"0\">\r\n <tr>\r\n <td width=\"3%\"></td>\r\n \r\n<td width=\"97%\"><!-- #BeginEditable \"CS_troubleshoot_answer\" --> \r\n \r\n<p><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\">1. Select \r\n the <i>On/Setup</i> button to access the DynaVox Setup Menu.<br>\r\n 2. Select <b>Button Features.</b><br>\r\n 3. Below the <b>OK</b> button is the <b>Usage Counts</b> button.<br>\r\n a. If it says \"Hidden\" then the Usage Counts will not be displayed.<br>\r\n b. If it says \"Displayed\" then the Usage Counts will be shown.<br>\r\n c. Select the <b>Usage Counts</b> Option Ring once and it will toggle \r\n to the alternative option.<br>\r\n 4. Once the correct setting has been chosen, select <b>OK</b> to leave the <i>Button \r\n Features</i> menu.<br>\r\n 5. Select <b>OK</b> out of the <i>Setup</i> menu and return to the communication \r\n page.</font></p>\r\n <p><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\">For \r\n further information on <i>Usage Counts,</i> see the <i>Button Features \r\n Menu Entry</i> in the DynaVox/DynaMyte Reference Manual.</font></p>\r\n<!-- #EndEditable --></td>\r\n </tr>\r\n</table>',4,1,1,'2001-11-16 16:43:34','2002-11-25 12:09:43','2003-07-24 01:04:48',NULL,11,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,11,NULL,NULL,NULL);
CREATE TABLE t2 ( access_id smallint(6) NOT NULL default '0', name varchar(20) binary default NULL, rank smallint(6) NOT NULL default '0', KEY t2$access_id (access_id) ) TYPE=MyISAM;
CREATE TABLE t2 ( access_id smallint(6) NOT NULL default '0', name varchar(20) binary default NULL, rank smallint(6) NOT NULL default '0', KEY t2$access_id (access_id) ) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,'Everyone',2),(2,'Help',3),(3,'Customer Support',1);
SELECT f_acc.rank, a1.rank, a2.rank FROM t1 LEFT JOIN t1 f1 ON (f1.access_id=1 AND f1.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a1 ON (a1.access_id = f1.access_id) LEFT JOIN t1 f2 ON (f2.access_id=3 AND f2.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a2 ON (a2.access_id = f2.access_id), t2 f_acc WHERE LEAST(a1.rank,a2.rank) = f_acc.rank;
rank rank rank
......
......@@ -353,7 +353,7 @@ monthname(date)
NULL
January
drop table t1,t2;
CREATE TABLE t1 (updated text) TYPE=MyISAM;
CREATE TABLE t1 (updated text) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('');
SELECT month(updated) from t1;
month(updated)
......
......@@ -3,7 +3,7 @@ CREATE TABLE t1 (
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
g GEOMETRY NOT NULL,
SPATIAL KEY(g)
) TYPE=MyISAM;
) ENGINE=MyISAM;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
......@@ -11,7 +11,7 @@ t1 CREATE TABLE `t1` (
`g` geometry NOT NULL default '',
PRIMARY KEY (`fid`),
SPATIAL KEY `g` (`g`(32))
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (g) VALUES (GeomFromText('LineString(150 150, 150 150)'));
INSERT INTO t1 (g) VALUES (GeomFromText('LineString(149 149, 151 151)'));
INSERT INTO t1 (g) VALUES (GeomFromText('LineString(148 148, 152 152)'));
......@@ -185,7 +185,7 @@ DROP TABLE t1;
CREATE TABLE t2 (
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
g GEOMETRY NOT NULL
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10))));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10))));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10))));
......@@ -294,7 +294,7 @@ t2 CREATE TABLE `t2` (
`g` geometry NOT NULL default '',
PRIMARY KEY (`fid`),
SPATIAL KEY `g` (`g`(32))
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT count(*) FROM t2;
count(*)
100
......
......@@ -476,13 +476,13 @@ c2id int(11) unsigned default NULL,
value int(11) unsigned NOT NULL default '0',
UNIQUE KEY pid2 (pid,c1id,c2id),
UNIQUE KEY pid (pid,value)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1, 1, NULL, 1),(1, 2, NULL, 2),(1, NULL, 3, 3),(1, 4, NULL, 4),(1, 5, NULL, 5);
CREATE TABLE t2 (
id int(11) unsigned NOT NULL default '0',
active enum('Yes','No') NOT NULL default 'Yes',
PRIMARY KEY (id)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1, 'Yes'),(2, 'No'),(4, 'Yes'),(5, 'No');
CREATE TABLE t3 (
id int(11) unsigned NOT NULL default '0',
......
......@@ -144,7 +144,7 @@ insert into t1 values (17);
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
handler t1 open as t2;
alter table t1 type=MyISAM;
alter table t1 engine=MyISAM;
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
drop table t1;
......
drop table if exists t1;
create table t1 (a int not null,b int not null, primary key (a)) type=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100;
create table t1 (a int not null,b int not null, primary key (a)) engine=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100;
insert into t1 values(1,1),(2,2),(3,3),(4,4);
delete from t1 where a=1 or a=0;
show keys from t1;
......@@ -23,15 +23,15 @@ a b
4 6
alter table t1 add c int not null, add key (c,a);
drop table t1;
create table t1 (a int not null,b int not null, primary key (a)) type=memory comment="testing heaps";
create table t1 (a int not null,b int not null, primary key (a)) engine=memory comment="testing heaps";
insert into t1 values(1,1),(2,2),(3,3),(4,4);
delete from t1 where a > 0;
select * from t1;
a b
drop table t1;
create table t1 (a int not null,b int not null, primary key (a)) type=heap comment="testing heaps";
create table t1 (a int not null,b int not null, primary key (a)) engine=heap comment="testing heaps";
insert into t1 values(1,1),(2,2),(3,3),(4,4);
alter table t1 modify a int not null auto_increment, type=myisam, comment="new myisam table";
alter table t1 modify a int not null auto_increment, engine=myisam, comment="new myisam table";
select * from t1;
a b
1 1
......@@ -39,7 +39,7 @@ a b
3 3
4 4
drop table t1;
create table t1 (a int not null) type=heap;
create table t1 (a int not null) engine=heap;
insert into t1 values (869751),(736494),(226312),(802616);
select * from t1 where a > 736494;
a
......@@ -63,13 +63,13 @@ a
736494
802616
869751
alter table t1 type=myisam;
alter table t1 engine=myisam;
explain select * from t1 where a in (869751,736494,226312,802616);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range uniq_id uniq_id 4 NULL 4 Using where; Using index
drop table t1;
create table t1 (x int not null, y int not null, key x (x), unique y (y))
type=heap;
engine=heap;
insert into t1 values (1,1),(2,2),(1,3),(2,4),(2,5),(2,6);
select * from t1 where x=1;
x y
......@@ -88,13 +88,13 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL x NULL NULL NULL 6
1 SIMPLE t2 eq_ref y y 4 test.t1.x 1
drop table t1;
create table t1 (a int) type=heap;
create table t1 (a int) engine=heap;
insert into t1 values(1);
select max(a) from t1;
max(a)
1
drop table t1;
CREATE TABLE t1 ( a int not null default 0, b int not null default 0, key(a), key(b) ) TYPE=HEAP;
CREATE TABLE t1 ( a int not null default 0, b int not null default 0, key(a), key(b) ) ENGINE=HEAP;
insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6);
select * from t1 where a=1;
a b
......@@ -120,7 +120,7 @@ a b
1 2
1 1
drop table t1;
create table t1 (id int unsigned not null, primary key (id)) type=HEAP;
create table t1 (id int unsigned not null, primary key (id)) engine=HEAP;
insert into t1 values(1);
select max(id) from t1;
max(id)
......@@ -131,12 +131,12 @@ max(id)
2
replace into t1 values(1);
drop table t1;
create table t1 (n int) type=heap;
create table t1 (n int) engine=heap;
drop table t1;
create table t1 (n int) type=heap;
create table t1 (n int) engine=heap;
drop table if exists t1;
CREATE table t1(f1 int not null,f2 char(20) not
null,index(f2)) type=heap;
null,index(f2)) engine=heap;
INSERT into t1 set f1=12,f2="bill";
INSERT into t1 set f1=13,f2="bill";
INSERT into t1 set f1=14,f2="bill";
......@@ -155,7 +155,7 @@ f1 f2
12 ted
12 ted
drop table t1;
create table t1 (btn char(10) not null, key(btn)) type=heap;
create table t1 (btn char(10) not null, key(btn)) engine=heap;
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
explain select * from t1 where btn like "q%";
id select_type table type possible_keys key key_len ref rows Extra
......@@ -176,7 +176,7 @@ a int default NULL,
b int default NULL,
KEY a (a),
UNIQUE b (b)
) type=heap;
) engine=heap;
INSERT INTO t1 VALUES (NULL,99),(99,NULL),(1,1),(2,2),(1,3);
SELECT * FROM t1 WHERE a=NULL;
a b
......@@ -200,7 +200,7 @@ DROP TABLE t1;
CREATE TABLE t1 (
a int default NULL,
key a (a)
) TYPE=HEAP;
) ENGINE=HEAP;
INSERT INTO t1 VALUES (10), (10), (10);
EXPLAIN SELECT * FROM t1 WHERE a=10;
id select_type table type possible_keys key key_len ref rows Extra
......@@ -211,7 +211,7 @@ a
10
10
DROP TABLE t1;
CREATE TABLE t1 (a int not null, primary key(a)) type=heap;
CREATE TABLE t1 (a int not null, primary key(a)) engine=heap;
INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
DELETE from t1 where a < 100;
SELECT * from t1;
......
drop table if exists t1;
create table t1 (a int not null auto_increment,b int, primary key (a)) type=heap auto_increment=3;
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=heap auto_increment=3;
insert into t1 values (1,1),(NULL,3),(NULL,4);
delete from t1 where a=4;
insert into t1 values (NULL,5),(NULL,6);
......@@ -27,7 +27,7 @@ drop table t1;
create table t1 (
skey tinyint unsigned NOT NULL auto_increment PRIMARY KEY,
sval char(20)
) type=heap;
) engine=heap;
insert into t1 values (NULL, "hello");
insert into t1 values (NULL, "hey");
select * from t1;
......
drop table if exists t1;
create table t1 (a int not null,b int not null, primary key using BTREE (a)) type=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100;
create table t1 (a int not null,b int not null, primary key using BTREE (a)) engine=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100;
insert into t1 values(1,1),(2,2),(3,3),(4,4);
delete from t1 where a=1 or a=0;
show keys from t1;
......@@ -23,15 +23,15 @@ a b
4 6
alter table t1 add c int not null, add key using BTREE (c,a);
drop table t1;
create table t1 (a int not null,b int not null, primary key using BTREE (a)) type=heap comment="testing heaps";
create table t1 (a int not null,b int not null, primary key using BTREE (a)) engine=heap comment="testing heaps";
insert into t1 values(-2,-2),(-1,-1),(0,0),(1,1),(2,2),(3,3),(4,4);
delete from t1 where a > -3;
select * from t1;
a b
drop table t1;
create table t1 (a int not null,b int not null, primary key using BTREE (a)) type=heap comment="testing heaps";
create table t1 (a int not null,b int not null, primary key using BTREE (a)) engine=heap comment="testing heaps";
insert into t1 values(1,1),(2,2),(3,3),(4,4);
alter table t1 modify a int not null auto_increment, type=myisam, comment="new myisam table";
alter table t1 modify a int not null auto_increment, engine=myisam, comment="new myisam table";
select * from t1;
a b
1 1
......@@ -39,7 +39,7 @@ a b
3 3
4 4
drop table t1;
create table t1 (a int not null) type=heap;
create table t1 (a int not null) engine=heap;
insert into t1 values (869751),(736494),(226312),(802616);
select * from t1 where a > 736494;
a
......@@ -63,13 +63,13 @@ a
736494
802616
869751
alter table t1 type=myisam;
alter table t1 engine=myisam;
explain select * from t1 where a in (869751,736494,226312,802616);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range uniq_id uniq_id 4 NULL 4 Using where; Using index
drop table t1;
create table t1 (x int not null, y int not null, key x using BTREE (x,y), unique y using BTREE (y))
type=heap;
engine=heap;
insert into t1 values (1,1),(2,2),(1,3),(2,4),(2,5),(2,6);
explain select * from t1 where x=1;
id select_type table type possible_keys key key_len ref rows Extra
......@@ -91,13 +91,13 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL x NULL NULL NULL 6
1 SIMPLE t2 eq_ref y y 4 test.t1.x 1
drop table t1;
create table t1 (a int) type=heap;
create table t1 (a int) engine=heap;
insert into t1 values(1);
select max(a) from t1;
max(a)
1
drop table t1;
CREATE TABLE t1 ( a int not null default 0, b int not null default 0, key using BTREE (a,b), key using BTREE (b) ) TYPE=HEAP;
CREATE TABLE t1 ( a int not null default 0, b int not null default 0, key using BTREE (a,b), key using BTREE (b) ) ENGINE=HEAP;
insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6);
select * from t1 where a=1;
a b
......@@ -136,7 +136,7 @@ explain select * from tx where b=x;
id select_type table type possible_keys key key_len ref rows Extra
x SIMPLE tx ref b b x const x Using where
drop table t1;
create table t1 (id int unsigned not null, primary key using BTREE (id)) type=HEAP;
create table t1 (id int unsigned not null, primary key using BTREE (id)) engine=HEAP;
insert into t1 values(1);
select max(id) from t1;
max(id)
......@@ -147,12 +147,12 @@ max(id)
2
replace into t1 values(1);
drop table t1;
create table t1 (n int) type=heap;
create table t1 (n int) engine=heap;
drop table t1;
create table t1 (n int) type=heap;
create table t1 (n int) engine=heap;
drop table if exists t1;
CREATE table t1(f1 int not null,f2 char(20) not
null,index(f2)) type=heap;
null,index(f2)) engine=heap;
INSERT into t1 set f1=12,f2="bill";
INSERT into t1 set f1=13,f2="bill";
INSERT into t1 set f1=14,f2="bill";
......@@ -171,7 +171,7 @@ f1 f2
12 ted
12 ted
drop table t1;
create table t1 (btn char(10) not null, key using BTREE (btn)) type=heap;
create table t1 (btn char(10) not null, key using BTREE (btn)) engine=heap;
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
explain select * from t1 where btn like "q%";
id select_type table type possible_keys key key_len ref rows Extra
......@@ -192,7 +192,7 @@ a int default NULL,
b int default NULL,
KEY a using BTREE (a),
UNIQUE b using BTREE (b)
) type=heap;
) engine=heap;
INSERT INTO t1 VALUES (NULL,99),(99,NULL),(1,1),(2,2),(1,3);
SELECT * FROM t1 WHERE a=NULL;
a b
......@@ -213,7 +213,7 @@ a b
INSERT INTO t1 VALUES (1,3);
ERROR 23000: Duplicate entry '3' for key 1
DROP TABLE t1;
CREATE TABLE t1 (a int, b int, c int, key using BTREE (a, b, c)) type=heap;
CREATE TABLE t1 (a int, b int, c int, key using BTREE (a, b, c)) engine=heap;
INSERT INTO t1 VALUES (1, NULL, NULL), (1, 1, NULL), (1, NULL, 1);
SELECT * FROM t1 WHERE a=1 and b IS NULL;
a b c
......@@ -227,7 +227,7 @@ SELECT * FROM t1 WHERE a=1 and b IS NULL and c IS NULL;
a b c
1 NULL NULL
DROP TABLE t1;
CREATE TABLE t1 (a int not null, primary key using BTREE (a)) type=heap;
CREATE TABLE t1 (a int not null, primary key using BTREE (a)) engine=heap;
INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
DELETE from t1 where a < 100;
SELECT * from t1;
......
drop table if exists t1;
create table t1 (a int not null,b int not null, primary key using HASH (a)) type=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100;
create table t1 (a int not null,b int not null, primary key using HASH (a)) engine=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100;
insert into t1 values(1,1),(2,2),(3,3),(4,4);
delete from t1 where a=1 or a=0;
show keys from t1;
......@@ -23,15 +23,15 @@ a b
4 6
alter table t1 add c int not null, add key using HASH (c,a);
drop table t1;
create table t1 (a int not null,b int not null, primary key using HASH (a)) type=heap comment="testing heaps";
create table t1 (a int not null,b int not null, primary key using HASH (a)) engine=heap comment="testing heaps";
insert into t1 values(1,1),(2,2),(3,3),(4,4);
delete from t1 where a > 0;
select * from t1;
a b
drop table t1;
create table t1 (a int not null,b int not null, primary key using HASH (a)) type=heap comment="testing heaps";
create table t1 (a int not null,b int not null, primary key using HASH (a)) engine=heap comment="testing heaps";
insert into t1 values(1,1),(2,2),(3,3),(4,4);
alter table t1 modify a int not null auto_increment, type=myisam, comment="new myisam table";
alter table t1 modify a int not null auto_increment, engine=myisam, comment="new myisam table";
select * from t1;
a b
1 1
......@@ -39,7 +39,7 @@ a b
3 3
4 4
drop table t1;
create table t1 (a int not null) type=heap;
create table t1 (a int not null) engine=heap;
insert into t1 values (869751),(736494),(226312),(802616);
select * from t1 where a > 736494;
a
......@@ -63,13 +63,13 @@ a
736494
802616
869751
alter table t1 type=myisam;
alter table t1 engine=myisam;
explain select * from t1 where a in (869751,736494,226312,802616);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range uniq_id uniq_id 4 NULL 4 Using where; Using index
drop table t1;
create table t1 (x int not null, y int not null, key x using HASH (x), unique y using HASH (y))
type=heap;
engine=heap;
insert into t1 values (1,1),(2,2),(1,3),(2,4),(2,5),(2,6);
select * from t1 where x=1;
x y
......@@ -88,13 +88,13 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL x NULL NULL NULL 6
1 SIMPLE t2 eq_ref y y 4 test.t1.x 1
drop table t1;
create table t1 (a int) type=heap;
create table t1 (a int) engine=heap;
insert into t1 values(1);
select max(a) from t1;
max(a)
1
drop table t1;
CREATE TABLE t1 ( a int not null default 0, b int not null default 0, key using HASH (a), key using HASH (b) ) TYPE=HEAP;
CREATE TABLE t1 ( a int not null default 0, b int not null default 0, key using HASH (a), key using HASH (b) ) ENGINE=HEAP;
insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6);
select * from t1 where a=1;
a b
......@@ -120,7 +120,7 @@ a b
1 2
1 1
drop table t1;
create table t1 (id int unsigned not null, primary key using HASH (id)) type=HEAP;
create table t1 (id int unsigned not null, primary key using HASH (id)) engine=HEAP;
insert into t1 values(1);
select max(id) from t1;
max(id)
......@@ -131,12 +131,12 @@ max(id)
2
replace into t1 values(1);
drop table t1;
create table t1 (n int) type=heap;
create table t1 (n int) engine=heap;
drop table t1;
create table t1 (n int) type=heap;
create table t1 (n int) engine=heap;
drop table if exists t1;
CREATE table t1(f1 int not null,f2 char(20) not
null,index(f2)) type=heap;
null,index(f2)) engine=heap;
INSERT into t1 set f1=12,f2="bill";
INSERT into t1 set f1=13,f2="bill";
INSERT into t1 set f1=14,f2="bill";
......@@ -155,7 +155,7 @@ f1 f2
12 ted
12 ted
drop table t1;
create table t1 (btn char(10) not null, key using HASH (btn)) type=heap;
create table t1 (btn char(10) not null, key using HASH (btn)) engine=heap;
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
explain select * from t1 where btn like "q%";
id select_type table type possible_keys key key_len ref rows Extra
......@@ -176,7 +176,7 @@ a int default NULL,
b int default NULL,
KEY a using HASH (a),
UNIQUE b using HASH (b)
) type=heap;
) engine=heap;
INSERT INTO t1 VALUES (NULL,99),(99,NULL),(1,1),(2,2),(1,3);
SELECT * FROM t1 WHERE a=NULL;
a b
......@@ -197,7 +197,7 @@ a b
INSERT INTO t1 VALUES (1,3);
ERROR 23000: Duplicate entry '3' for key 1
DROP TABLE t1;
CREATE TABLE t1 (a int not null, primary key using HASH (a)) type=heap;
CREATE TABLE t1 (a int not null, primary key using HASH (a)) engine=heap;
INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11);
DELETE from t1 where a < 100;
SELECT * from t1;
......
......@@ -132,10 +132,10 @@ help 'impossible_category_1';
source_category_name name is_it_category
impossible_category_1 impossible_function_1 N
impossible_category_1 impossible_function_2 N
alter table mysql.help_relation type=innodb;
alter table mysql.help_keyword type=innodb;
alter table mysql.help_topic type=innodb;
alter table mysql.help_category type=innodb;
alter table mysql.help_relation engine=innodb;
alter table mysql.help_keyword engine=innodb;
alter table mysql.help_topic engine=innodb;
alter table mysql.help_category engine=innodb;
help 'function_of_my_dream';
name is_it_category
help '%possible_f%';
......@@ -222,10 +222,10 @@ help 'impossible_category_1';
source_category_name name is_it_category
impossible_category_1 impossible_function_1 N
impossible_category_1 impossible_function_2 N
alter table mysql.help_relation type=myisam;
alter table mysql.help_keyword type=myisam;
alter table mysql.help_topic type=myisam;
alter table mysql.help_category type=myisam;
alter table mysql.help_relation engine=myisam;
alter table mysql.help_keyword engine=myisam;
alter table mysql.help_topic engine=myisam;
alter table mysql.help_category engine=myisam;
delete from mysql.help_topic where help_topic_id=@topic1_id;
delete from mysql.help_topic where help_topic_id=@topic2_id;
delete from mysql.help_topic where help_topic_id=@topic3_id;
......
......@@ -5,7 +5,7 @@ key1 int not null,
key2 int not null,
INDEX i1(key1),
INDEX i2(key2),
) type=innodb;
) engine=innodb;
explain select * from t1 where key1 < 5 or key2 > 197;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge i1,i2 i1,i2 4,4 NULL 8 Using where
......
select hex(@a);
hex(@a)
NULL
select hex(@a);
hex(@a)
610063
set global init_connect="set @a=2;set @b=3";
select @a, @b;
@a @b
2 3
set GLOBAL init_connect=DEFAULT;
select @a;
@a
NULL
set global init_connect="create table t1(a char(10));\
insert into t1 values ('\0');insert into t1 values('abc')";
select hex(a) from t1;
hex(a)
00
616263
set GLOBAL init_connect="adsfsdfsdfs";
select @a;
ERROR HY000: Lost connection to MySQL server during query
drop table t1;
drop table if exists t1,t2;
create table t1 (id integer, x integer) type=INNODB;
create table t1 (id integer, x integer) engine=INNODB;
insert into t1 values(0, 0);
set autocommit=0;
SELECT * from t1 where id = 0 FOR UPDATE;
......@@ -18,8 +18,8 @@ id x
0 2
commit;
drop table t1;
create table t1 (id integer, x integer) type=INNODB;
create table t2 (b integer, a integer) type=INNODB;
create table t1 (id integer, x integer) engine=INNODB;
create table t2 (b integer, a integer) engine=INNODB;
insert into t1 values(0, 0), (300, 300);
insert into t2 values(0, 10), (1, 20), (2, 30);
commit;
......@@ -54,8 +54,8 @@ id x
300 300
commit;
drop table t1, t2;
create table t1 (id integer, x integer) type=INNODB;
create table t2 (b integer, a integer) type=INNODB;
create table t1 (id integer, x integer) engine=INNODB;
create table t2 (b integer, a integer) engine=INNODB;
insert into t1 values(0, 0), (300, 300);
insert into t2 values(0, 0), (1, 20), (2, 30);
commit;
......
This diff is collapsed.
drop table if exists t1,t2,t3;
flush status;
set autocommit=0;
create table t1 (a int not null) type=innodb;
create table t1 (a int not null) engine=innodb;
insert into t1 values (1),(2),(3);
select * from t1;
a
......@@ -15,7 +15,7 @@ drop table t1;
commit;
set autocommit=1;
begin;
create table t1 (a int not null) type=innodb;
create table t1 (a int not null) engine=innodb;
insert into t1 values (1),(2),(3);
select * from t1;
a
......@@ -27,9 +27,9 @@ Variable_name Value
Qcache_queries_in_cache 0
drop table t1;
commit;
create table t1 (a int not null) type=innodb;
create table t2 (a int not null) type=innodb;
create table t3 (a int not null) type=innodb;
create table t1 (a int not null) engine=innodb;
create table t2 (a int not null) engine=innodb;
create table t3 (a int not null) engine=innodb;
insert into t1 values (1),(2);
insert into t2 values (1),(2);
insert into t3 values (1),(2);
......@@ -99,7 +99,7 @@ show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
drop table if exists t1;
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=InnoDB;
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=InnoDB;
select count(*) from t1;
count(*)
0
......
drop table if exists t1,t2;
create table t1 (a int, b char(10), key a(a), key b(a,b)) type=innodb;
create table t1 (a int, b char(10), key a(a), key b(a,b)) engine=innodb;
insert into t1 values
(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
(14,"aaa"),(15,"bbb"),(16,"ccc"),(16,"xxx"),
......@@ -136,11 +136,11 @@ handler t1 open as t2;
handler t2 read first;
a b
17 ddd
alter table t1 type=innodb;
alter table t1 engine=innodb;
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
drop table t1;
CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY (no1,no2)) TYPE=InnoDB;
CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY (no1,no2)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2);
HANDLER t1 OPEN;
HANDLER t1 READ `primary` = (1, 1000);
......
......@@ -35,7 +35,7 @@ PRIMARY KEY (`numeropost`,`numreponse`)
KEY `date` (`date`),
KEY `pseudo` (`pseudo`),
KEY `numreponse` (`numreponse`)
) TYPE=MyISAM;
) ENGINE=MyISAM;
CREATE TABLE `t2` (
`numeropost` bigint(20) unsigned NOT NULL default '0',
`icone` tinyint(4) unsigned NOT NULL default '0',
......@@ -50,7 +50,7 @@ KEY `ip` (`ip`),
KEY `date` (`date`),
KEY `pseudo` (`pseudo`),
KEY `numreponse` (`numreponse`)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t2
(numeropost,icone,numreponse,contenu,pseudo,date,ip,signature) VALUES
(9,1,56,'test','joce','2001-07-25 13:50:53'
......
drop table if exists t1,t2;
create table t1 (a tinyint not null auto_increment, b blob not null, primary key (a)) type=isam;
create table t1 (a tinyint not null auto_increment, b blob not null, primary key (a)) engine=isam;
delete from t1 where (a & 1);
select sum(length(b)) from t1;
sum(length(b))
3274494
drop table t1;
create table t1 (a int not null auto_increment,b int, primary key (a)) type=isam;
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=isam;
insert into t1 values (1,1),(NULL,2),(3,3),(NULL,4);
delete from t1 where a=4 or a=2;
insert into t1 values (NULL,4),(NULL,5),(6,6);
......@@ -29,20 +29,20 @@ a b c
4 4 NULL
6 6 6
drop table t1;
create table t1 (a int,b text, index(a)) type=isam;
create table t1 (a int,b text, index(a)) engine=isam;
ERROR 42000: Column 'a' is used with UNIQUE or INDEX but is not defined as NOT NULL
create table t1 (a int,b text, index(b)) type=isam;
create table t1 (a int,b text, index(b)) engine=isam;
ERROR 42000: BLOB column 'b' can't be used in key specification with the used table type
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) type=isam;
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=isam;
ERROR 42000: Incorrect table definition; There can only be one auto column and it must be defined as a key
create table t1 (ordid int(8), unique (ordid)) type=isam;
create table t1 (ordid int(8), unique (ordid)) engine=isam;
ERROR 42000: Column 'ordid' is used with UNIQUE or INDEX but is not defined as NOT NULL
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
create table t1 (a int not null primary key, b int not null,c int not null, key(b,c));
insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4);
create table t2 type=isam select * from t1;
create table t2 engine=isam select * from t1;
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
......
......@@ -132,11 +132,11 @@ CREATE TABLE t1 (
a int(11) NOT NULL,
b int(11) NOT NULL,
PRIMARY KEY (a,b)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(2,3);
CREATE TABLE t2 (
a int(11) default NULL
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t2 VALUES (2),(3);
SELECT t1.a,t2.a,b FROM t1,t2 WHERE t1.a=t2.a AND (t1.a=1 OR t1.a=2) AND b>=1 AND b<=3;
a a b
......@@ -236,13 +236,13 @@ min_value double default NULL,
max_value double default NULL,
t3_id int(11) default NULL,
item_id int(11) default NULL
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES (12,5,'Percent','Cost',-1,0,-1,-1),(14,4,'Percent','Cost',-1,0,-1,-1),(18,5,'Percent','Cost',-1,0,-1,-1),(19,4,'Percent','Cost',-1,0,-1,-1),(20,5,'Percent','Cost',100,-1,22,291),(21,5,'Percent','Cost',100,-1,18,291),(22,1,'Percent','Cost',100,-1,6,291),(23,1,'Percent','Cost',100,-1,21,291),(24,1,'Percent','Cost',100,-1,9,291),(25,1,'Percent','Cost',100,-1,4,291),(26,1,'Percent','Cost',100,-1,20,291),(27,4,'Percent','Cost',100,-1,7,202),(28,1,'Percent','Cost',50,-1,-1,137),(29,2,'Percent','Cost',100,-1,4,354),(30,2,'Percent','Cost',100,-1,9,137),(93,2,'Cost','Cost',-1,10000000,-1,-1);
CREATE TABLE t2 (
id int(10) unsigned NOT NULL auto_increment,
name varchar(255) default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,'s1'),(2,'s2'),(3,'s3'),(4,'s4'),(5,'s5');
select t1.*, t2.* from t1, t2 where t2.id=t1.t2_id limit 2;
t1_id t2_id type cost_unit min_value max_value t3_id item_id id name
......@@ -255,7 +255,7 @@ emp_id varchar(30) NOT NULL default '',
rate_code varchar(10) default NULL,
UNIQUE KEY site_emp (siteid,emp_id),
KEY siteid (siteid)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('rivercats','psmith','cust'), ('rivercats','KWalker','cust');
CREATE TABLE t2 (
siteid varchar(25) NOT NULL default '',
......@@ -263,7 +263,7 @@ rate_code varchar(10) NOT NULL default '',
base_rate float NOT NULL default '0',
PRIMARY KEY (siteid,rate_code),
FULLTEXT KEY rate_code (rate_code)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t2 VALUES ('rivercats','cust',20);
SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE emp.emp_id = 'psmith' AND lr.siteid = 'rivercats';
rate_code base_rate
......
......@@ -10,7 +10,7 @@ billing_contact_ptr int(11) default NULL,
comments mediumtext,
PRIMARY KEY (project_id),
UNIQUE KEY project (client_ptr,project_name)
) TYPE=MyISAM PACK_KEYS=1;
) ENGINE=MyISAM PACK_KEYS=1;
INSERT INTO t1 VALUES (1,0,'Rejected Time',1,NULL,NULL,NULL,NULL);
INSERT INTO t1 VALUES (209,0,'MDGRAD Proposal/Investigation',97,NULL,NULL,NULL,'');
INSERT INTO t1 VALUES (208,0,'Font 9 Design',84,NULL,NULL,NULL,'');
......@@ -31,7 +31,7 @@ work_load int(11) default NULL,
PRIMARY KEY (period_id),
KEY period_index (period_type,period_key),
KEY date_index (start_date,end_date)
) TYPE=MyISAM PACK_KEYS=1;
) ENGINE=MyISAM PACK_KEYS=1;
INSERT INTO t2 VALUES (1,'user_table',98,'2000-01-01 00:00:00',NULL,NULL);
INSERT INTO t2 VALUES (2,'user_table',99,'2000-01-01 00:00:00',NULL,NULL);
INSERT INTO t2 VALUES (3,'user_table',100,'2000-01-01 00:00:00',NULL,NULL);
......@@ -57,7 +57,7 @@ amount_received float(10,2) default NULL,
adjustment float(10,2) default NULL,
PRIMARY KEY (budget_id),
UNIQUE KEY po (project_ptr,po_number)
) TYPE=MyISAM PACK_KEYS=1;
) ENGINE=MyISAM PACK_KEYS=1;
CREATE TABLE t4 (
client_id int(11) NOT NULL auto_increment,
client_row_lock int(11) NOT NULL default '0',
......@@ -66,7 +66,7 @@ contact_ptr int(11) default NULL,
comments mediumtext,
PRIMARY KEY (client_id),
UNIQUE KEY client_name (client_name)
) TYPE=MyISAM PACK_KEYS=1;
) ENGINE=MyISAM PACK_KEYS=1;
INSERT INTO t4 VALUES (1,0,'CPS',NULL,NULL);
select distinct
t1.project_id as project_id,
......
......@@ -3,7 +3,7 @@ CREATE TABLE t1 (
grp int(11) default NULL,
a bigint(20) unsigned default NULL,
c char(10) NOT NULL default ''
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1,'a'),(2,2,'b'),(2,3,'c'),(3,4,'E'),(3,5,'C'),(3,6,'D'),(NULL,NULL,'');
create table t2 (id int, a bigint unsigned not null, c char(10), d int, primary key (a));
insert into t2 values (1,1,"a",1),(3,4,"A",4),(3,5,"B",5),(3,6,"C",6),(4,7,"D",7);
......
......@@ -130,7 +130,7 @@ CREATE TABLE t1 (
a tinytext NOT NULL,
b tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (a(32),b)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('a',1),('a',2);
SELECT * FROM t1 WHERE a='a' AND b=2;
a b
......
......@@ -256,4 +256,6 @@ Table Op Msg_type Msg_text
test.t1 assign_to_keycache status OK
test.t2 assign_to_keycache status OK
drop table t1,t2,t3;
set global keycache1.key_buffer_size=0;
set global keycache2.key_buffer_size=0;
set global keycache3.key_buffer_size=100;
set global keycache3.key_buffer_size=0;
drop table if exists t1,t2;
CREATE TABLE t1 ( `id` int(11) NOT NULL default '0', `id2` int(11) NOT NULL default '0', `id3` int(11) NOT NULL default '0', `dummy1` char(30) default NULL, PRIMARY KEY (`id`,`id2`), KEY `index_id3` (`id3`)) TYPE=MyISAM;
CREATE TABLE t1 ( `id` int(11) NOT NULL default '0', `id2` int(11) NOT NULL default '0', `id3` int(11) NOT NULL default '0', `dummy1` char(30) default NULL, PRIMARY KEY (`id`,`id2`), KEY `index_id3` (`id3`)) ENGINE=MyISAM;
insert into t1 (id,id2) values (1,1),(1,2),(1,3);
LOCK TABLE t1 WRITE;
select dummy1,count(distinct id) from t1 group by dummy1;
......@@ -23,11 +23,11 @@ CREATE TABLE t1 (
index1 smallint(6) default NULL,
nr smallint(6) default NULL,
KEY index1(index1)
) TYPE=MyISAM;
) ENGINE=MyISAM;
CREATE TABLE t2 (
nr smallint(6) default NULL,
name varchar(20) default NULL
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,'item1');
INSERT INTO t2 VALUES (2,'item2');
lock tables t1 write, t2 read;
......
drop table if exists t1;
create table t1(a int) type=innodb;
create table t1(a int) engine=innodb;
lock tables t1 write;
insert into t1 values(10);
select * from t1;
......
This diff is collapsed.
drop table if exists t1, t2;
create table t1 (a int) type=innodb;
create table t2 (a int) type=myisam;
create table t1 (a int) engine=innodb;
create table t2 (a int) engine=myisam;
reset master;
begin;
insert into t1 values(1);
......@@ -121,7 +121,7 @@ master-bin.000001 139 Query 1 139 use `test`; insert into t2 select * from t1
master-bin.000001 205 Query 1 205 use `test`; BEGIN
master-bin.000001 245 Query 1 205 use `test`; insert into t1 values(11)
master-bin.000001 305 Query 1 305 use `test`; COMMIT
alter table t2 type=INNODB;
alter table t2 engine=INNODB;
delete from t1;
delete from t2;
reset master;
......
select 1;
1
1
select 2;
select 3;
select 4||||
2
2
3
3
4
4
select 5;
select 6;
select 50, 'abc';'abcd'
5
5
6
6
50 abc
50 abc
select "abcd'";'abcd'
abcd'
abcd'
select "'abcd";'abcd'
'abcd
'abcd
select 5'abcd'
5
5
select 'finish';
finish
finish
......@@ -74,19 +74,19 @@ CREATE TABLE t1 (
id int(11) NOT NULL default '0',
name varchar(10) default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,'aaa'),(2,'aaa'),(3,'aaa');
CREATE TABLE t2 (
id int(11) NOT NULL default '0',
name varchar(10) default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t2 VALUES (2,'bbb'),(3,'bbb'),(4,'bbb');
CREATE TABLE t3 (
id int(11) NOT NULL default '0',
mydate datetime default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t3 VALUES (1,'2002-02-04 00:00:00'),(3,'2002-05-12 00:00:00'),(5,'2002-05-12 00:00:00'),(6,'2002-06-22
00:00:00'),(7,'2002-07-22 00:00:00');
delete t1,t2,t3 from t1,t2,t3 where to_days(now())-to_days(t3.mydate)>=30 and t3.id=t1.id and t3.id=t2.id;
......@@ -102,7 +102,7 @@ CREATE TABLE IF NOT EXISTS `t1` (
`tst` text,
`tst1` text,
PRIMARY KEY (`id`)
) TYPE=MyISAM;
) ENGINE=MyISAM;
CREATE TABLE IF NOT EXISTS `t2` (
`ID` int(11) NOT NULL auto_increment,
`ParId` int(11) default NULL,
......@@ -111,7 +111,7 @@ CREATE TABLE IF NOT EXISTS `t2` (
PRIMARY KEY (`ID`),
KEY `IX_ParId_t2` (`ParId`),
FOREIGN KEY (`ParId`) REFERENCES `t1` (`id`)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1(tst,tst1) VALUES("MySQL","MySQL AB"), ("MSSQL","Microsoft"), ("ORACLE","ORACLE");
INSERT INTO t2(ParId) VALUES(1), (2), (3);
select * from t2;
......@@ -251,11 +251,11 @@ n d
select * from t2;
n d
drop table t1,t2;
CREATE TABLE t1 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) TYPE=MyISAM;
CREATE TABLE t1 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,'jedan'),(2,'dva'),(3,'tri'),(4,'xxxxxxxxxx'),(5,'a'),(10,''),(11,''),(12,''),(13,'');
CREATE TABLE t2 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) TYPE=MyISAM;
CREATE TABLE t2 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,'jedan'),(2,'dva'),(3,'tri'),(4,'xxxxxxxxxx'),(5,'a');
CREATE TABLE t3 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) TYPE=MyISAM;
CREATE TABLE t3 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (1,'jedan'),(2,'dva');
update t1,t2 set t1.naziv="aaaa" where t1.broj=t2.broj;
update t1,t2,t3 set t1.naziv="bbbb", t2.naziv="aaaa" where t1.broj=t2.broj and t2.broj=t3.broj;
......@@ -324,7 +324,7 @@ a b
8 8
9 9
drop table t1,t2;
CREATE TABLE t3 ( KEY1 varchar(50) NOT NULL default '', PARAM_CORR_DISTANCE_RUSH double default NULL, PARAM_CORR_DISTANCE_GEM double default NULL, PARAM_AVG_TARE double default NULL, PARAM_AVG_NB_DAYS double default NULL, PARAM_DEFAULT_PROP_GEM_SRVC varchar(50) default NULL, PARAM_DEFAULT_PROP_GEM_NO_ETIK varchar(50) default NULL, PARAM_SCENARIO_COSTS varchar(50) default NULL, PARAM_DEFAULT_WAGON_COST double default NULL, tmp int(11) default NULL, PRIMARY KEY (KEY1)) TYPE=MyISAM;
CREATE TABLE t3 ( KEY1 varchar(50) NOT NULL default '', PARAM_CORR_DISTANCE_RUSH double default NULL, PARAM_CORR_DISTANCE_GEM double default NULL, PARAM_AVG_TARE double default NULL, PARAM_AVG_NB_DAYS double default NULL, PARAM_DEFAULT_PROP_GEM_SRVC varchar(50) default NULL, PARAM_DEFAULT_PROP_GEM_NO_ETIK varchar(50) default NULL, PARAM_SCENARIO_COSTS varchar(50) default NULL, PARAM_DEFAULT_WAGON_COST double default NULL, tmp int(11) default NULL, PRIMARY KEY (KEY1)) ENGINE=MyISAM;
INSERT INTO t3 VALUES ('A',1,1,22,3.2,'R','R','BASE2',0.24,NULL);
create table t1 (A varchar(1));
insert into t1 values ("A") ,("B"),("C"),("D");
......
......@@ -3,7 +3,7 @@ SET SQL_WARNINGS=1;
CREATE TABLE t1 (
STRING_DATA char(255) default NULL,
KEY string_data (STRING_DATA)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA');
INSERT INTO t1 VALUES ('DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD');
INSERT INTO t1 VALUES ('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF');
......@@ -49,7 +49,7 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par
t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
t1 1 b 1 b A 1 NULL NULL BTREE
drop table t1;
create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) type=myisam;
create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=myisam;
insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
explain select * from t1 order by a;
id select_type table type possible_keys key key_len ref rows Extra
......@@ -313,7 +313,7 @@ KEY `ip` (`ip`),
KEY `poster_login` (`poster_login`),
KEY `topic_id` (`topic_id`),
FULLTEXT KEY `post_text` (`post_text`)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 (post_text) VALUES ('ceci est un test'),('ceci est un test'),('ceci est un test'),('ceci est un test'),('ceci est un test');
REPAIR TABLE t1;
Table Op Msg_type Msg_text
......@@ -398,7 +398,7 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) TYPE=MyISAM;
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM;
ERROR 42000: This version of MySQL doesn't yet support 'RTREE INDEX'
create table t1 (a int, b varchar(200), c text not null) checksum=1;
create table t2 (a int, b varchar(200), c text not null) checksum=0;
......
......@@ -62,3 +62,42 @@ INSERT INTO t1 VALUES ("1\""), ("\"2");
</database>
</mysqldump>
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r;
INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5');
-- MySQL dump 10.3
--
-- Host: localhost Database: test
-- ------------------------------------------------------
-- Server version 5.0.0-alpha-debug-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=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 */;
--
-- Table structure for table `t1`
--
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a varchar(255) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=koi8r;
--
-- Dumping data for table `t1`
--
/*!40000 ALTER TABLE t1 DISABLE KEYS */;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES ('абцде');
UNLOCK TABLES;
/*!40000 ALTER TABLE t1 ENABLE KEYS */;
/*!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 */;
DROP TABLE t1;
......@@ -71,7 +71,7 @@ indexed_field
NULL
NULL
DROP TABLE t1;
create table t1 (a int, b int) type=myisam;
create table t1 (a int, b int) engine=myisam;
insert into t1 values(20,null);
select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
t2.b=t3.a;
......
drop table if exists t1,t2;
create table t1 (a int, b int not null,unique key (a,b),index(b)) type=myisam;
create table t1 (a int, b int not null,unique key (a,b),index(b)) engine=myisam;
insert ignore into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(null,7),(9,9),(8,8),(7,7),(null,9),(null,9),(6,6);
explain select * from t1 where a is null;
id select_type table type possible_keys key key_len ref rows Extra
......@@ -243,12 +243,12 @@ id int(10) unsigned NOT NULL auto_increment,
uniq_id int(10) unsigned default NULL,
PRIMARY KEY (id),
UNIQUE KEY idx1 (uniq_id)
) TYPE=MyISAM;
) ENGINE=MyISAM;
CREATE TABLE t2 (
id int(10) unsigned NOT NULL auto_increment,
uniq_id int(10) unsigned default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4),(9,NULL),(10,NULL);
INSERT INTO t2 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4),(9,NULL),(10,NULL);
explain select id from t1 where uniq_id is null;
......@@ -295,13 +295,13 @@ CREATE TABLE `t1` (
`product_id` char(32) NOT NULL default '',
`product_type` int(11) NOT NULL default '0',
PRIMARY KEY (`order_id`,`product_id`,`product_type`)
) TYPE=MyISAM;
) ENGINE=MyISAM;
CREATE TABLE `t2` (
`order_id` char(32) NOT NULL default '',
`product_id` char(32) NOT NULL default '',
`product_type` int(11) NOT NULL default '0',
PRIMARY KEY (`order_id`,`product_id`,`product_type`)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 (order_id, product_id, product_type) VALUES
('3d7ce39b5d4b3e3d22aaafe9b633de51',1206029, 3),
('3d7ce39b5d4b3e3d22aaafe9b633de51',5880836, 3),
......
......@@ -251,7 +251,7 @@ favo_muziek varchar(30) NOT NULL default '',
info text NOT NULL,
ipnr varchar(30) NOT NULL default '',
PRIMARY KEY (member_id)
) TYPE=MyISAM PACK_KEYS=1;
) ENGINE=MyISAM PACK_KEYS=1;
insert into t1 (member_id) values (1),(2),(3);
select member_id, nickname, voornaam FROM t1
ORDER by lastchange_datum DESC LIMIT 2;
......@@ -429,7 +429,7 @@ gid int(10) unsigned NOT NULL auto_increment,
cid smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (gid),
KEY component_id (cid)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES (103853,108),(103867,108),(103962,108),(104505,108),(104619,108),(104620,108);
ALTER TABLE t1 add skr int(10) not null;
CREATE TABLE t2 (
......@@ -439,12 +439,12 @@ sid tinyint(3) unsigned NOT NULL default '1',
PRIMARY KEY (gid),
KEY uid (uid),
KEY status_id (sid)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t2 VALUES (103853,250,5),(103867,27,5),(103962,27,5),(104505,117,5),(104619,75,5),(104620,15,5);
CREATE TABLE t3 (
uid smallint(6) NOT NULL auto_increment,
PRIMARY KEY (uid)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t3 VALUES (1),(15),(27),(75),(117),(250);
ALTER TABLE t3 add skr int(10) not null;
select t1.gid, t2.sid, t3.uid from t2, t1, t3 where t2.gid = t1.gid and t2.uid = t3.uid order by t3.uid, t1.gid;
......
......@@ -44,7 +44,7 @@ create table t1 (a int not null);
insert into t1 values (1),(2),(3);
create table t2 (a int not null);
insert into t2 values (4),(5),(6);
create table t3 (a int not null) type=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST;
create table t3 (a int not null) engine=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST;
select * from t3;
a
1
......
......@@ -160,7 +160,7 @@ PRIMARY KEY (t1ID),
KEY IdxArt (art),
KEY IdxKnr (KNR),
KEY IdxArtnr (ARTNR)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 (art) VALUES ('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),
......@@ -267,7 +267,7 @@ a int(11) default NULL,
b int(11) default NULL,
KEY a (a),
KEY b (b)
) TYPE=MyISAM;
) ENGINE=MyISAM;
INSERT INTO t1 VALUES
(1,1),(2,1),(3,1),(4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10,2),(10,2),
(13,2),(14,2),(15,2),(16,2),(17,3),(17,3),(16,3),(17,3),(19,3),(20,3),
......
......@@ -4,7 +4,7 @@ repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair warning Number of rows changed from 0 to 1
test.t1 repair status OK
alter table t1 TYPE=HEAP;
alter table t1 ENGINE=HEAP;
repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair error The storage engine for the table doesn't support repair
......@@ -12,4 +12,4 @@ drop table t1;
repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair error Table 'test.t1' doesn't exist
create table t1 type=myisam SELECT 1,"table 1";
create table t1 engine=myisam SELECT 1,"table 1";
......@@ -3,13 +3,13 @@ CREATE TABLE t1 (
gesuchnr int(11) DEFAULT '0' NOT NULL,
benutzer_id int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (gesuchnr,benutzer_id)
) type=ISAM;
) engine=ISAM;
replace into t1 (gesuchnr,benutzer_id) values (2,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
alter table t1 type=myisam;
alter table t1 engine=myisam;
replace into t1 (gesuchnr,benutzer_id) values (1,1);
alter table t1 type=heap;
alter table t1 engine=heap;
replace into t1 (gesuchnr,benutzer_id) values (1,1);
drop table t1;
create table t1 (a tinyint not null auto_increment primary key, b char(20) default "default_value");
......
drop table if exists t1;
create table t1 (n int not null primary key) type=myisam;
create table t1 (n int not null primary key) engine=myisam;
begin work;
insert into t1 values (4);
insert into t1 values (5);
......
......@@ -19,7 +19,7 @@ drop table t1;
set SQL_LOG_BIN=0;
CREATE TABLE t1 (
a int not null
) TYPE=MyISAM MAX_ROWS=4000 CHECKSUM=1;
) ENGINE=MyISAM MAX_ROWS=4000 CHECKSUM=1;
INSERT INTO t1 VALUES (1);
load table t1 from master;
check table t1;
......
......@@ -7,7 +7,7 @@ start slave;
create table t1 (a int);
insert into t1 values (10);
create table t2 (a int);
create table t3 (a int) type=merge union(t1);
create table t3 (a int) engine=merge union(t1);
create table t4 (a int);
insert into t4 select * from t3;
rename table t1 to t5, t2 to t1;
......@@ -18,10 +18,10 @@ master-bin.000001 4 Start 1 4 Server ver: SERVER_VERSION, Binlog ver: 3
master-bin.000001 79 Query 1 79 use `test`; create table t1 (a int)
master-bin.000001 137 Query 1 137 use `test`; insert into t1 values (10)
master-bin.000001 198 Query 1 198 use `test`; create table t2 (a int)
master-bin.000001 256 Query 1 256 use `test`; create table t3 (a int) type=merge union(t1)
master-bin.000001 335 Query 1 335 use `test`; create table t4 (a int)
master-bin.000001 393 Query 1 393 use `test`; insert into t4 select * from t3
master-bin.000001 459 Query 1 459 use `test`; rename table t1 to t5, t2 to t1
master-bin.000001 256 Query 1 256 use `test`; create table t3 (a int) engine=merge union(t1)
master-bin.000001 337 Query 1 337 use `test`; create table t4 (a int)
master-bin.000001 395 Query 1 395 use `test`; insert into t4 select * from t3
master-bin.000001 461 Query 1 461 use `test`; rename table t1 to t5, t2 to t1
select * from t3;
a
flush tables;
......@@ -31,10 +31,10 @@ master-bin.000001 4 Start 1 4 Server ver: SERVER_VERSION, Binlog ver: 3
master-bin.000001 79 Query 1 79 use `test`; create table t1 (a int)
master-bin.000001 137 Query 1 137 use `test`; insert into t1 values (10)
master-bin.000001 198 Query 1 198 use `test`; create table t2 (a int)
master-bin.000001 256 Query 1 256 use `test`; create table t3 (a int) type=merge union(t1)
master-bin.000001 335 Query 1 335 use `test`; create table t4 (a int)
master-bin.000001 393 Query 1 393 use `test`; insert into t4 select * from t3
master-bin.000001 459 Query 1 459 use `test`; rename table t1 to t5, t2 to t1
master-bin.000001 525 Query 1 525 use `test`; flush tables
master-bin.000001 256 Query 1 256 use `test`; create table t3 (a int) engine=merge union(t1)
master-bin.000001 337 Query 1 337 use `test`; create table t4 (a int)
master-bin.000001 395 Query 1 395 use `test`; insert into t4 select * from t3
master-bin.000001 461 Query 1 461 use `test`; rename table t1 to t5, t2 to t1
master-bin.000001 527 Query 1 527 use `test`; flush tables
select * from t3;
a
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
show variables like 'init_slave';
Variable_name Value
init_slave set global max_connections=500
show variables like 'max_connections';
Variable_name Value
max_connections 500
reset master;
show variables like 'init_slave';
Variable_name Value
init_slave
show variables like 'max_connections';
Variable_name Value
max_connections 100
set global init_connect="set @c=1";
show variables like 'init_connect';
Variable_name Value
init_connect set @c=1
stop slave;
......@@ -20,8 +20,8 @@ b c
1 4
drop table t1;
drop table t2;
create table t1(a int auto_increment, key(a)) type=innodb;
create table t2(b int auto_increment, c int, key(b), foreign key(b) references t1(a)) type=innodb;
create table t1(a int auto_increment, key(a)) engine=innodb;
create table t2(b int auto_increment, c int, key(b), foreign key(b) references t1(a)) engine=innodb;
SET FOREIGN_KEY_CHECKS=0;
insert into t1 values (10);
insert into t1 values (null),(null),(null);
......
......@@ -5,7 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
create table t1 (a int) type=innodb;
create table t1 (a int) engine=innodb;
reset slave;
start slave;
stop slave;
......
......@@ -488,7 +488,7 @@ price2 double(11,0),
key (period),
key (name)
);
create temporary table tmp type = myisam select * from t3;
create temporary table tmp engine = myisam select * from t3;
insert into t3 select * from tmp;
insert into tmp select * from t3;
insert into t3 select * from tmp;
......@@ -1288,7 +1288,7 @@ companynr tinyint(2) unsigned zerofill NOT NULL default '00',
companyname char(30) NOT NULL default '',
PRIMARY KEY (companynr),
UNIQUE KEY companyname(companyname)
) TYPE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
companynr companyname
00 Unknown
......@@ -2067,9 +2067,9 @@ 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)) TYPE=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(14) 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)) TYPE=MyISAM;
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);
SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'NULL' AND b.sampletime < 'NULL' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid;
gvid the_success the_fail the_size the_time
......@@ -2289,9 +2289,9 @@ a a a
2 2 2
3 3 3
drop table t1;
CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) TYPE=MyISAM;
CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM;
INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522);
CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=MyISAM;
CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522);
select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5;
aa id t2_id id
......
......@@ -159,7 +159,7 @@ CREATE TABLE `t1` (
`maxnumrep` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`numeropost`),
KEY `maxnumrep` (`maxnumrep`)
) TYPE=MyISAM ROW_FORMAT=FIXED;
) ENGINE=MyISAM ROW_FORMAT=FIXED;
INSERT INTO t1 (titre,maxnumrep) VALUES
('test1','1'),('test2','2'),('test3','3');
SELECT SQL_CALC_FOUND_ROWS titre,numeropost,maxnumrep FROM t1 WHERE numeropost IN (1,2) ORDER BY maxnumrep DESC LIMIT 0, 1;
......
......@@ -77,13 +77,13 @@ show create table t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
`a` int(11) NOT NULL default '0'
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 rename t2;
show create table t2;
Table Create Table
t2 CREATE TEMPORARY TABLE `t2` (
`a` int(11) NOT NULL default '0'
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t2;
create table t1 (
test_set set( 'val1', 'val2', 'val3' ) not null default '',
......@@ -96,7 +96,7 @@ t1 CREATE TABLE `t1` (
`test_set` set('val1','val2','val3') NOT NULL default '',
`name` char(20) default 'O''Brien' COMMENT 'O''Brien as default',
`c` int(11) NOT NULL default '0' COMMENT 'int column'
) TYPE=MyISAM DEFAULT CHARSET=latin1 COMMENT='it''s a table'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='it''s a table'
show full columns from t1;
Field Type Collation Null Key Default Extra Privileges Comment
test_set set('val1','val2','val3') latin1_swedish_ci select,insert,update,references
......@@ -109,7 +109,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0',
UNIQUE KEY `aa` (`a`)
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int not null, primary key (a));
show create table t1;
......@@ -117,7 +117,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0',
PRIMARY KEY (`a`)
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
flush tables;
show open tables;
......@@ -129,14 +129,14 @@ Database Table In_use Name_locked
test t1 0 0
mysql proc 0 0
drop table t1;
create table t1 (a int not null, b VARCHAR(10), INDEX (b) ) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" TYPE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed;
create table t1 (a int not null, b VARCHAR(10), INDEX (b) ) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0',
`b` char(10) default NULL,
KEY `b` (`b`)
) TYPE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test'
alter table t1 MAX_ROWS=200 ROW_FORMAT=dynamic PACK_KEYS=0;
show create table t1;
Table Create Table
......@@ -144,7 +144,7 @@ t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0',
`b` varchar(10) default NULL,
KEY `b` (`b`)
) TYPE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=200 AVG_ROW_LENGTH=10 PACK_KEYS=0 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='test'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=200 AVG_ROW_LENGTH=10 PACK_KEYS=0 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='test'
ALTER TABLE t1 AVG_ROW_LENGTH=0 CHECKSUM=0 COMMENT="" MIN_ROWS=0 MAX_ROWS=0 PACK_KEYS=DEFAULT DELAY_KEY_WRITE=0 ROW_FORMAT=default;
show create table t1;
Table Create Table
......@@ -152,7 +152,7 @@ t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0',
`b` varchar(10) default NULL,
KEY `b` (`b`)
) TYPE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a decimal(9,2), b decimal (9,0), e double(9,2), f double(5,0), h float(3,2), i float(3,0));
show columns from t1;
......@@ -195,7 +195,7 @@ type_blob blob,
type_medium_blob mediumblob,
type_long_blob longblob,
index(type_short)
) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" TYPE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed CHARSET=latin1;
) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed CHARSET=latin1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
......@@ -222,7 +222,7 @@ t1 CREATE TABLE `t1` (
`type_long_blob` longblob,
PRIMARY KEY (`type_tiny`),
KEY `type_short` (`type_short`)
) TYPE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test'
insert into t1 (type_timestamp) values ("2003-02-07 10:00:01");
select * from t1;
type_bool type_tiny type_short type_mediumint type_bigint type_decimal type_numeric empty_char type_char type_varchar type_timestamp type_date type_time type_datetime type_year type_enum type_set type_tinyblob type_blob type_medium_blob type_long_blob
......
delete from mysql.proc;
create procedure syntaxerror(t int);
create procedure syntaxerror(t int)|
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
create procedure syntaxerror(t int);
create procedure syntaxerror(t int)|
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
create procedure syntaxerror(t int);
create procedure syntaxerror(t int)|
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
create procedure proc1()
set @x = 42;
set @x = 42|
create function func1() returns int
return 42;
return 42|
create procedure foo()
create procedure bar() set @x=3;
create procedure bar() set @x=3|
ERROR 2F003: Can't create a PROCEDURE from within another stored routine
create procedure foo()
create function bar() returns double return 2.3;
create function bar() returns double return 2.3|
ERROR 2F003: Can't create a FUNCTION from within another stored routine
create procedure proc1()
set @x = 42;
set @x = 42|
ERROR 42000: PROCEDURE proc1 already exists
create function func1() returns int
return 42;
return 42|
ERROR 42000: FUNCTION func1 already exists
drop procedure proc1;
drop function func1;
alter procedure foo;
drop procedure proc1|
drop function func1|
alter procedure foo|
ERROR 42000: PROCEDURE foo does not exist
alter function foo;
alter function foo|
ERROR 42000: FUNCTION foo does not exist
drop procedure foo;
drop procedure foo|
ERROR 42000: PROCEDURE foo does not exist
drop function foo;
drop function foo|
ERROR 42000: FUNCTION foo does not exist
call foo();
call foo()|
ERROR 42000: PROCEDURE foo does not exist
drop procedure if exists foo;
drop procedure if exists foo|
Warnings:
Warning 1288 PROCEDURE foo does not exist
show create procedure foo;
Warning 1289 PROCEDURE foo does not exist
show create procedure foo|
ERROR 42000: PROCEDURE foo does not exist
create procedure foo()
foo: loop
leave bar;
end loop;
end loop|
ERROR 42000: LEAVE with no matching label: bar
create procedure foo()
foo: loop
iterate bar;
end loop;
end loop|
ERROR 42000: ITERATE with no matching label: bar
create procedure foo()
foo: begin
iterate foo;
end;
end|
ERROR 42000: ITERATE with no matching label: foo
create procedure foo()
foo: loop
foo: loop
set @x=2;
end loop foo;
end loop foo;
end loop foo|
ERROR 42000: Redefining label foo
create procedure foo()
foo: loop
set @x=2;
end loop bar;
end loop bar|
ERROR 42000: End-label bar without match
create procedure foo(out x int)
begin
declare y int;
set x = y;
end;
end|
Warnings:
Warning 1294 Referring to uninitialized variable y
drop procedure foo;
create procedure foo()
begin
select name from mysql.proc;
select type from mysql.proc;
end;
call foo();
ERROR 0A000: SELECT in a stored procedure must have INTO
drop procedure foo;
Warning 1295 Referring to uninitialized variable y
drop procedure foo|
create procedure foo()
return 42;
return 42|
ERROR 42000: RETURN is only allowed in a FUNCTION
create function foo() returns int
begin
declare x int;
select max(c) into x from test.t;
return x;
end;
end|
ERROR 0A000: Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION
create procedure p(x int)
insert into test.t1 values (x);
insert into test.t1 values (x)|
create function f(x int) returns int
return x+42;
call p();
return x+42|
call p()|
ERROR 42000: Wrong number of arguments for PROCEDURE p, expected 1, got 0
call p(1, 2);
call p(1, 2)|
ERROR 42000: Wrong number of arguments for PROCEDURE p, expected 1, got 2
select f();
select f()|
ERROR 42000: Wrong number of arguments for FUNCTION f, expected 1, got 0
select f(1, 2);
select f(1, 2)|
ERROR 42000: Wrong number of arguments for FUNCTION f, expected 1, got 2
drop procedure p;
drop function f;
drop procedure p|
drop function f|
create procedure p(val int, out res int)
begin
declare x int default 0;
......@@ -115,7 +107,7 @@ set res = 0;
else
set res = 1;
end if;
end;
end|
ERROR 42000: Undefined CONDITION: foo
create procedure p(val int, out res int)
begin
......@@ -128,13 +120,13 @@ set res = 0;
else
set res = 1;
end if;
end;
end|
ERROR 42000: Undefined CONDITION: bar
create function f(val int) returns int
begin
declare x int;
set x = val+3;
end;
end|
ERROR 42000: No RETURN found in FUNCTION f
create function f(val int) returns int
begin
......@@ -143,16 +135,16 @@ set x = val+3;
if x < 4 then
return x;
end if;
end;
select f(10);
end|
select f(10)|
ERROR 2F005: FUNCTION f ended without RETURN
drop function f;
drop function f|
create procedure p()
begin
declare c cursor for insert into test.t1 values ("foo", 42);
open c;
close c;
end;
end|
ERROR 42000: Cursor statement must be a SELECT
create procedure p()
begin
......@@ -160,46 +152,46 @@ declare x int;
declare c cursor for select * into x from test.t limit 1;
open c;
close c;
end;
end|
ERROR 42000: Cursor SELECT must not have INTO
create procedure p()
begin
declare c cursor for select * from test.t;
open cc;
close c;
end;
end|
ERROR 42000: Undefined CURSOR: cc
drop table if exists t1;
create table t1 (val int);
drop table if exists t1|
create table t1 (val int)|
create procedure p()
begin
declare c cursor for select * from test.t1;
open c;
open c;
close c;
end;
call p();
end|
call p()|
ERROR 24000: Cursor is already open
drop procedure p;
drop procedure p|
create procedure p()
begin
declare c cursor for select * from test.t1;
open c;
close c;
close c;
end;
call p();
end|
call p()|
ERROR 24000: Cursor is not open
drop procedure p;
alter procedure bar3 sql security invoker;
drop procedure p|
alter procedure bar3 sql security invoker|
ERROR 42000: PROCEDURE bar3 does not exist
alter procedure bar3 name
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA|
ERROR 42000: Identifier name 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' is too long
drop table t1;
drop table if exists t1;
create table t1 (val int, x float);
insert into t1 values (42, 3.1), (19, 1.2);
drop table t1|
drop table if exists t1|
create table t1 (val int, x float)|
insert into t1 values (42, 3.1), (19, 1.2)|
create procedure p()
begin
declare c cursor for select * from t1;
......@@ -207,7 +199,7 @@ declare x int;
open c;
fetch c into x, y;
close c;
end;
end|
ERROR 42000: Undeclared variable: y
create procedure p()
begin
......@@ -216,10 +208,10 @@ declare x int;
open c;
fetch c into x;
close c;
end;
call p();
end|
call p()|
ERROR HY000: Wrong number of FETCH variables
drop procedure p;
drop procedure p|
create procedure p()
begin
declare c cursor for select * from t1;
......@@ -229,55 +221,66 @@ declare z int;
open c;
fetch c into x, y, z;
close c;
end;
call p();
end|
call p()|
ERROR HY000: Wrong number of FETCH variables
drop procedure p;
drop procedure p|
create procedure p(in x int, x char(10))
begin
end;
end|
ERROR 42000: Duplicate parameter: x
create function p(x int, x char(10))
begin
end;
end|
ERROR 42000: Duplicate parameter: x
create procedure p()
begin
declare x float;
declare x int;
end;
end|
ERROR 42000: Duplicate variable: x
create procedure p()
begin
declare c condition for 1064;
declare c condition for 1065;
end;
end|
ERROR 42000: Duplicate condition: c
create procedure p()
begin
declare c cursor for select * from t1;
declare c cursor for select field from t1;
end;
end|
ERROR 42000: Duplicate cursor: c
create procedure bug1965()
begin
declare c cursor for select val from t1 order by valname;
open c;
close c;
end;
call bug1965();
end|
call bug1965()|
ERROR 42S22: Unknown column 'valname' in 'order clause'
drop procedure bug1965;
select 1 into a;
drop procedure bug1965|
select 1 into a|
ERROR 42000: Undeclared variable: a
create procedure bug336(id char(16))
begin
declare x int;
set x = (select sum(t.data) from test.t2 t);
end;
end|
ERROR 0A000: Subselect value not supported
create function bug1654()
returns int
return (select sum(t.data) from test.t2 t);
return (select sum(t.data) from test.t2 t)|
ERROR 0A000: Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION
drop table t1;
drop table if exists table_1|
create table t3 (column_1_0 int)|
create procedure bug1653()
update t3 set column_1 = 0|
call bug1653()|
ERROR 42S22: Unknown column 'column_1' in 'field list'
drop table t3|
create table t3 (column_1 int)|
call bug1653()|
drop procedure bug1653|
drop table t3|
drop table t1|
use test;
grant usage on *.* to dummy@localhost;
drop database if exists db1_secret;
create database db1_secret;
use db1_secret;
create table t1 ( u varchar(64), i int );
create procedure stamp(i int)
insert into db1_secret.t1 values (user(), i);
show procedure status like 'stamp';
Name Type Definer Modified Created Security_type Comment
stamp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
call stamp(1);
select * from t1;
u i
root@localhost 1
call stamp(2);
select * from db1_secret.t1;
ERROR 42000: Access denied for user: 'dummy'@'localhost' to database 'db1_secret'
call stamp(3);
select * from db1_secret.t1;
ERROR 42000: Access denied for user: ''@'localhost' to database 'db1_secret'
select * from t1;
u i
root@localhost 1
dummy@localhost 2
anon@localhost 3
alter procedure stamp sql security invoker;
show procedure status like 'stamp';
Name Type Definer Modified Created Security_type Comment
stamp PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 INVOKER
call stamp(4);
select * from t1;
u i
root@localhost 1
dummy@localhost 2
anon@localhost 3
root@localhost 4
call stamp(5);
ERROR 42000: Access denied for user: 'dummy'@'localhost' to database 'db1_secret'
call stamp(6);
ERROR 42000: Access denied for user: ''@'localhost' to database 'db1_secret'
drop procedure stamp;
use test;
drop database db1_secret;
delete from mysql.user where user='dummy';
This diff is collapsed.
......@@ -5,7 +5,7 @@ a int not null auto_increment,
`email` varchar(60) character set latin2 NOT NULL default '',
PRIMARY KEY (a),
UNIQUE KEY `email` USING BTREE (`email`)
) TYPE=HEAP CHARSET=latin1 ROW_FORMAT DYNAMIC;
) ENGINE=HEAP CHARSET=latin1 ROW_FORMAT DYNAMIC;
set @@sql_mode="";
show variables like 'sql_mode';
Variable_name Value
......@@ -18,7 +18,7 @@ t1 CREATE TABLE `t1` (
`email` varchar(60) character set latin2 NOT NULL default '',
PRIMARY KEY (`a`),
UNIQUE KEY `email` TYPE BTREE (`email`)
) TYPE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
) ENGINE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
set @@sql_mode="ansi_quotes";
show variables like 'sql_mode';
Variable_name Value
......@@ -31,7 +31,7 @@ t1 CREATE TABLE "t1" (
"email" varchar(60) character set latin2 NOT NULL default '',
PRIMARY KEY ("a"),
UNIQUE KEY "email" TYPE BTREE ("email")
) TYPE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
) ENGINE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
set @@sql_mode="no_table_options";
show variables like 'sql_mode';
Variable_name Value
......@@ -57,7 +57,7 @@ t1 CREATE TABLE `t1` (
`email` varchar(60) character set latin2 NOT NULL default '',
PRIMARY KEY (`a`),
UNIQUE KEY `email` (`email`)
) TYPE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
) ENGINE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
set @@sql_mode="no_field_options,mysql323,mysql40";
show variables like 'sql_mode';
Variable_name Value
......@@ -70,7 +70,7 @@ t1 CREATE TABLE `t1` (
`email` varchar(60) NOT NULL default '',
PRIMARY KEY (`a`),
UNIQUE KEY `email` (`email`)
) TYPE=HEAP ROW_FORMAT=DYNAMIC
) ENGINE=HEAP ROW_FORMAT=DYNAMIC
set sql_mode="postgresql,oracle,mssql,db2,maxdb";
select @@sql_mode;
@@sql_mode
......
......@@ -5,7 +5,7 @@ Table_locks_immediate 0
Table_locks_waited 0
SET SQL_LOG_BIN=0;
drop table if exists t1;
create table t1(n int) type=myisam;
create table t1(n int) engine=myisam;
insert into t1 values(1);
lock tables t1 read;
unlock tables;
......
This diff is collapsed.
......@@ -12,7 +12,7 @@ DOCID VARCHAR(32)BINARY NOT NULL
, MODIFIER VARCHAR(255)BINARY
, ORIGINATOR INTEGER
, PRIMARY KEY ( DOCID )
) TYPE=InnoDB
) ENGINE=InnoDB
;
CREATE TABLE t2
(
......@@ -36,7 +36,7 @@ DOCID VARCHAR(32)BINARY NOT NULL
, PUBLISHSTATUS INTEGER
, ORIGINATOR INTEGER
, PRIMARY KEY ( DOCID )
) TYPE=InnoDB
) ENGINE=InnoDB
;
CREATE INDEX DDOCTYPEID_IDX ON t2 (DOCTYPEID);
CREATE INDEX DFOLDERID_IDX ON t2 (FOLDERID);
......@@ -55,7 +55,7 @@ FOLDERID VARCHAR(32)BINARY NOT NULL
, REPID VARCHAR(32)BINARY
, ORIGINATOR INTEGER
, PRIMARY KEY ( FOLDERID )
) TYPE=InnoDB;
) ENGINE=InnoDB;
CREATE INDEX FFOLDERID_IDX ON t3 (FOLDERID);
CREATE INDEX CMFLDRPARNT_IDX ON t3 (PARENTID);
CREATE TABLE t4
......@@ -68,7 +68,7 @@ DOCTYPEID VARCHAR(32)BINARY NOT NULL
, MODIFIER VARCHAR(255)BINARY
, ORIGINATOR INTEGER
, PRIMARY KEY ( DOCTYPEID )
) TYPE=InnoDB;
) ENGINE=InnoDB;
INSERT INTO t2 VALUES("c373e9f59cf15a6c3e57444553544200", "c373e9f59cf15a6c3e57444553544200", "340d243d45f111d497b00010a4ef934d", "2f6161e879db43c1a5b82c21ddc49089", NULL, "2003-06-06 07:48:42", NULL, NULL, NULL, "2003-06-06 07:48:42", "2003-06-06 07:48:42", NULL, NULL, NULL, "03eea05112b845949f3fd03278b5fe43", "2003-06-06 07:48:42", "admin", "0", NULL);
INSERT INTO t2 VALUES("c373e9f5a472f43ba45e444553544200", "c373e9f5a472f43ba45e444553544200", "340d243d45f111d497b00010a4ef934d", "2f6161e879db43c1a5b82c21ddc49089", NULL, "2003-06-07 18:50:12", NULL, NULL, NULL, "2003-06-07 18:50:12", "2003-06-07 18:50:12", NULL, NULL, NULL, "03eea05112b845949f3fd03278b5fe43", "2003-06-07 18:50:12", "admin", "0", NULL);
INSERT INTO t2 VALUES("c373e9f5a4a0f56014eb444553544200", "c373e9f5a4a0f56014eb444553544200", "340d243d45f111d497b00010a4ef934d", "2f6161e879db43c1a5b82c21ddc49089", NULL, "2003-06-07 19:39:26", NULL, NULL, NULL, "2003-06-07 19:39:26", "2003-06-07 19:39:26", NULL, NULL, NULL, "03eea05112b845949f3fd03278b5fe43", "2003-06-07 19:39:26", "admin", "0", NULL);
......
......@@ -14,7 +14,7 @@ FOLDERID VARCHAR(32)BINARY NOT NULL
, REPID VARCHAR(32)BINARY
, ORIGINATOR INTEGER
, PRIMARY KEY ( FOLDERID )
) TYPE=InnoDB;
) ENGINE=InnoDB;
CREATE INDEX FFOLDERID_IDX ON t1 (FOLDERID);
CREATE INDEX CMFLDRPARNT_IDX ON t1 (PARENTID);
INSERT INTO t1 VALUES("0c9aab05b15048c59bc35c8461507deb", "System", "System", "2003-06-05 16:30:00", "The system content repository folder.", "3", "2003-06-05 16:30:00", "System", "0", NULL, "9c9aab05b15048c59bc35c8461507deb", "1");
......@@ -24,9 +24,9 @@ SELECT 'c373e9f5ad0791a0dab5444553544200' IN(SELECT t1.FOLDERID FROM t1 WHERE t1
'c373e9f5ad0791a0dab5444553544200' IN(SELECT t1.FOLDERID FROM t1 WHERE t1.PARENTID='2f6161e879db43c1a5b82c21ddc49089' AND t1.FOLDERNAME = 'Level1')
0
drop table t1;
create table t1 (a int) type=innodb;
create table t2 (a int) type=innodb;
create table t3 (a int) type=innodb;
create table t1 (a int) engine=innodb;
create table t2 (a int) engine=innodb;
create table t3 (a int) engine=innodb;
insert into t1 values (1),(2),(3),(4);
insert into t2 values (10),(20),(30),(40);
insert into t3 values (1),(2),(10),(50);
......@@ -39,12 +39,12 @@ drop table t1,t2,t3;
CREATE TABLE t1 (
processor_id INTEGER NOT NULL,
PRIMARY KEY (processor_id)
) TYPE=InnoDB;
) ENGINE=InnoDB;
CREATE TABLE t3 (
yod_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
login_processor INTEGER UNSIGNED ,
PRIMARY KEY (yod_id)
) TYPE=InnoDB;
) ENGINE=InnoDB;
CREATE TABLE t2 (
processor_id INTEGER NOT NULL,
yod_id BIGINT UNSIGNED NOT NULL,
......@@ -53,7 +53,7 @@ INDEX (processor_id),
INDEX (yod_id),
FOREIGN KEY (processor_id) REFERENCES t1(processor_id),
FOREIGN KEY (yod_id) REFERENCES t3(yod_id)
) TYPE=InnoDB;
) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1),(2),(3);
INSERT INTO t3 VALUES (1,1),(2,2),(3,3);
INSERT INTO t2 VALUES (1,1),(2,2),(3,3);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment