Merge 5.1->5.1-rpl

Fix paths and name of a few files to make it work with new mtr.pl
This commit is contained in:
Magnus Svensson 2008-05-30 11:12:07 +02:00
commit 867b60e08b
1343 changed files with 298106 additions and 131741 deletions
.bzr-mysql
.bzrignore
BUILD
Docs
Makefile.am
client
configure.in
include
libmysql
libmysqld
mysql-test
extra/rpl_tests
include
mysql-test-run.pl
r

4
.bzr-mysql/default.conf Normal file
View file

@ -0,0 +1,4 @@
[MYSQL]
post_commit_to = "commits@lists.mysql.com"
post_push_to = "commits@lists.mysql.com"
tree_name = "mysql-5.1"

View file

@ -1288,6 +1288,8 @@ mysql-test/gmon.out
mysql-test/install_test_db
mysql-test/lib/My/SafeProcess/my_safe_process
mysql-test/lib/init_db.sql
mysql-test/linux_sys_vars.inc
mysql-test/load_sysvars.inc
mysql-test/mtr
mysql-test/mysql-test-run
mysql-test/mysql-test-run-shell
@ -1323,6 +1325,7 @@ mysql-test/r/im_client_port.log
mysql-test/r/index_merge_load.result
mysql-test/r/isam.err
mysql-test/r/lowercase_table2.err
mysql-test/r/max_allowed_packet_func.result
mysql-test/r/multi_update.err
mysql-test/r/mysql_protocols.err
mysql-test/r/mysqlbinlog.err
@ -1400,6 +1403,7 @@ mysql-test/t/index_merge.load
mysql-test/t/tmp.test
mysql-test/var
mysql-test/var/*
mysql-test/windows_sys_vars.inc
mysql.kdevprj
mysql.proj
mysql_priv.h
@ -3021,3 +3025,8 @@ win/vs8cache.txt
ylwrap
zlib/*.ds?
zlib/*.vcproj
mysql-test/bug36522-64.tar
mysql-test/bug36522.tar
mysql-test/t.log
mysql-test/tps.log
libmysqld/event_parse_data.cc

View file

@ -20,6 +20,7 @@
EXTRA_DIST = FINISH.sh \
SETUP.sh \
autorun.sh \
build_mccge.sh \
check-cpu \
cleanup \
compile-alpha \
@ -27,8 +28,12 @@ EXTRA_DIST = FINISH.sh \
compile-alpha-cxx \
compile-alpha-debug \
compile-amd64-debug-max \
compile-amd64-debug-max-no-ndb \
compile-amd64-gcov \
compile-amd64-gprof \
compile-amd64-max \
compile-amd64-max-sci \
compile-amd64-valgrind-max \
compile-darwin-mwcc \
compile-dist \
compile-hpux11-parisc2-aCC \
@ -51,8 +56,12 @@ EXTRA_DIST = FINISH.sh \
compile-pentium-mysqlfs-debug \
compile-pentium-pgcc \
compile-pentium-valgrind-max \
compile-pentium64 \
compile-pentium64-debug \
compile-pentium64-debug-max \
compile-pentium64-gcov \
compile-pentium64-gprof \
compile-pentium64-max \
compile-pentium64-max-sci \
compile-pentium64-valgrind-max \
compile-ppc \
@ -60,6 +69,10 @@ EXTRA_DIST = FINISH.sh \
compile-ppc-debug-max \
compile-ppc-debug-max-no-ndb \
compile-ppc-max \
compile-solaris-amd64 \
compile-solaris-amd64-debug \
compile-solaris-amd64-forte \
compile-solaris-amd64-forte-debug \
compile-solaris-sparc \
compile-solaris-sparc-debug \
compile-solaris-sparc-forte \

View file

@ -19,11 +19,24 @@ EXTRA_DIST = mysql.info INSTALL-BINARY @extra_docs@
# automake only seems to take care of this automatically,
# if we're building the info page from texi directly.
install-data-hook: $(srcdir)/mysql.info
$(mkinstalldirs) $(DESTDIR)$(infodir)
$(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(infodir)
if test `basename $(prefix)` = "mysql" ; then \
$(mkinstalldirs) $(DESTDIR)$(prefix)/docs ; \
$(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(prefix)/docs ; \
test ! -f $(top_srcdir)/ChangeLog || $(INSTALL_DATA) $(top_srcdir)/ChangeLog $(DESTDIR)$(prefix)/docs ; \
else \
$(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(pkgdatadir) ; \
$(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(infodir) ; \
test ! -f $(top_srcdir)/ChangeLog || $(INSTALL_DATA) $(top_srcdir)/ChangeLog $(DESTDIR)$(pkgdatadir) ; \
fi
uninstall-local:
@RM@ -f $(DESTDIR)$(infodir)/mysql.info
if test `basename $(prefix)` = "mysql" ; then \
@RM@ -f $(DESTDIR)$(prefix)/docs/mysql.info ; \
@RM@ -f $(DESTDIR)$(prefix)/docs/ChangeLog ; \
else \
@RM@ -f $(DESTDIR)$(infodir)/mysql.info ; \
@RM@ -f $(DESTDIR)$(pkgdatadir)/ChangeLog ; \
fi
# Don't update the files from bitkeeper
%::SCCS/s.%

View file

@ -66,7 +66,7 @@ tags:
test-pl test-force-pl test-full-pl test-force-full-pl test-force-pl-mem \
test-unit test-ps test-nr test-pr test-ns test-binlog-statement \
test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp \
test-ext-stress test-ext test-embedded \
test-ext-stress test-ext test-embedded test-reprepare \
test-fast test-fast-cursor test-fast-view test-fast-prepare \
test-full-qa
@ -111,6 +111,11 @@ test-embedded:
echo "no program found for 'embedded' tests - skipped testing" ; \
fi
test-reprepare:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(force) $(mem) --ps-protocol \
--mysqld=--debug=+d,reprepare_each_statement
test: test-unit test-ns test-pr
test-full: test test-nr test-ps
@ -132,15 +137,33 @@ test-bt:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=ps --force --timer \
--skip-ndbcluster --ps-protocol
-if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
cd mysql-test ; \
MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=ndb+rpl_ndb+ps --force --timer \
--ps-protocol --mysqld=--binlog-format=row --suite=ndb,rpl_ndb ; \
MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=ndb --force --timer \
--with-ndbcluster-only ; \
else \
echo "no program found for 'ndbcluster' tests - skipped testing" ; \
fi
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=normal+rowrepl --force --timer \
--skip-ndbcluster --mysqld=--binlog-format=row
@PERL@ ./mysql-test-run.pl --force --comment=funcs1+ps --ps-protocol --suite=funcs_1
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=ps+rowrepl+NDB --force --timer \
--ps-protocol --mysqld=--binlog-format=row
@PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=NDB --force --timer \
--with-ndbcluster-only
@PERL@ ./mysql-test-run.pl --force --comment=partitions --suite=parts
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
-if [ -d mysql-test/suite/nist ] ; then \
cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=nist --force --suite=nist ; \
fi
-if [ -d mysql-test/suite/nist ] ; then \
cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=nist+ps --force --suite=nist --ps-protocol ; \
fi
-if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \
cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=embedded --force --timer \
@ -148,24 +171,6 @@ test-bt:
else \
echo "no program found for 'embedded' tests - skipped testing" ; \
fi
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=funcs1_ps --ps-protocol --suite=funcs_1
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=rpl --suite=rpl
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=partitions --suite=parts
-if [ -d mysql-test/suite/nist ] ; then \
cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=NIST+normal --force --suite=nist ; \
fi
-if [ -d mysql-test/suite/nist ] ; then \
cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=NIST+ps --force --suite=nist --ps-protocol ; \
fi
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
# Re-enable the "jp" suite when bug#28563 is fixed
# -cd mysql-test ; MTR_BUILD_THREAD=auto \

View file

@ -43,6 +43,8 @@ static DYNAMIC_STRING ds_args;
static char *opt_password= 0;
static my_bool tty_password= 0;
static char opt_tmpdir[FN_REFLEN];
#ifndef DBUG_OFF
static char *default_dbug_option= (char*) "d:t:O,/tmp/mysql_upgrade.trace";
#endif
@ -113,6 +115,8 @@ static struct my_option my_long_options[]=
#endif
{"socket", 'S', "Socket file to use for connection.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tmpdir", 't', "Directory for temporary files",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"user", 'u', "User for login if not current user.", (uchar**) &opt_user,
(uchar**) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h>
@ -239,6 +243,11 @@ get_one_option(int optid, const struct my_option *opt,
}
break;
case 't':
strnmov(opt_tmpdir, argument, sizeof(opt_tmpdir));
add_option= FALSE;
break;
case 'b': /* --basedir */
case 'v': /* --verbose */
case 'd': /* --datadir */
@ -460,7 +469,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
char query_file_path[FN_REFLEN];
DBUG_ENTER("run_query");
DBUG_PRINT("enter", ("query: %s", query));
if ((fd= create_temp_file(query_file_path, NULL,
if ((fd= create_temp_file(query_file_path, opt_tmpdir,
"sql", O_CREAT | O_SHARE | O_RDWR,
MYF(MY_WME))) < 0)
die("Failed to create temporary file for defaults");

View file

@ -1926,7 +1926,7 @@ int main(int argc, char** argv)
DBUG_ENTER("main");
DBUG_PROCESS(argv[0]);
init_time(); // for time functions
my_init_time(); // for time functions
parse_args(&argc, (char***)&argv);
defaults_argv=argv;

View file

@ -4347,7 +4347,10 @@ static int do_flush_tables_read_lock(MYSQL *mysql_con)
update starts between the two FLUSHes, we have that bad stall.
*/
return
( mysql_query_with_error_report(mysql_con, 0, "FLUSH TABLES") ||
( mysql_query_with_error_report(mysql_con, 0,
((opt_master_data != 0) ?
"FLUSH /*!40101 LOCAL */ TABLES" :
"FLUSH TABLES")) ||
mysql_query_with_error_report(mysql_con, 0,
"FLUSH TABLES WITH READ LOCK") );
}

View file

@ -1549,7 +1549,7 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname)
DBUG_ENTER("dyn_string_cmp");
DBUG_PRINT("enter", ("fname: %s", fname));
if ((fd= create_temp_file(temp_file_path, NULL,
if ((fd= create_temp_file(temp_file_path, TMPDIR,
"tmp", O_CREAT | O_SHARE | O_RDWR,
MYF(MY_WME))) < 0)
die("Failed to create temporary file for ds");
@ -5669,6 +5669,7 @@ void init_win_path_patterns()
const char* paths[] = { "$MYSQL_TEST_DIR",
"$MYSQL_TMP_DIR",
"$MYSQLTEST_VARDIR",
"$MASTER_MYSOCK",
"./test/" };
int num_paths= sizeof(paths)/sizeof(char*);
int i;
@ -5773,8 +5774,10 @@ void fix_win_paths(const char *val, int len)
*/
void append_field(DYNAMIC_STRING *ds, uint col_idx, MYSQL_FIELD* field,
const char* val, ulonglong len, my_bool is_null)
char* val, ulonglong len, my_bool is_null)
{
char null[]= "NULL";
if (col_idx < max_replace_column && replace_column[col_idx])
{
val= replace_column[col_idx];
@ -5782,7 +5785,7 @@ void append_field(DYNAMIC_STRING *ds, uint col_idx, MYSQL_FIELD* field,
}
else if (is_null)
{
val= "NULL";
val= null;
len= 4;
}
#ifdef __WIN__
@ -5796,9 +5799,18 @@ void append_field(DYNAMIC_STRING *ds, uint col_idx, MYSQL_FIELD* field,
(start[1] == '-' || start[1] == '+') && start[2] == '0')
{
start+=2; /* Now points at first '0' */
/* Move all chars after the first '0' one step left */
memmove(start, start + 1, strlen(start));
len--;
if (field->flags & ZEROFILL_FLAG)
{
/* Move all chars before the first '0' one step right */
memmove(val + 1, val, start - val);
*val= '0';
}
else
{
/* Move all chars after the first '0' one step left */
memmove(start, start + 1, strlen(start));
len--;
}
}
}
#endif
@ -5837,7 +5849,7 @@ void append_result(DYNAMIC_STRING *ds, MYSQL_RES *res)
lengths = mysql_fetch_lengths(res);
for (i = 0; i < num_fields; i++)
append_field(ds, i, &fields[i],
(const char*)row[i], lengths[i], !row[i]);
row[i], lengths[i], !row[i]);
if (!display_result_vertically)
dynstr_append_mem(ds, "\n", 1);
}
@ -5886,7 +5898,7 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
while (mysql_stmt_fetch(stmt) == 0)
{
for (i= 0; i < num_fields; i++)
append_field(ds, i, &fields[i], (const char *) my_bind[i].buffer,
append_field(ds, i, &fields[i], my_bind[i].buffer,
*my_bind[i].length, *my_bind[i].is_null);
if (!display_result_vertically)
dynstr_append_mem(ds, "\n", 1);
@ -8284,8 +8296,6 @@ uint replace_len(char * str)
uint len=0;
while (*str)
{
if (str[0] == '\\' && str[1])
str++;
str++;
len++;
}
@ -8298,7 +8308,6 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
char * word_end_chars)
{
static const int SPACE_CHAR= 256;
static const int START_OF_LINE= 257;
static const int END_OF_LINE= 258;
uint i,j,states,set_nr,len,result_len,max_length,found_end,bits_set,bit_nr;
@ -8384,35 +8393,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
}
for (pos=from[i], len=0; *pos ; pos++)
{
if (*pos == '\\' && *(pos+1))
{
pos++;
switch (*pos) {
case 'b':
follow_ptr->chr = SPACE_CHAR;
break;
case '^':
follow_ptr->chr = START_OF_LINE;
break;
case '$':
follow_ptr->chr = END_OF_LINE;
break;
case 'r':
follow_ptr->chr = '\r';
break;
case 't':
follow_ptr->chr = '\t';
break;
case 'v':
follow_ptr->chr = '\v';
break;
default:
follow_ptr->chr = (uchar) *pos;
break;
}
}
else
follow_ptr->chr= (uchar) *pos;
follow_ptr->chr= (uchar) *pos;
follow_ptr->table_offset=i;
follow_ptr->len= ++len;
follow_ptr++;

View file

@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
#
# When changing major version number please also check switch statement
# in mysqlbinlog::check_master_version().
AM_INIT_AUTOMAKE(mysql, 5.1.25-rc)
AM_INIT_AUTOMAKE(mysql, 5.1.26-rc)
AM_CONFIG_HEADER([include/config.h:config.h.in])
PROTOCOL_VERSION=10

View file

@ -96,6 +96,7 @@ extern const char *client_errors[]; /* Error messages */
#define CR_NOT_IMPLEMENTED 2054
#define CR_SERVER_LOST_EXTENDED 2055
#define CR_STMT_CLOSED 2056
#define CR_ERROR_LAST /*Copy last error nr:*/ 2056
#define CR_NEW_STMT_METADATA 2057
#define CR_ERROR_LAST /*Copy last error nr:*/ 2057
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */

View file

@ -570,7 +570,7 @@ typedef unsigned short ushort;
#define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
#define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0)
#define swap_variables(t, a, b) { register t dummy; dummy= a; a= b; b= dummy; }
#define swap_variables(t, a, b) { t dummy; dummy= a; a= b; b= dummy; }
#define test(a) ((a) ? 1 : 0)
#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)

View file

@ -90,6 +90,9 @@ extern int NEAR my_errno; /* Last error in mysys */
#define ME_COLOUR1 ((1 << ME_HIGHBYTE)) /* Possibly error-colours */
#define ME_COLOUR2 ((2 << ME_HIGHBYTE))
#define ME_COLOUR3 ((3 << ME_HIGHBYTE))
#define ME_FATALERROR 1024 /* Fatal statement error */
#define ME_NO_WARNING_FOR_ERROR 2048 /* Don't push a warning for error */
#define ME_NO_SP_HANDLER 4096 /* Don't call stored routine error handlers */
/* Bits in last argument to fn_format */
#define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */

View file

@ -95,7 +95,7 @@ long calc_daynr(uint year,uint month,uint day);
uint calc_days_in_year(uint year);
uint year_2000_handling(uint year);
void init_time(void);
void my_init_time(void);
/*

View file

@ -112,6 +112,7 @@ extern int myrg_reset(MYRG_INFO *info);
extern void myrg_extrafunc(MYRG_INFO *info,invalidator_by_filename inv);
extern ha_rows myrg_records_in_range(MYRG_INFO *info, int inx,
key_range *min_key, key_range *max_key);
extern ha_rows myrg_records(MYRG_INFO *info);
extern ulonglong myrg_position(MYRG_INFO *info);
#ifdef __cplusplus

View file

@ -184,19 +184,38 @@ enum enum_server_command
#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
/*
/**
The server was able to fulfill the clients request and opened a
read-only non-scrollable cursor for a query. This flag comes
in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands.
*/
#define SERVER_STATUS_CURSOR_EXISTS 64
/*
/**
This flag is sent when a read-only cursor is exhausted, in reply to
COM_STMT_FETCH command.
*/
#define SERVER_STATUS_LAST_ROW_SENT 128
#define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */
#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512
/**
Sent to the client if after a prepared statement reprepare
we discovered that the new statement returns a different
number of result set columns.
*/
#define SERVER_STATUS_METADATA_CHANGED 1024
/**
Server status flags that must be cleared when starting
execution of a new SQL statement.
Flags from this set are only added to the
current server status by the execution engine, but
never removed -- the execution engine expects them
to disappear automagically by the next command.
*/
#define SERVER_STATUS_CLEAR_SET (SERVER_QUERY_NO_GOOD_INDEX_USED| \
SERVER_QUERY_NO_INDEX_USED|\
SERVER_MORE_RESULTS_EXISTS|\
SERVER_STATUS_METADATA_CHANGED)
#define MYSQL_ERRMSG_SIZE 512
#define NET_READ_TIMEOUT 30 /* Timeout on read */
@ -205,6 +224,7 @@ enum enum_server_command
#define ONLY_KILL_QUERY 1
struct st_vio; /* Only C */
typedef struct st_vio Vio;

View file

@ -84,6 +84,7 @@ const char *client_errors[]=
"This feature is not implemented yet",
"Lost connection to MySQL server at '%s', system error: %d",
"Statement closed indirectly because of a preceeding %s() call",
"The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again",
""
};
@ -149,6 +150,7 @@ const char *client_errors[]=
"This feature is not implemented yet",
"Lost connection to MySQL server at '%s', system error: %d",
"Statement closed indirectly because of a preceeding %s() call",
"The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again",
""
};
@ -212,6 +214,7 @@ const char *client_errors[]=
"This feature is not implemented yet",
"Lost connection to MySQL server at '%s', system error: %d",
"Statement closed indirectly because of a preceeding %s() call",
"The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again",
""
};
#endif

View file

@ -1706,6 +1706,7 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *, MYSQL_FIELD *field);
#define RESET_SERVER_SIDE 1
#define RESET_LONG_DATA 2
#define RESET_STORE_RESULT 4
#define RESET_CLEAR_ERROR 8
static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags);
@ -2090,7 +2091,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
To be removed when all commands will fully support prepared mode.
*/
static unsigned int alloc_stmt_fields(MYSQL_STMT *stmt)
static void alloc_stmt_fields(MYSQL_STMT *stmt)
{
MYSQL_FIELD *fields, *field, *end;
MEM_ROOT *alloc= &stmt->mem_root;
@ -2108,7 +2109,10 @@ static unsigned int alloc_stmt_fields(MYSQL_STMT *stmt)
!(stmt->bind= (MYSQL_BIND *) alloc_root(alloc,
sizeof(MYSQL_BIND) *
stmt->field_count)))
return 0;
{
set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate, NULL);
return;
}
for (fields= mysql->fields, end= fields+stmt->field_count,
field= stmt->fields;
@ -2127,13 +2131,15 @@ static unsigned int alloc_stmt_fields(MYSQL_STMT *stmt)
field->def = fields->def ? strdup_root(alloc,fields->def): 0;
field->max_length= 0;
}
return stmt->field_count;
}
/*
/**
Update result set columns metadata if it was sent again in
reply to COM_STMT_EXECUTE.
@note If the new field count is different from the original one,
an error is set and no update is performed.
*/
static void update_stmt_fields(MYSQL_STMT *stmt)
@ -2143,7 +2149,22 @@ static void update_stmt_fields(MYSQL_STMT *stmt)
MYSQL_FIELD *stmt_field= stmt->fields;
MYSQL_BIND *my_bind= stmt->bind_result_done ? stmt->bind : 0;
DBUG_ASSERT(stmt->field_count == stmt->mysql->field_count);
if (stmt->field_count != stmt->mysql->field_count)
{
/*
The tables used in the statement were altered,
and the query now returns a different number of columns.
There is no way to continue without reallocating the bind
array:
- if the number of columns increased, mysql_stmt_fetch()
will write beyond allocated memory
- if the number of columns decreased, some user-bound
buffers will be left unassigned without user knowing
that.
*/
set_stmt_error(stmt, CR_NEW_STMT_METADATA, unknown_sqlstate, NULL);
return;
}
for (; field < field_end; ++field, ++stmt_field)
{
@ -2792,6 +2813,50 @@ my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt,
}
/**
Update statement result set metadata from with the new field
information sent during statement execute.
@pre mysql->field_count is not zero
@retval TRUE if error: out of memory or the new
result set has a different number of columns
@retval FALSE success
*/
static void reinit_result_set_metadata(MYSQL_STMT *stmt)
{
/* Server has sent result set metadata */
if (stmt->field_count == 0)
{
/*
This is 'SHOW'/'EXPLAIN'-like query. Current implementation of
prepared statements can't send result set metadata for these queries
on prepare stage. Read it now.
*/
alloc_stmt_fields(stmt);
}
else
{
/*
Update result set metadata if it for some reason changed between
prepare and execute, i.e.:
- in case of 'SELECT ?' we don't know column type unless data was
supplied to mysql_stmt_execute, so updated column type is sent
now.
- if data dictionary changed between prepare and execute, for
example a table used in the query was altered.
Note, that now (4.1.3) we always send metadata in reply to
COM_STMT_EXECUTE (even if it is not necessary), so either this or
previous branch always works.
TODO: send metadata only when it's really necessary and add a warning
'Metadata changed' when it's sent twice.
*/
update_stmt_fields(stmt);
}
}
/*
Send placeholders data to server (if there are placeholders)
and execute prepared statement.
@ -2847,7 +2912,7 @@ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt)
DBUG_RETURN(1);
}
if (reset_stmt_handle(stmt, RESET_STORE_RESULT))
if (reset_stmt_handle(stmt, RESET_STORE_RESULT | RESET_CLEAR_ERROR))
DBUG_RETURN(1);
/*
No need to check for stmt->state: if the statement wasn't
@ -2855,40 +2920,10 @@ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt)
*/
if (mysql->methods->stmt_execute(stmt))
DBUG_RETURN(1);
stmt->state= MYSQL_STMT_EXECUTE_DONE;
if (mysql->field_count)
{
/* Server has sent result set metadata */
if (stmt->field_count == 0)
{
/*
This is 'SHOW'/'EXPLAIN'-like query. Current implementation of
prepared statements can't send result set metadata for these queries
on prepare stage. Read it now.
*/
alloc_stmt_fields(stmt);
}
else
{
/*
Update result set metadata if it for some reason changed between
prepare and execute, i.e.:
- in case of 'SELECT ?' we don't know column type unless data was
supplied to mysql_stmt_execute, so updated column type is sent
now.
- if data dictionary changed between prepare and execute, for
example a table used in the query was altered.
Note, that now (4.1.3) we always send metadata in reply to
COM_STMT_EXECUTE (even if it is not necessary), so either this or
previous branch always works.
TODO: send metadata only when it's really necessary and add a warning
'Metadata changed' when it's sent twice.
*/
update_stmt_fields(stmt);
}
}
stmt->state= MYSQL_STMT_EXECUTE_DONE;
if (stmt->field_count)
{
reinit_result_set_metadata(stmt);
if (stmt->server_status & SERVER_STATUS_CURSOR_EXISTS)
{
mysql->status= MYSQL_STATUS_READY;
@ -2903,7 +2938,7 @@ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt)
network or b) is more efficient if all (few) result set rows are
precached on client and server's resources are freed.
*/
DBUG_RETURN(mysql_stmt_store_result(stmt));
mysql_stmt_store_result(stmt);
}
else
{
@ -2912,7 +2947,7 @@ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt)
stmt->read_row_func= stmt_read_row_unbuffered;
}
}
DBUG_RETURN(0);
DBUG_RETURN(test(stmt->last_errno));
}
@ -4766,6 +4801,12 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
DBUG_RETURN(1);
}
if (stmt->last_errno)
{
/* An attempt to use an invalid statement handle. */
DBUG_RETURN(1);
}
if (mysql->status == MYSQL_STATUS_READY &&
stmt->server_status & SERVER_STATUS_CURSOR_EXISTS)
{
@ -4973,9 +5014,10 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags)
stmt->state= MYSQL_STMT_INIT_DONE;
return 1;
}
stmt_clear_error(stmt);
}
}
if (flags & RESET_CLEAR_ERROR)
stmt_clear_error(stmt);
stmt->state= MYSQL_STMT_PREPARE_DONE;
}
return 0;
@ -4986,7 +5028,8 @@ my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt)
DBUG_ENTER("mysql_stmt_free_result");
/* Free the client side and close the server side cursor if there is one */
DBUG_RETURN(reset_stmt_handle(stmt, RESET_LONG_DATA | RESET_STORE_RESULT));
DBUG_RETURN(reset_stmt_handle(stmt, RESET_LONG_DATA | RESET_STORE_RESULT |
RESET_CLEAR_ERROR));
}
/********************************************************************
@ -5067,7 +5110,9 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt)
DBUG_RETURN(1);
}
/* Reset the client and server sides of the prepared statement */
DBUG_RETURN(reset_stmt_handle(stmt, RESET_SERVER_SIDE | RESET_LONG_DATA));
DBUG_RETURN(reset_stmt_handle(stmt,
RESET_SERVER_SIDE | RESET_LONG_DATA |
RESET_CLEAR_ERROR));
}
/*

View file

@ -147,14 +147,12 @@ ENDIF(WITH_CSV_STORAGE_ENGINE)
SET(SOURCE_SUBLIBS FALSE)
SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../libmysql/libmysql.c ../libmysql/errmsg.c ../client/get_password.c
../sql-common/client.c ../sql-common/my_time.c
../sql-common/my_user.c ../sql-common/pack.c
../sql/password.c ../sql/discover.cc ../sql/derror.cc
../sql/event_scheduler.cc ../sql/events.cc
../sql/event_data_objects.cc ../sql/event_queue.cc
../sql/event_db_repository.cc ../sql/field.cc ../sql/field_conv.cc
../sql/field.cc ../sql/field_conv.cc
../sql/filesort.cc ../sql/gstream.cc ../sql/ha_partition.cc
../sql/handler.cc ../sql/hash_filo.cc ../sql/hostname.cc
../sql/init.cc ../sql/item_buff.cc ../sql/item_cmpfunc.cc
@ -187,7 +185,8 @@ SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc
../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc
../sql/partition_info.cc ../sql/sql_connect.cc
../sql/scheduler.cc
../sql/scheduler.cc ../sql/stacktrace.c
../sql/event_parse_data.cc
${GEN_SOURCES}
${LIB_SOURCES})

View file

@ -73,12 +73,10 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
event_scheduler.cc events.cc event_data_objects.cc \
event_queue.cc event_db_repository.cc \
rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
sql_tablespace.cc \
rpl_injector.cc my_user.c partition_info.cc \
sql_servers.cc
sql_servers.cc event_parse_data.cc
libmysqld_int_a_SOURCES= $(libmysqld_sources)
nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)

View file

@ -285,7 +285,7 @@ static int emb_stmt_execute(MYSQL_STMT *stmt)
my_bool res;
int4store(header, stmt->stmt_id);
header[4]= stmt->flags;
header[4]= (uchar) stmt->flags;
thd= (THD*)stmt->mysql->thd;
thd->client_param_count= stmt->param_count;
thd->client_params= stmt->params;
@ -848,7 +848,7 @@ void Protocol_text::remove_last_row()
{
MYSQL_DATA *data= thd->cur_data;
MYSQL_ROWS **last_row_hook= &data->data;
uint count= data->rows;
my_ulonglong count= data->rows;
DBUG_ENTER("Protocol_text::remove_last_row");
while (--count)
last_row_hook= &(*last_row_hook)->next;
@ -1124,6 +1124,9 @@ bool Protocol::net_store_data(const uchar *from, size_t length)
return FALSE;
}
#if defined(_MSC_VER) && _MSC_VER < 1400
#define vsnprintf _vsnprintf
#endif
int vprint_msg_to_log(enum loglevel level __attribute__((unused)),
const char *format, va_list argsi)

View file

@ -28,9 +28,17 @@ drop table if exists t1, t2, t3;
-- source include/master-slave.inc
#should work for both SBR and RBR
# If concurrent inserts are on, it is not guaranteed that the rows
# inserted by INSERT are immediately accessible by SELECT in another
# thread. This would cause problems near the line 'connection master1'
# below. So we turn off concurrent inserts.
connection master;
create table t1(a int auto_increment, key(a));
create table t2(b int auto_increment, c int, key(b));
SET @old_concurrent_insert= @@global.concurrent_insert;
SET @@global.concurrent_insert= 0;
connection master;
eval create table t1(a int auto_increment, key(a)) engine=$engine_type;
eval create table t2(b int auto_increment, c int, key(b)) engine=$engine_type;
insert into t1 values (1),(2),(3);
insert into t1 values (null);
insert into t2 values (null,last_insert_id());
@ -68,8 +76,8 @@ connection master;
drop table t2;
drop table t1;
create table t1(a int auto_increment, key(a));
create table t2(b int auto_increment, c int, key(b));
eval create table t1(a int auto_increment, key(a)) engine=$engine_type;
eval create table t2(b int auto_increment, c int, key(b)) engine=$engine_type;
insert into t1 values (10);
insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
@ -94,7 +102,7 @@ sync_with_master;
connection master;
SET TIMESTAMP=1000000000;
CREATE TABLE t1 ( a INT UNIQUE );
eval CREATE TABLE t1 ( a INT UNIQUE ) engine=$engine_type;
SET FOREIGN_KEY_CHECKS=0;
# Duplicate Key Errors
--error 1022, ER_DUP_ENTRY
@ -109,8 +117,8 @@ sync_slave_with_master;
--echo #
connection master;
create table t1(a int auto_increment, key(a));
create table t2(a int);
eval create table t1(a int auto_increment, key(a)) engine=$engine_type;
eval create table t2(a int) engine=$engine_type;
insert into t1 (a) values (null);
insert into t2 (a) select a from t1 where a is null;
insert into t2 (a) select a from t1 where a is null;
@ -139,11 +147,11 @@ drop function if exists bug15728_insert;
drop table if exists t1, t2;
--enable_warnings
create table t1 (
eval create table t1 (
id int not null auto_increment,
last_id int,
primary key (id)
);
) engine=$engine_type;
create function bug15728() returns int(11)
return last_insert_id();
@ -152,11 +160,11 @@ insert into t1 (last_id) values (last_insert_id());
insert into t1 (last_id) values (bug15728());
# Check that nested call replicates too.
create table t2 (
eval create table t2 (
id int not null auto_increment,
last_id int,
primary key (id)
);
) engine=$engine_type;
delimiter |;
create function bug15728_insert() returns int(11) modifies sql data
begin
@ -215,8 +223,8 @@ drop procedure foo;
# test of BUG#20188 REPLACE or ON DUPLICATE KEY UPDATE in
# auto_increment breaks binlog
create table t1 (n int primary key auto_increment not null,
b int, unique(b));
eval create table t1 (n int primary key auto_increment not null,
b int, unique(b)) engine=$engine_type;
# First, test that we do not call restore_auto_increment() too early
# in write_record():
@ -257,8 +265,8 @@ select * from t1 order by n;
# and now test for the bug:
connection master;
drop table t1;
create table t1 (n int primary key auto_increment not null,
b int, unique(b));
eval create table t1 (n int primary key auto_increment not null,
b int, unique(b)) engine=$engine_type;
insert into t1 values(null,100);
select * from t1 order by n;
sync_slave_with_master;
@ -282,29 +290,29 @@ sync_slave_with_master;
connection master;
# testcase with INSERT VALUES
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
UNIQUE(b));
eval CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
UNIQUE(b)) ENGINE=$engine_type;
INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
SELECT * FROM t1;
SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;
SELECT * FROM t1;
SELECT * FROM t1 ORDER BY a;
connection master;
drop table t1;
# tescase with INSERT SELECT
CREATE TABLE t1 (
eval CREATE TABLE t1 (
id bigint(20) unsigned NOT NULL auto_increment,
field_1 int(10) unsigned NOT NULL,
field_2 varchar(255) NOT NULL,
field_3 varchar(255) NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY field_1 (field_1, field_2)
);
CREATE TABLE t2 (
) ENGINE=$engine_type;
eval CREATE TABLE t2 (
field_a int(10) unsigned NOT NULL,
field_b varchar(255) NOT NULL,
field_c varchar(255) NOT NULL
);
) ENGINE=$engine_type;
INSERT INTO t2 (field_a, field_b, field_c) VALUES (1, 'a', '1a');
INSERT INTO t2 (field_a, field_b, field_c) VALUES (2, 'b', '2b');
INSERT INTO t2 (field_a, field_b, field_c) VALUES (3, 'c', '3c');
@ -324,9 +332,9 @@ SELECT t2.field_a, t2.field_b, t2.field_c
FROM t2
ON DUPLICATE KEY UPDATE
t1.field_3 = t2.field_c;
SELECT * FROM t1;
SELECT * FROM t1 ORDER BY id;
sync_slave_with_master;
SELECT * FROM t1;
SELECT * FROM t1 ORDER BY id;
connection master;
drop table t1, t2;
@ -348,17 +356,17 @@ DROP TABLE IF EXISTS t1, t2;
# Reset result of LAST_INSERT_ID().
SELECT LAST_INSERT_ID(0);
CREATE TABLE t1 (
eval CREATE TABLE t1 (
id INT NOT NULL DEFAULT 0,
last_id INT,
PRIMARY KEY (id)
);
) ENGINE=$engine_type;
CREATE TABLE t2 (
eval CREATE TABLE t2 (
id INT NOT NULL AUTO_INCREMENT,
last_id INT,
PRIMARY KEY (id)
);
) ENGINE=$engine_type;
delimiter |;
CREATE PROCEDURE p1()
@ -369,12 +377,12 @@ END|
delimiter ;|
CALL p1();
SELECT * FROM t1;
SELECT * FROM t2;
SELECT * FROM t1 ORDER BY id;
SELECT * FROM t2 ORDER BY id;
sync_slave_with_master;
SELECT * FROM t1;
SELECT * FROM t2;
SELECT * FROM t1 ORDER BY id;
SELECT * FROM t2 ORDER BY id;
connection master;
@ -394,11 +402,11 @@ DROP FUNCTION IF EXISTS f3;
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
CREATE TABLE t1 (
eval CREATE TABLE t1 (
i INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
j INT DEFAULT 0
);
CREATE TABLE t2 (i INT);
) ENGINE=$engine_type;
eval CREATE TABLE t2 (i INT) ENGINE=$engine_type;
delimiter |;
CREATE PROCEDURE p1()
@ -443,14 +451,16 @@ UPDATE t1 SET j= -1 WHERE i IS NULL;
# Test statement-based replication of function calls.
INSERT INTO t1 (i) VALUES (NULL);
# Here, we rely on having set @@concurrent_insert= 0 (see comment at
# the top of this file).
connection master1;
INSERT INTO t1 (i) VALUES (NULL);
connection master;
SELECT f3();
SELECT * FROM t1;
SELECT * FROM t2;
SELECT * FROM t1 ORDER BY i;
SELECT * FROM t2 ORDER BY i;
sync_slave_with_master;
SELECT * FROM t1;
@ -472,11 +482,11 @@ sync_slave_with_master;
# Tests in this file are tightly bound together. Recreate t2.
connection master;
create table t2 (
eval create table t2 (
id int not null auto_increment,
last_id int,
primary key (id)
);
) engine=$engine_type;
# Test for BUG#20341 "stored function inserting into one
@ -484,7 +494,8 @@ create table t2 (
connection master;
truncate table t2;
create table t1 (id tinyint primary key); # no auto_increment
# no auto_increment
eval create table t1 (id tinyint primary key) engine=$engine_type;
delimiter |;
create function insid() returns int
@ -504,20 +515,20 @@ insert into t2 (id) values(5),(6),(7);
delete from t2 where id>=5;
set sql_log_bin=1;
insert into t1 select insid();
select * from t1;
select * from t2;
select * from t1 order by id;
select * from t2 order by id;
sync_slave_with_master;
select * from t1;
select * from t2;
select * from t1 order by id;
select * from t2 order by id;
connection master;
drop table t1;
drop function insid;
truncate table t2;
create table t1 (n int primary key auto_increment not null,
b int, unique(b));
eval create table t1 (n int primary key auto_increment not null,
b int, unique(b)) engine=$engine_type;
delimiter |;
create procedure foo()
begin
@ -528,14 +539,15 @@ begin
end|
delimiter ;|
call foo();
select * from t1;
select * from t2;
select * from t1 order by n;
select * from t2 order by id;
sync_slave_with_master;
select * from t1;
select * from t2;
select * from t1 order by n;
select * from t2 order by id;
connection master;
drop table t1, t2;
drop procedure foo;
SET @@global.concurrent_insert= @old_concurrent_insert;
sync_slave_with_master;

View file

@ -0,0 +1,154 @@
################# mysql-test\t\binlog_cache_size_basic.test ####################
# #
# Variable Name: binlog_cache_size #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: Numeric #
# Default Value: 32768 #
# Range: 4096 - 4294967295 #
# #
# #
# Creation Date: 2008-04-28 #
# Author: Salman Rawala/Horst Hunger #
# #
# Description: Test Cases of Dynamic System Variable "binlog_cache_size" #
# that checks behavior of this variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity . #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html#option_mysqld_binlog_cache_size #
# #
################################################################################
#################################################################
# START OF binlog_cache_size TESTS #
#################################################################
#########################################################################
# Saving initial value of binlog_cache_size in a temporary variable #
#########################################################################
SET @start_value = @@global.binlog_cache_size;
SELECT @start_value;
--echo '#--------------------FN_DYNVARS_006_01------------------------#'
#########################################################################
# Display the DEFAULT value of binlog_cache_size #
#########################################################################
SET @@global.binlog_cache_size = 100;
SET @@global.binlog_cache_size = DEFAULT;
SELECT @@global.binlog_cache_size;
--echo '#---------------------FN_DYNVARS_006_02-------------------------#'
###############################################
# Verify default value of variable #
###############################################
SET @@global.binlog_cache_size = @start_value;
SELECT @@global.binlog_cache_size = 32768;
--echo '#--------------------FN_DYNVARS_006_03------------------------#'
#########################################################################
# Change the value of binlog_cache_size to a valid value #
#########################################################################
SET @@global.binlog_cache_size = 4096;
SELECT @@global.binlog_cache_size;
SET @@global.binlog_cache_size = 4294967295;
SELECT @@global.binlog_cache_size;
SET @@global.binlog_cache_size = 10000;
SELECT @@global.binlog_cache_size;
SET @@global.binlog_cache_size = 21221204;
SELECT @@global.binlog_cache_size;
echo 'Bug: Invalid values are coming in variable on assigning valid values';
--echo '#--------------------FN_DYNVARS_006_04-------------------------#'
############################################################################
# Change the value of binlog_cache_size to invalid value #
############################################################################
SET @@global.binlog_cache_size = 1024;
SELECT @@global.binlog_cache_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.binlog_cache_size = 10000.01;
SET @@global.binlog_cache_size = -1024;
SELECT @@global.binlog_cache_size;
SET @@global.binlog_cache_size = 42949672950;
SELECT @@global.binlog_cache_size;
echo 'Bug: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.binlog_cache_size = ON;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.binlog_cache_size = 'test';
--echo '#-------------------FN_DYNVARS_006_05----------------------------#'
############################################################################
# Test if accessing session binlog_cache_size gives error #
############################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.binlog_cache_size = 0;
--echo '#----------------------FN_DYNVARS_006_06------------------------#'
##############################################################################
# Check if the value in GLOBAL Tables matches values in variable #
##############################################################################
SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size';
--echo '#---------------------FN_DYNVARS_006_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.binlog_cache_size = TRUE;
SELECT @@global.binlog_cache_size;
SET @@global.binlog_cache_size = FALSE;
SELECT @@global.binlog_cache_size;
echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
--echo '#---------------------FN_DYNVARS_006_08----------------------#'
###############################################################################
# Check if accessing variable without SCOPE points to same global variable #
###############################################################################
SET @@global.binlog_cache_size = 1;
SELECT @@binlog_cache_size = @@global.binlog_cache_size;
--echo '#---------------------FN_DYNVARS_006_09----------------------#'
###########################################################################
# Check if binlog_cache_size can be accessed with and without @@ sign #
###########################################################################
--Error ER_GLOBAL_VARIABLE
SET binlog_cache_size = 1;
--Error ER_PARSE_ERROR
SET global.binlog_cache_size = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.binlog_cache_size;
--Error ER_BAD_FIELD_ERROR
SELECT binlog_cache_size = @@session.binlog_cache_size;
##############################
# Restore initial value #
##############################
SET @@global.binlog_cache_size = @start_value;
SELECT @@global.binlog_cache_size;
###########################################################
# END OF binlog_cache_size TESTS #
###########################################################

View file

@ -0,0 +1,203 @@
############## mysql-test\t\bulk_insert_buffer_size_basic.test #################
# #
# Variable Name: bulk_insert_buffer_size #
# Scope: GLOBAL & SESSION #
# Access Type: Dynamic #
# Data Type: Numeric #
# Default Value: 8388608 #
# Range: 0 - 4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman Rawala #
# #
# Description: Test Cases of Dynamic System Variable "bulk_insert_buffer_size" #
# that checks behavior of this variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity . #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html#option_mysqld_bulk_insert_buffer_size #
# #
################################################################################
--source include/load_sysvars.inc
#######################################################################
# START OF bulk_insert_buffer_size TESTS #
#######################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.bulk_insert_buffer_size;
SELECT @start_global_value;
SET @start_session_value = @@session.bulk_insert_buffer_size;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_007_01-------------------------#'
#######################################################################
# Display the DEFAULT value of bulk_insert_buffer_size #
#######################################################################
SET @@global.bulk_insert_buffer_size = 100;
SET @@global.bulk_insert_buffer_size = DEFAULT;
SELECT @@global.bulk_insert_buffer_size;
SET @@session.bulk_insert_buffer_size = 200;
SET @@session.bulk_insert_buffer_size = DEFAULT;
SELECT @@session.bulk_insert_buffer_size;
--echo '#--------------------FN_DYNVARS_007_02-------------------------#'
#######################################################################
# Check the DEFAULT value of bulk_insert_buffer_size #
#######################################################################
SET @@global.bulk_insert_buffer_size = @start_global_value;
SELECT @@global.bulk_insert_buffer_size = 8388608;
SET @@session.bulk_insert_buffer_size = @start_session_value;
SELECT @@session.bulk_insert_buffer_size = 8388608;
--echo '#--------------------FN_DYNVARS_007_03-------------------------#'
###############################################################################
#Change the value of bulk_insert_buffer_size to valid values for GLOBAL Scope #
###############################################################################
SET @@global.bulk_insert_buffer_size = 0;
SELECT @@global.bulk_insert_buffer_size;
SET @@global.bulk_insert_buffer_size = 1;
SELECT @@global.bulk_insert_buffer_size;
SET @@global.bulk_insert_buffer_size = 4294967295;
SELECT @@global.bulk_insert_buffer_size;
SET @@global.bulk_insert_buffer_size = 429496;
SELECT @@global.bulk_insert_buffer_size;
--echo '#--------------------FN_DYNVARS_007_04-------------------------#'
###############################################################################
#Change the value of bulk_insert_buffer_size to valid values for SESSION Scope#
###############################################################################
SET @@session.bulk_insert_buffer_size = 0;
SELECT @@session.bulk_insert_buffer_size;
SET @@session.bulk_insert_buffer_size = 1;
SELECT @@session.bulk_insert_buffer_size;
SET @@session.bulk_insert_buffer_size = 4294967295;
SELECT @@session.bulk_insert_buffer_size;
SET @@session.bulk_insert_buffer_size = 429496;
SELECT @@session.bulk_insert_buffer_size;
--echo '#------------------FN_DYNVARS_007_05-----------------------#'
###################################################################
# Change the value of bulk_insert_buffer_size to an invalid value #
###################################################################
SET @@global.bulk_insert_buffer_size = 42949672950;
SELECT @@global.bulk_insert_buffer_size;
SET @@global.bulk_insert_buffer_size = -1024;
SELECT @@global.bulk_insert_buffer_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.bulk_insert_buffer_size = test;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.bulk_insert_buffer_size = ON;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.bulk_insert_buffer_size = 429496.10;
SET @@session.bulk_insert_buffer_size = 42949672950;
SELECT @@session.bulk_insert_buffer_size;
SET @@session.bulk_insert_buffer_size = -2;
SELECT @@session.bulk_insert_buffer_size;
echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.bulk_insert_buffer_size = test;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.bulk_insert_buffer_size = 429496.10;
--echo '#------------------FN_DYNVARS_007_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.bulk_insert_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='bulk_insert_buffer_size';
--echo '#------------------FN_DYNVARS_007_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.bulk_insert_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='bulk_insert_buffer_size';
--echo '#------------------FN_DYNVARS_007_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.bulk_insert_buffer_size = TRUE;
SELECT @@global.bulk_insert_buffer_size;
SET @@global.bulk_insert_buffer_size = FALSE;
SELECT @@global.bulk_insert_buffer_size;
SET @@session.bulk_insert_buffer_size = TRUE;
SELECT @@session.bulk_insert_buffer_size;
SET @@session.bulk_insert_buffer_size = FALSE;
SELECT @@session.bulk_insert_buffer_size;
--echo '#---------------------FN_DYNVARS_007_09----------------------#'
##############################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points #
# to same session variable #
##############################################################################
SET @@bulk_insert_buffer_size = 100;
SELECT @@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size;
SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
--echo '#---------------------FN_DYNVARS_007_10----------------------#'
###############################################################################
# Check if bulk_insert_buffer_size can be accessed with and without @@ sign #
###############################################################################
SET bulk_insert_buffer_size = 1;
SELECT @@bulk_insert_buffer_size;
--Error ER_PARSE_ERROR
SET local.bulk_insert_buffer_size = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.bulk_insert_buffer_size;
--Error ER_PARSE_ERROR
SET session.bulk_insert_buffer_size = 1;
--Error ER_UNKNOWN_TABLE
SELECT session.bulk_insert_buffer_size;
--Error ER_BAD_FIELD_ERROR
SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
####################################
# Restore initial value #
####################################
SET @@global.bulk_insert_buffer_size = @start_global_value;
SELECT @@global.bulk_insert_buffer_size;
SET @@session.bulk_insert_buffer_size = @start_session_value;
SELECT @@session.bulk_insert_buffer_size;
####################################################
# END OF bulk_insert_buffer_size TESTS #
####################################################

View file

@ -0,0 +1,81 @@
#
# This auxiliary script is used by character set test cases.
#
--Error 0,ER_UNKNOWN_CHARACTER_SET
eval SET $charset_variable = big5;
eval SELECT $charset_variable;
eval SET $charset_variable = dec8;
eval SELECT $charset_variable;
eval SET $charset_variable = cp850;
eval SELECT $charset_variable;
eval SET $charset_variable = hp8;
eval SELECT $charset_variable;
eval SET $charset_variable = koi8r;
eval SELECT $charset_variable;
eval SET $charset_variable = latin1;
eval SELECT $charset_variable;
eval SET $charset_variable = latin2;
eval SELECT $charset_variable;
eval SET $charset_variable = swe7;
eval SELECT $charset_variable;
eval SET $charset_variable = ascii;
eval SELECT $charset_variable;
eval SET $charset_variable = ujis;
eval SELECT $charset_variable;
eval SET $charset_variable = sjis;
eval SELECT $charset_variable;
eval SET $charset_variable = hebrew;
eval SELECT $charset_variable;
eval SET $charset_variable = tis620;
eval SELECT $charset_variable;
eval SET $charset_variable = euckr;
eval SELECT $charset_variable;
eval SET $charset_variable = koi8u;
eval SELECT $charset_variable;
eval SET $charset_variable = gb2312;
eval SELECT $charset_variable;
eval SET $charset_variable = greek;
eval SELECT $charset_variable;
eval SET $charset_variable = cp1250;
eval SELECT $charset_variable;
eval SET $charset_variable = gbk;
eval SELECT $charset_variable;
eval SET $charset_variable = latin5;
eval SELECT $charset_variable;
eval SET $charset_variable = armscii8;
eval SELECT $charset_variable;
eval SET $charset_variable = utf8;
eval SELECT $charset_variable;
# Error with Linux
--error 0,ER_WRONG_VALUE_FOR_VAR
eval SET $charset_variable = ucs2;
eval SELECT $charset_variable;
eval SET $charset_variable = cp866;
eval SELECT $charset_variable;
eval SET $charset_variable = keybcs2;
eval SELECT $charset_variable;
eval SET $charset_variable = macce;
eval SELECT $charset_variable;
eval SET $charset_variable = macroman;
eval SELECT $charset_variable;
eval SET $charset_variable = cp852;
eval SELECT $charset_variable;
eval SET $charset_variable = latin7;
eval SELECT $charset_variable;
eval SET $charset_variable = cp1251;
eval SELECT $charset_variable;
eval SET $charset_variable = cp1256;
eval SELECT $charset_variable;
eval SET $charset_variable = cp1257;
eval SELECT $charset_variable;
eval SET $charset_variable = binary;
eval SELECT $charset_variable;
eval SET $charset_variable = geostd8;
eval SELECT $charset_variable;
eval SET $charset_variable = cp932;
eval SELECT $charset_variable;
eval SET $charset_variable = eucjpms;
eval SELECT $charset_variable;

View file

@ -0,0 +1,258 @@
#
# This auxiliary file is used by collation variables
#
--Error 0,ER_UNKNOWN_CHARACTER_SET
eval SET $collation_variable = big5_chinese_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = big5_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = dec8_swedish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = dec8_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = cp850_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = cp850_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = hp8_english_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = hp8_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = koi8r_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = koi8r_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = latin1_german1_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = latin1_swedish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = latin1_danish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = latin1_german2_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = latin1_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = latin1_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = latin1_general_cs;
eval SELECT $collation_variable;
eval SET $collation_variable = latin1_spanish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = latin2_czech_cs;
eval SELECT $collation_variable;
eval SET $collation_variable = latin2_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = latin2_hungarian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = latin2_croatian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = latin2_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = swe7_swedish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = swe7_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = ascii_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ascii_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = ujis_japanese_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ujis_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = sjis_japanese_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = sjis_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = hebrew_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = hebrew_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = tis620_thai_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = tis620_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = euckr_korean_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = euckr_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = koi8u_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = koi8u_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = gb2312_chinese_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = gb2312_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = greek_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = greek_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = cp1250_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = cp1250_czech_cs;
eval SELECT $collation_variable;
eval SET $collation_variable = cp1250_croatian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = cp1250_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = cp1250_polish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = gbk_chinese_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = gbk_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = latin5_turkish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = latin5_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = armscii8_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = armscii8_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_unicode_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_icelandic_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_latvian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_romanian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_slovenian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_polish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_estonian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_spanish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_swedish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_turkish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_czech_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_danish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_lithuanian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_slovak_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_spanish2_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_roman_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_persian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_esperanto_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = utf8_hungarian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_unicode_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_icelandic_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_latvian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_romanian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_slovenian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_polish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_estonian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_spanish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_swedish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_turkish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_czech_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_danish_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_lithuanian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_slovak_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_spanish2_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_roman_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_persian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_esperanto_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = ucs2_hungarian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = cp866_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = cp866_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = keybcs2_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = keybcs2_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = macce_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = macce_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = macroman_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = macroman_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = cp852_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = cp852_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = latin7_estonian_cs;
eval SELECT $collation_variable;
eval SET $collation_variable = latin7_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = latin7_general_cs;
eval SELECT $collation_variable;
eval SET $collation_variable = latin7_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = cp1251_bulgarian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = cp1251_ukrainian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = cp1251_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = cp1251_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = cp1251_general_cs;
eval SELECT $collation_variable;
eval SET $collation_variable = cp1256_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = cp1256_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = cp1257_lithuanian_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = cp1257_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = cp1257_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = binary;
eval SELECT $collation_variable;
eval SET $collation_variable = geostd8_general_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = geostd8_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = cp932_japanese_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = cp932_bin;
eval SELECT $collation_variable;
eval SET $collation_variable = eucjpms_japanese_ci;
eval SELECT $collation_variable;
eval SET $collation_variable = eucjpms_bin;
eval SELECT $collation_variable;

View file

@ -0,0 +1,167 @@
############### mysql-test\t\delayed_insert_limit_basic.test ###################
# #
# Variable Name: delayed_insert_limit #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: Numeric #
# Default Value: 100 #
# Range: 1 - 4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman Rawala #
# #
# Description: Test Cases of Dynamic System Variable "delayed_insert_limit" #
# that checks behavior of this variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html#option_mysqld_delayed_insert_limit #
# #
################################################################################
--source include/load_sysvars.inc
#################################################################
# START OF delayed_insert_limit TESTS #
#################################################################
#########################################################################
# Saving initial value of delayed_insert_limit in a temporary variable #
#########################################################################
SET @start_value = @@global.delayed_insert_limit;
SELECT @start_value;
--echo '#--------------------FN_DYNVARS_024_01------------------------#'
#########################################################################
# Display the DEFAULT value of delayed_insert_limit #
#########################################################################
SET @@global.delayed_insert_limit = 100;
SET @@global.delayed_insert_limit = DEFAULT;
SELECT @@global.delayed_insert_limit;
--echo '#---------------------FN_DYNVARS_024_02-------------------------#'
###############################################
# Verify default value of variable #
###############################################
SET @@global.delayed_insert_limit = @start_value;
SELECT @@global.delayed_insert_limit = 100;
--echo '#--------------------FN_DYNVARS_024_03------------------------#'
#########################################################################
# Change the value of delayed_insert_limit to a valid value #
#########################################################################
SET @@global.delayed_insert_limit = 10000;
SELECT @@global.delayed_insert_limit;
SET @@global.delayed_insert_limit = 4294967295;
SELECT @@global.delayed_insert_limit;
SET @@global.delayed_insert_limit = 1;
SELECT @@global.delayed_insert_limit;
--echo '#--------------------FN_DYNVARS_024_04-------------------------#'
############################################################################
# Change the value of delayed_insert_limit to invalid value #
############################################################################
SET @@global.delayed_insert_limit = 0;
SELECT @@global.delayed_insert_limit;
SET @@global.delayed_insert_limit = -1024;
SELECT @@global.delayed_insert_limit;
SET @@global.delayed_insert_limit = 42949672950;
SELECT @@global.delayed_insert_limit;
echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.delayed_insert_limit = 429496729.5;
SELECT @@global.delayed_insert_limit;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.delayed_insert_limit = ON;
SELECT @@global.delayed_insert_limit;
--echo '#-------------------FN_DYNVARS_024_05----------------------------#'
############################################################################
# Test if accessing session delayed_insert_limit gives error #
############################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.delayed_insert_limit = 0;
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@Session.delayed_insert_limit;
--echo '#----------------------FN_DYNVARS_024_06------------------------#'
##############################################################################
# Check if the value in GLOBAL & SESSION Tables matches values in variable #
##############################################################################
SELECT @@global.delayed_insert_limit =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='delayed_insert_limit';
SELECT @@delayed_insert_limit =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='delayed_insert_limit';
--echo '#---------------------FN_DYNVARS_024_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.delayed_insert_limit = TRUE;
SELECT @@global.delayed_insert_limit;
SET @@global.delayed_insert_limit = FALSE;
SELECT @@global.delayed_insert_limit;
--echo '#---------------------FN_DYNVARS_024_08----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@global.delayed_insert_limit = 1;
SELECT @@delayed_insert_limit = @@global.delayed_insert_limit;
--echo '#---------------------FN_DYNVARS_024_09----------------------#'
##############################################################################
# Check if delayed_insert_limit can be accessed with and without @@ sign #
##############################################################################
--Error ER_GLOBAL_VARIABLE
SET delayed_insert_limit = 1;
SELECT @@delayed_insert_limit;
--Error ER_PARSE_ERROR
SET local.delayed_insert_limit = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.delayed_insert_limit;
--Error ER_PARSE_ERROR
SET global.delayed_insert_limit = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.delayed_insert_limit;
--Error ER_BAD_FIELD_ERROR
SELECT delayed_insert_limit = @@session.delayed_insert_limit;
##############################
# Restore initial value #
##############################
SET @@global.delayed_insert_limit = @start_value;
SELECT @@global.delayed_insert_limit;
###########################################################
# END OF delayed_insert_limit TESTS #
###########################################################

View file

@ -0,0 +1,163 @@
################# mysql-test\t\delayed_queue_size_basic.test ###################
# #
# Variable Name: delayed_queue_size #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: Numeric #
# Default Value: 1000 #
# Range: 1 - 4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman Rawala #
# #
# Description: Test Cases of Dynamic System Variable "delayed_queue_size" #
# that checks behavior of this variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity . #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html#option_mysqld_delayed_queue_size #
# #
################################################################################
--source include/load_sysvars.inc
#################################################################
# START OF delayed_queue_size TESTS #
#################################################################
#########################################################################
# Saving initial value of delayed_queue_size in a temporary variable #
#########################################################################
SET @start_value = @@global.delayed_queue_size;
SELECT @start_value;
--echo '#--------------------FN_DYNVARS_026_01------------------------#'
#########################################################################
# Display the DEFAULT value of delayed_queue_size #
#########################################################################
SET @@global.delayed_queue_size = 100;
SET @@global.delayed_queue_size = DEFAULT;
SELECT @@global.delayed_queue_size;
--echo '#---------------------FN_DYNVARS_026_02-------------------------#'
###############################################
# Verify default value of variable #
###############################################
SET @@global.delayed_queue_size = @start_value;
SELECT @@global.delayed_queue_size = 1000;
--echo '#--------------------FN_DYNVARS_026_03------------------------#'
#########################################################################
# Change the value of delayed_queue_size to a valid value #
#########################################################################
SET @@global.delayed_queue_size = 10000;
SELECT @@global.delayed_queue_size;
SET @@global.delayed_queue_size = 4294967295;
SELECT @@global.delayed_queue_size;
SET @@global.delayed_queue_size = 1;
SELECT @@global.delayed_queue_size;
--echo '#--------------------FN_DYNVARS_026_04-------------------------#'
############################################################################
# Change the value of delayed_queue_size to invalid value #
############################################################################
SET @@global.delayed_queue_size = 0;
SELECT @@global.delayed_queue_size;
SET @@global.delayed_queue_size = -1024;
SELECT @@global.delayed_queue_size;
SET @@global.delayed_queue_size = 42949672950;
SELECT @@global.delayed_queue_size;
echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.delayed_queue_size = 429496729.5;
SELECT @@global.delayed_queue_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.delayed_queue_size = ON;
SELECT @@delayed_queue_size;
--echo '#-------------------FN_DYNVARS_026_05----------------------------#'
############################################################################
# Test if accessing session delayed_queue_size gives error #
############################################################################
--Error 1229
SET @@session.delayed_queue_size = 0;
--Error 1238
SELECT @@session.delayed_queue_size;
--echo '#----------------------FN_DYNVARS_026_06------------------------#'
##############################################################################
# Check if the value in GLOBAL & SESSION Tables matches values in variable #
##############################################################################
SELECT @@global.delayed_queue_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='delayed_queue_size';
SELECT @@delayed_queue_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='delayed_queue_size';
--echo '#---------------------FN_DYNVARS_026_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.delayed_queue_size = TRUE;
SELECT @@global.delayed_queue_size;
SET @@global.delayed_queue_size = FALSE;
SELECT @@global.delayed_queue_size;
--echo '#---------------------FN_DYNVARS_026_08----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@global.delayed_queue_size = 1;
SELECT @@delayed_queue_size = @@global.delayed_queue_size;
--echo '#---------------------FN_DYNVARS_026_09----------------------#'
###########################################################################
# Check if delayed_queue_size can be accessed with and without @@ sign #
###########################################################################
--Error 1229
SET delayed_queue_size = 1;
SELECT @@delayed_queue_size;
--Error ER_PARSE_ERROR
SET local.delayed_queue_size = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.delayed_queue_size;
--Error ER_PARSE_ERROR
SET global.delayed_queue_size = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.delayed_queue_size;
--Error ER_BAD_FIELD_ERROR
SELECT delayed_queue_size = @@session.delayed_queue_size;
##############################
# Restore initial value #
##############################
SET @@global.delayed_queue_size = @start_value;
SELECT @@global.delayed_queue_size;
###########################################################
# END OF delayed_queue_size TESTS #
###########################################################

View file

@ -0,0 +1,16 @@
# Created by Horst Hunger 2008-04-15
# see also have_64bit.inc
--disable_query_log
--disable_warnings
let $save = `SELECT @@global.sort_buffer_size`;
SET @@global.sort_buffer_size = 4294967296;
let $mach32 = `SELECT @@global.sort_buffer_size <= 4294967295`;
eval SET @@global.sort_buffer_size = $save;
--enable_warnings
--enable_query_log
if (!$mach32)
{
skip Need a 32 bit machine;
}

View file

@ -0,0 +1,14 @@
# Created by Horst Hunger 2008-04-15
# see also have_32bit.inc
--disable_query_log
let $save = `SELECT @@session.sort_buffer_size`;
SET @@session.sort_buffer_size = 4294967296;
let $mach64 = `SELECT @@session.sort_buffer_size > 4294967295`;
eval SET @@session.sort_buffer_size = $save;
--enable_query_log
if (!$mach64)
{
skip Need a 64 bit machine;
}

View file

@ -0,0 +1,147 @@
################# mysql-test\t\innodb_concurrency_tickets_basic.test ##########
# #
# Variable Name: innodb_concurrency_tickets #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: Numeric #
# Default Value: 500 #
# Range: 1-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Rizwan #
# #
#Description:Test Cases of Dynamic System Variable innodb_concurrency_tickets #
# that checks the behavior of this variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/have_innodb.inc
--source include/load_sysvars.inc
########################################################################
# START OF innodb_concurrency_tickets TESTS #
########################################################################
################################################################################
# Saving initial value of innodb_concurrency_tickets in a temporary variable #
################################################################################
SET @global_start_value = @@global.innodb_concurrency_tickets;
SELECT @global_start_value;
--echo '#--------------------FN_DYNVARS_046_01------------------------#'
########################################################################
# Display the DEFAULT value of innodb_concurrency_tickets #
########################################################################
SET @@global.innodb_concurrency_tickets = 0;
SET @@global.innodb_concurrency_tickets = DEFAULT;
SELECT @@global.innodb_concurrency_tickets;
--echo '#---------------------FN_DYNVARS_046_02-------------------------#'
################################################################################
# Check if innodb_concurrency_tickets can be accessed with and without @@ sign #
################################################################################
--Error ER_GLOBAL_VARIABLE
SET innodb_concurrency_tickets = 1;
SELECT @@innodb_concurrency_tickets;
--Error ER_UNKNOWN_TABLE
SELECT local.innodb_concurrency_tickets;
SET global innodb_concurrency_tickets = 0;
SELECT @@global.innodb_concurrency_tickets;
--echo '#--------------------FN_DYNVARS_046_03------------------------#'
##########################################################################
# change the value of innodb_concurrency_tickets to a valid value #
##########################################################################
SET @@global.innodb_concurrency_tickets = 1;
SELECT @@global.innodb_concurrency_tickets;
SET @@global.innodb_concurrency_tickets = 1000;
SELECT @@global.innodb_concurrency_tickets;
SET @@global.innodb_concurrency_tickets = 4294967295;
SELECT @@global.innodb_concurrency_tickets;
--echo '#--------------------FN_DYNVARS_046_04-------------------------#'
###########################################################################
# Change the value of innodb_concurrency_tickets to invalid value #
###########################################################################
SET @@global.innodb_concurrency_tickets = -1;
SELECT @@global.innodb_concurrency_tickets;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_concurrency_tickets = "T";
SELECT @@global.innodb_concurrency_tickets;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_concurrency_tickets = "Y";
SELECT @@global.innodb_concurrency_tickets;
SET @@global.innodb_concurrency_tickets = 1001;
SELECT @@global.innodb_concurrency_tickets;
--echo '#----------------------FN_DYNVARS_046_05------------------------#'
#########################################################################
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
SELECT @@global.innodb_concurrency_tickets =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_concurrency_tickets';
SELECT @@global.innodb_concurrency_tickets;
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_concurrency_tickets';
--echo '#---------------------FN_DYNVARS_046_06-------------------------#'
###################################################################
# Check if ON and OFF values can be used on variable #
###################################################################
--ERROR ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_concurrency_tickets = OFF;
SELECT @@global.innodb_concurrency_tickets;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_concurrency_tickets = ON;
SELECT @@global.innodb_concurrency_tickets;
--echo '#---------------------FN_DYNVARS_046_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.innodb_concurrency_tickets = TRUE;
SELECT @@global.innodb_concurrency_tickets;
SET @@global.innodb_concurrency_tickets = FALSE;
SELECT @@global.innodb_concurrency_tickets;
##############################
# Restore initial value #
##############################
SET @@global.innodb_concurrency_tickets = @global_start_value;
SELECT @@global.innodb_concurrency_tickets;
###############################################################
# END OF innodb_concurrency_tickets TESTS #
###############################################################

View file

@ -0,0 +1,147 @@
################# mysql-test\t\innodb_max_purge_lag_basic.test ################
# #
# Variable Name: innodb_max_purge_lag #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: Numeric #
# Default Value: 0 #
# Range: 0-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Rizwan #
# #
#Description:Test Cases of Dynamic System Variable innodb_max_purge_lag #
# that checks the behavior of this variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/have_innodb.inc
--source include/load_sysvars.inc
########################################################################
# START OF innodb_max_purge_lag TESTS #
########################################################################
################################################################################
# Saving initial value of innodb_max_purge_lag in a temporary variable #
################################################################################
SET @global_start_value = @@global.innodb_max_purge_lag;
SELECT @global_start_value;
--echo '#--------------------FN_DYNVARS_046_01------------------------#'
########################################################################
# Display the DEFAULT value of innodb_max_purge_lag #
########################################################################
SET @@global.innodb_max_purge_lag = 0;
SET @@global.innodb_max_purge_lag = DEFAULT;
SELECT @@global.innodb_max_purge_lag;
--echo '#---------------------FN_DYNVARS_046_02-------------------------#'
############################################################################
# Check if innodb_max_purge_lag can be accessed with and without @@ sign #
############################################################################
--Error ER_GLOBAL_VARIABLE
SET innodb_max_purge_lag = 1;
SELECT @@innodb_max_purge_lag;
--Error ER_UNKNOWN_TABLE
SELECT local.innodb_max_purge_lag;
SET global innodb_max_purge_lag = 0;
SELECT @@global.innodb_max_purge_lag;
--echo '#--------------------FN_DYNVARS_046_03------------------------#'
##########################################################################
# change the value of innodb_max_purge_lag to a valid value #
##########################################################################
SET @@global.innodb_max_purge_lag = 0;
SELECT @@global.innodb_max_purge_lag;
SET @@global.innodb_max_purge_lag = 1;
SELECT @@global.innodb_max_purge_lag;
SET @@global.innodb_max_purge_lag = 4294967295;
SELECT @@global.innodb_max_purge_lag;
--echo '#--------------------FN_DYNVARS_046_04-------------------------#'
###########################################################################
# Change the value of innodb_max_purge_lag to invalid value #
###########################################################################
SET @@global.innodb_max_purge_lag = -1;
SELECT @@global.innodb_max_purge_lag;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_max_purge_lag = "T";
SELECT @@global.innodb_max_purge_lag;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_max_purge_lag = "Y";
SELECT @@global.innodb_max_purge_lag;
SET @@global.innodb_max_purge_lag = 1001;
SELECT @@global.innodb_max_purge_lag;
--echo '#----------------------FN_DYNVARS_046_05------------------------#'
#########################################################################
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
SELECT @@global.innodb_max_purge_lag =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_max_purge_lag';
SELECT @@global.innodb_max_purge_lag;
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_max_purge_lag';
--echo '#---------------------FN_DYNVARS_046_06-------------------------#'
###################################################################
# Check if ON and OFF values can be used on variable #
###################################################################
--ERROR ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_max_purge_lag = OFF;
SELECT @@global.innodb_max_purge_lag;
--ERROR ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_max_purge_lag = ON;
SELECT @@global.innodb_max_purge_lag;
--echo '#---------------------FN_DYNVARS_046_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.innodb_max_purge_lag = TRUE;
SELECT @@global.innodb_max_purge_lag;
SET @@global.innodb_max_purge_lag = FALSE;
SELECT @@global.innodb_max_purge_lag;
##############################
# Restore initial value #
##############################
SET @@global.innodb_max_purge_lag = @global_start_value;
SELECT @@global.innodb_max_purge_lag;
###############################################################
# END OF innodb_max_purge_lag TESTS #
###############################################################

View file

@ -0,0 +1,142 @@
################# mysql-test\t\innodb_sync_spin_loops_basic.test ##############
# #
# Variable Name: innodb_sync_spin_loops #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: Numeric #
# Default Value: 20 #
# Range: 0-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Rizwan #
# #
#Description:Test Cases of Dynamic System Variable innodb_sync_spin_loops #
# that checks the behavior of this variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/have_innodb.inc
--source include/load_sysvars.inc
########################################################################
# START OF innodb_sync_spin_loops TESTS #
########################################################################
############################################################################
# Saving initial value of innodb_sync_spin_loops in a temporary variable #
############################################################################
SET @global_start_value = @@global.innodb_sync_spin_loops;
SELECT @global_start_value;
--echo '#--------------------FN_DYNVARS_046_01------------------------#'
########################################################################
# Display the DEFAULT value of innodb_sync_spin_loops #
########################################################################
SET @@global.innodb_sync_spin_loops = 0;
SET @@global.innodb_sync_spin_loops = DEFAULT;
SELECT @@global.innodb_sync_spin_loops;
--echo '#---------------------FN_DYNVARS_046_02-------------------------#'
##############################################################################
# Check if innodb_sync_spin_loops can be accessed with and without @@ sign #
##############################################################################
--Error ER_GLOBAL_VARIABLE
SET innodb_sync_spin_loops = 1;
SELECT @@innodb_sync_spin_loops;
--Error ER_UNKNOWN_TABLE
SELECT local.innodb_sync_spin_loops;
SET global innodb_sync_spin_loops = 0;
SELECT @@global.innodb_sync_spin_loops;
--echo '#--------------------FN_DYNVARS_046_03------------------------#'
##########################################################################
# change the value of innodb_sync_spin_loops to a valid value #
##########################################################################
SET @@global.innodb_sync_spin_loops = 0;
SELECT @@global.innodb_sync_spin_loops;
SET @@global.innodb_sync_spin_loops = 1;
SELECT @@global.innodb_sync_spin_loops;
SET @@global.innodb_sync_spin_loops = 1000;
SELECT @@global.innodb_sync_spin_loops;
--echo '#--------------------FN_DYNVARS_046_04-------------------------#'
###########################################################################
# Change the value of innodb_sync_spin_loops to invalid value #
###########################################################################
SET @@global.innodb_sync_spin_loops = -1;
SELECT @@global.innodb_sync_spin_loops;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_sync_spin_loops = "T";
SELECT @@global.innodb_sync_spin_loops;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_sync_spin_loops = "Y";
SELECT @@global.innodb_sync_spin_loops;
SET @@global.innodb_sync_spin_loops = 1001;
SELECT @@global.innodb_sync_spin_loops;
--echo '#----------------------FN_DYNVARS_046_05------------------------#'
#########################################################################
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
SELECT @@global.innodb_sync_spin_loops =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_sync_spin_loops';
SELECT @@global.innodb_sync_spin_loops;
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_sync_spin_loops';
--echo '#---------------------FN_DYNVARS_046_06-------------------------#'
###################################################################
# Check if ON and OFF values can be used on variable #
###################################################################
--ERROR ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_sync_spin_loops = OFF;
SELECT @@global.innodb_sync_spin_loops;
--ERROR ER_WRONG_TYPE_FOR_VAR
SET @@global.innodb_sync_spin_loops = ON;
SELECT @@global.innodb_sync_spin_loops;
--echo '#---------------------FN_DYNVARS_046_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.innodb_sync_spin_loops = TRUE;
SELECT @@global.innodb_sync_spin_loops;
SET @@global.innodb_sync_spin_loops = FALSE;
SELECT @@global.innodb_sync_spin_loops;
##############################
# Restore initial value #
##############################
SET @@global.innodb_sync_spin_loops = @global_start_value;
SELECT @@global.innodb_sync_spin_loops;
###############################################################
# END OF innodb_sync_spin_loops TESTS #
###############################################################

View file

@ -0,0 +1,5 @@
-- require r/is_embedded.require
disable_query_log;
select version() like '%embedded%' as 'have_embedded';
enable_query_log;

View file

@ -0,0 +1,216 @@
############## mysql-test\t\join_buffer_size_basic.test ###############
# #
# Variable Name: join_buffer_size #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 131072 #
# Range: 8200-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable join_buffer_size #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
################################################################
# START OF join_buffer_size TESTS #
################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.join_buffer_size;
SELECT @start_global_value;
SET @start_session_value = @@session.join_buffer_size;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_053_01-------------------------#'
################################################################
# Display the DEFAULT value of join_buffer_size #
################################################################
SET @@global.join_buffer_size = 8200;
SET @@global.join_buffer_size = DEFAULT;
SELECT @@global.join_buffer_size;
SET @@session.join_buffer_size = 8200;
SET @@session.join_buffer_size = DEFAULT;
SELECT @@session.join_buffer_size;
--echo '#--------------------FN_DYNVARS_053_02-------------------------#'
###################################################################
# Check the DEFAULT value of join_buffer_size #
###################################################################
SET @@global.join_buffer_size = DEFAULT;
SELECT @@global.join_buffer_size = 131072;
SET @@session.join_buffer_size = DEFAULT;
SELECT @@session.join_buffer_size = 131072;
--echo '#--------------------FN_DYNVARS_053_03-------------------------#'
##########################################################################
# Change the value of join_buffer_size to a valid value for GLOBAL Scope #
##########################################################################
SET @@global.join_buffer_size = 8200;
SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
SET @@global.join_buffer_size = 65536;
SELECT @@global.join_buffer_size;
SET @@global.join_buffer_size = 4294967295;
SELECT @@global.join_buffer_size;
echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--echo '#--------------------FN_DYNVARS_053_04-------------------------#'
###########################################################################
# Change the value of join_buffer_size to a valid value for SESSION Scope #
###########################################################################
SET @@session.join_buffer_size = 8200;
SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
SET @@session.join_buffer_size = 65536;
SELECT @@session.join_buffer_size;
SET @@session.join_buffer_size = 4294967295;
SELECT @@session.join_buffer_size;
echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--echo '#------------------FN_DYNVARS_053_05-----------------------#'
############################################################
# Change the value of join_buffer_size to an invalid value #
############################################################
SET @@global.join_buffer_size = 0;
SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
SET @@global.join_buffer_size = -1024;
SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
SET @@global.join_buffer_size = 8199;
SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
SET @@global.join_buffer_size = 42949672951;
SELECT @@global.join_buffer_size;
--Error ER_PARSE_ERROR
SET @@global.join_buffer_size = 65530.34.;
SELECT @@global.join_buffer_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.join_buffer_size = test;
SELECT @@global.join_buffer_size;
SET @@session.join_buffer_size = 0;
SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
SET @@session.join_buffer_size = -2;
SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
SET @@session.join_buffer_size = 8199;
SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
SET @@session.join_buffer_size = 42949672951;
SELECT @@session.join_buffer_size;
--Error ER_PARSE_ERROR
SET @@session.join_buffer_size = 65530.34.;
SELECT @@session.join_buffer_size;
echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.join_buffer_size = test;
SELECT @@session.join_buffer_size;
--echo '#------------------FN_DYNVARS_053_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.join_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='join_buffer_size';
--echo '#------------------FN_DYNVARS_053_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.join_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='join_buffer_size';
--echo '#------------------FN_DYNVARS_053_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.join_buffer_size = TRUE;
SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
SET @@global.join_buffer_size = FALSE;
SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
--echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
#################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
#################################################################################
SET @@global.join_buffer_size = 10;
SELECT @@join_buffer_size = @@global.join_buffer_size;
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@join_buffer_size = 100;
SELECT @@join_buffer_size = @@local.join_buffer_size;
SELECT @@local.join_buffer_size = @@session.join_buffer_size;
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
##############################################################################
# Check if join_buffer_size can be accessed with and without @@ sign #
##############################################################################
SET join_buffer_size = 1;
SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228;
--Error ER_UNKNOWN_TABLE
SELECT local.join_buffer_size;
--Error ER_UNKNOWN_TABLE
SELECT session.join_buffer_size;
--Error ER_BAD_FIELD_ERROR
SELECT join_buffer_size = @@session.join_buffer_size;
####################################
# Restore initial value #
####################################
SET @@global.join_buffer_size = @start_global_value;
SELECT @@global.join_buffer_size;
SET @@session.join_buffer_size = @start_session_value;
SELECT @@session.join_buffer_size;
########################################################
# END OF join_buffer_size TESTS #
########################################################

View file

@ -0,0 +1,187 @@
############## mysql-test\t\key_buffer_size_basic.test ########################
# #
# Variable Name: key_buffer_size #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 131072 #
# Range:8-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable key_buffer_size #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
# Changes: #
# 2008-03-06 hhunger Got "lost connections with 5.1.24 #
########################################################################
--source include/load_sysvars.inc
########################################################################
# START OF key_buffer_size TESTS #
########################################################################
--disable_warnings
########################################################################
# Saving initial value of key_buffer_size in a temporary variable #
########################################################################
SET @start_value = @@global.key_buffer_size;
SELECT @start_value;
--echo '#--------------------FN_DYNVARS_055_01------------------------#'
########################################################################
# Display the DEFAULT value of key_buffer_size #
########################################################################
SET @@global.key_buffer_size = 99;
--Error ER_NO_DEFAULT
SET @@global.key_buffer_size = DEFAULT;
--echo 'Bug# 34878: This variable has default value according to documentation';
SELECT @@global.key_buffer_size = @min_key_buffer_size;
--echo '#---------------------FN_DYNVARS_055_02-------------------------#'
###############################################
# Verify default value of variable #
###############################################
SET @@global.key_buffer_size = @start_value;
SELECT @@global.key_buffer_size = @start_value;
--echo '#--------------------FN_DYNVARS_055_03------------------------#'
########################################################################
# Change the value of key_buffer_size to a valid value #
########################################################################
SET @@global.key_buffer_size = @min_key_buffer_size;
SELECT @@global.key_buffer_size= @min_key_buffer_size;
--disable_warnings
#Due to "lost connection"
#SET @@global.key_buffer_size = 4294967295;
--enable_warnings
#SELECT @@global.key_buffer_size;
SET @@global.key_buffer_size = 1800;
SELECT @@global.key_buffer_size = @min_key_buffer_size;
SET @@global.key_buffer_size = 65535;
SELECT @@global.key_buffer_size;
echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--echo '#--------------------FN_DYNVARS_055_04-------------------------#'
###########################################################################
# Change the value of key_buffer_size to invalid value #
###########################################################################
# Due to "lost connection"
#SET @@global.key_buffer_size = -1;
#SELECT @@global.key_buffer_size;
#SET @@global.key_buffer_size = 100000000000;
#SELECT @@global.key_buffer_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_buffer_size = 10000.01;
SELECT @@global.key_buffer_size;
#SET @@global.key_buffer_size = -1024;
#SELECT @@global.key_buffer_size;
SET @@global.key_buffer_size = 4;
SELECT @@global.key_buffer_size = @min_key_buffer_size;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_buffer_size = ON;
SELECT @@global.key_buffer_size = @min_key_buffer_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_buffer_size = 'test';
SELECT @@global.key_buffer_size = @min_key_buffer_size;
--echo '#-------------------FN_DYNVARS_055_05----------------------------#'
###########################################################################
# Test if accessing session key_buffer_size gives error #
###########################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.key_buffer_size = 0;
SELECT @@key_buffer_size = @min_key_buffer_size;
--echo '#----------------------FN_DYNVARS_055_06------------------------#'
##############################################################################
# Check if the value in GLOBAL & SESSION Tables matches values in variable #
##############################################################################
SELECT @@global.key_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='key_buffer_size';
SELECT @@key_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='key_buffer_size';
--echo '#---------------------FN_DYNVARS_055_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.key_buffer_size = TRUE;
SELECT @@global.key_buffer_size = @min_key_buffer_size;
SET @@global.key_buffer_size = FALSE;
SELECT @@global.key_buffer_size = @min_key_buffer_size;
--echo '#---------------------FN_DYNVARS_055_08----------------------#'
#####################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE #
# points to same session variable #
#####################################################################
# due to differences in contents of the warnings
--disable_warnings
SET @@global.key_buffer_size = @min_key_buffer_size;
SELECT @@key_buffer_size = @@global.key_buffer_size;
--enable_warnings
--echo '#---------------------FN_DYNVARS_055_09----------------------#'
##########################################################################
# Check if key_buffer_size can be accessed with and without @@ sign #
##########################################################################
--Error ER_GLOBAL_VARIABLE
SET key_buffer_size = @min_key_buffer_size;
SELECT @@key_buffer_size = @min_key_buffer_size;
--Error ER_PARSE_ERROR
SET local.key_buffer_size = 10;
--Error ER_UNKNOWN_TABLE
SELECT local.key_buffer_size;
--Error ER_PARSE_ERROR
SET global.key_buffer_size = 10;
--Error ER_UNKNOWN_TABLE
SELECT global.key_buffer_size;
--Error ER_BAD_FIELD_ERROR
SELECT key_buffer_size = @@session.key_buffer_size;
##############################
# Restore initial value #
##############################
SET @@global.key_buffer_size = @start_value;
SELECT @@global.key_buffer_size;
--enable_warnings
#######################################################################
# END OF key_buffer_size TESTS #
#######################################################################

View file

@ -0,0 +1,180 @@
############## mysql-test\t\key_cache_age_threshold_basic.test ###############
# #
# Variable Name: key_cache_age_threshold #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 300 #
# Range: 100-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable key_cache_age_threshold #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
########################################################################
# START OF key_cache_age_threshold TESTS #
########################################################################
#############################################################################
# Saving initial value of key_cache_age_threshold in a temporary variable #
#############################################################################
SET @start_value = @@global.key_cache_age_threshold;
SELECT @start_value;
--echo '#--------------------FN_DYNVARS_056_01------------------------#'
################################################################################
# Display the DEFAULT value of key_cache_age_threshold #
################################################################################
SET @@global.key_cache_age_threshold = 99;
--Error ER_NO_DEFAULT
SET @@global.key_cache_age_threshold = DEFAULT;
--echo 'Bug# 34878: This variable has default value according to documentation';
SELECT @@global.key_cache_age_threshold;
--echo '#---------------------FN_DYNVARS_056_02-------------------------#'
###############################################
# Verify default value of variable #
###############################################
SET @@global.key_cache_age_threshold = @start_value;
SELECT @@global.key_cache_age_threshold = 300;
--echo '#--------------------FN_DYNVARS_056_03------------------------#'
###############################################################################
# Change the value of key_cache_age_threshold to a valid value #
###############################################################################
SET @@global.key_cache_age_threshold = 100;
SELECT @@global.key_cache_age_threshold;
SET @@global.key_cache_age_threshold = 4294967295;
SELECT @@global.key_cache_age_threshold;
SET @@global.key_cache_age_threshold = 1800;
SELECT @@global.key_cache_age_threshold;
SET @@global.key_cache_age_threshold = 65535;
SELECT @@global.key_cache_age_threshold;
--echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
--echo '#--------------------FN_DYNVARS_056_04-------------------------#'
###########################################################################
# Change the value of key_cache_age_threshold to invalid value #
###########################################################################
SET @@global.key_cache_age_threshold = -1;
SELECT @@global.key_cache_age_threshold;
SET @@global.key_cache_age_threshold = 42949672951;
SELECT @@global.key_cache_age_threshold;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_cache_age_threshold = 10000.01;
SELECT @@global.key_cache_age_threshold;
SET @@global.key_cache_age_threshold = -1024;
SELECT @@global.key_cache_age_threshold;
SET @@global.key_cache_age_threshold = 99;
SELECT @@global.key_cache_age_threshold;
echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_cache_age_threshold = ON;
SELECT @@global.key_cache_age_threshold;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_cache_age_threshold = 'test';
SELECT @@global.key_cache_age_threshold;
--echo '#-------------------FN_DYNVARS_056_05----------------------------#'
###########################################################################
# Test if accessing session key_cache_age_threshold gives error #
###########################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.key_cache_age_threshold = 0;
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.key_cache_age_threshold;
--echo '#----------------------FN_DYNVARS_056_06------------------------#'
##############################################################################
# Check if the value in GLOBAL & SESSION Tables matches values in variable #
##############################################################################
SELECT @@global.key_cache_age_threshold = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='key_cache_age_threshold';
SELECT @@key_cache_age_threshold = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='key_cache_age_threshold';
--echo '#---------------------FN_DYNVARS_056_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.key_cache_age_threshold = TRUE;
SELECT @@global.key_cache_age_threshold;
SET @@global.key_cache_age_threshold = FALSE;
SELECT @@global.key_cache_age_threshold;
--echo '#---------------------FN_DYNVARS_056_08----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@global.key_cache_age_threshold = 101;
SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold;
--echo '#---------------------FN_DYNVARS_056_09----------------------#'
########################################################################## #######
# Check if key_cache_age_threshold can be accessed with and without @@ sign #
##################################################################################
--Error ER_GLOBAL_VARIABLE
SET key_cache_age_threshold = 8000;
SELECT @@key_cache_age_threshold;
--Error ER_PARSE_ERROR
SET local.key_cache_age_threshold = 10;
--Error ER_UNKNOWN_TABLE
SELECT local.key_cache_age_threshold;
--Error ER_PARSE_ERROR
SET global.key_cache_age_threshold = 10;
--Error ER_UNKNOWN_TABLE
SELECT global.key_cache_age_threshold;
--Error ER_BAD_FIELD_ERROR
SELECT key_cache_age_threshold = @@session.key_cache_age_threshold;
##############################
# Restore initial value #
##############################
SET @@global.key_cache_age_threshold = @start_value;
SELECT @@global.key_cache_age_threshold;
########################################################################
# END OF key_cache_age_threshold TESTS #
########################################################################

View file

@ -0,0 +1,185 @@
############## mysql-test\t\key_cache_block_size_basic.test ###############
# #
# Variable Name: key_cache_block_size #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: numeric 1024 #
# Default Value: #
# Range: 512-16384 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable key_cache_block_size #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
#####################################################################
# START OF key_cache_block_size TESTS #
#####################################################################
##########################################################################
# Saving initial value of key_cache_block_size in a temporary variable #
##########################################################################
SET @start_value = @@global.key_cache_block_size;
SELECT @start_value;
--echo '#--------------------FN_DYNVARS_057_01------------------------#'
################################################################################
# Display the DEFAULT value of key_cache_block_size #
################################################################################
SET @@global.key_cache_block_size = 600;
--Error ER_NO_DEFAULT
SET @@global.key_cache_block_size = DEFAULT;
--echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
SELECT @@global.key_cache_block_size;
--echo '#---------------------FN_DYNVARS_057_02-------------------------#'
###############################################
# Verify default value of variable #
###############################################
SET @@global.key_cache_block_size = @start_value;
SELECT @@global.key_cache_block_size = 1024;
--echo '#--------------------FN_DYNVARS_057_03------------------------#'
###############################################################################
# Change the value of key_cache_block_size to a valid value #
###############################################################################
SET @@global.key_cache_block_size = 1024;
SELECT @@global.key_cache_block_size;
SET @@global.key_cache_block_size = 16384;
SELECT @@global.key_cache_block_size;
SET @@global.key_cache_block_size = 1800;
SELECT @@global.key_cache_block_size;
SET @@global.key_cache_block_size = 16383;
SELECT @@global.key_cache_block_size;
--echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
--echo '#--------------------FN_DYNVARS_057_04-------------------------#'
###########################################################################
# Change the value of key_cache_block_size to invalid value #
###########################################################################
SET @@global.key_cache_block_size = -1;
SELECT @@global.key_cache_block_size;
SET @@global.key_cache_block_size = 42949672951;
SELECT @@global.key_cache_block_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_cache_block_size = 10000.01;
SELECT @@global.key_cache_block_size;
SET @@global.key_cache_block_size = -1024;
SELECT @@global.key_cache_block_size;
SET @@global.key_cache_block_size = 256;
SELECT @@global.key_cache_block_size;
SET @@global.key_cache_block_size = 511;
SELECT @@global.key_cache_block_size;
SET @@global.key_cache_block_size = 16385;
SELECT @@global.key_cache_block_size;
echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_cache_block_size = ON;
SELECT @@global.key_cache_block_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_cache_block_size = 'test';
SELECT @@global.key_cache_block_size;
--echo '#-------------------FN_DYNVARS_057_05----------------------------#'
###########################################################################
# Test if accessing session key_cache_block_size gives error #
###########################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.key_cache_block_size = 0;
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.key_cache_block_size;
--echo '#----------------------FN_DYNVARS_057_06------------------------#'
##############################################################################
# Check if the value in GLOBAL & SESSION Tables matches values in variable #
##############################################################################
SELECT @@global.key_cache_block_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='key_cache_block_size';
SELECT @@key_cache_block_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='key_cache_block_size';
--echo '#---------------------FN_DYNVARS_057_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.key_cache_block_size = TRUE;
SELECT @@global.key_cache_block_size;
SET @@global.key_cache_block_size = FALSE;
SELECT @@global.key_cache_block_size;
--echo '#---------------------FN_DYNVARS_057_08----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@global.key_cache_block_size = 1024;
SELECT @@key_cache_block_size = @@global.key_cache_block_size;
--echo '#---------------------FN_DYNVARS_057_09----------------------#'
###############################################################################
# Check if key_cache_block_size can be accessed with and without @@ sign #
###############################################################################;
--Error ER_GLOBAL_VARIABLE
SET key_cache_block_size = 8000;
SELECT @@key_cache_block_size;
--Error ER_PARSE_ERROR
SET local.key_cache_block_size = 10;
--Error ER_UNKNOWN_TABLE
SELECT local.key_cache_block_size;
--Error ER_PARSE_ERROR
SET global.key_cache_block_size = 10;
--Error ER_UNKNOWN_TABLE
SELECT global.key_cache_block_size;
--Error ER_BAD_FIELD_ERROR
SELECT key_cache_block_size = @@session.key_cache_block_size;
##############################
# Restore initial value #
##############################
SET @@global.key_cache_block_size = @start_value;
SELECT @@global.key_cache_block_size;
#####################################################################
# END OF key_cache_block_size TESTS #
#####################################################################

View file

@ -0,0 +1,184 @@
############## mysql-test\t\key_cache_division_limit_basic.test ###############
# #
# Variable Name: key_cache_division_limit #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 100 #
# Range: 1-100 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable key_cache_division_limit #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
#####################################################################
# START OF key_cache_division_limit TESTS #
#####################################################################
##############################################################################
# Saving initial value of key_cache_division_limit in a temporary variable #
##############################################################################
SET @start_value = @@global.key_cache_division_limit;
SELECT @start_value;
--echo '#--------------------FN_DYNVARS_058_01------------------------#'
################################################################################
# Display the DEFAULT value of key_cache_division_limit #
################################################################################
SET @@global.key_cache_division_limit = 50;
--Error ER_NO_DEFAULT
SET @@global.key_cache_division_limit = DEFAULT;
--echo 'Bug# 34878: This variable has default value according to documentation';
SELECT @@global.key_cache_division_limit;
--echo '#---------------------FN_DYNVARS_058_02-------------------------#'
###############################################
# Verify default value of variable #
###############################################
SET @@global.key_cache_division_limit = @start_value;
SELECT @@global.key_cache_division_limit = 100;
--echo '#--------------------FN_DYNVARS_058_03------------------------#'
###############################################################################
# Change the value of key_cache_division_limit to a valid value #
###############################################################################
SET @@global.key_cache_division_limit = 1;
SELECT @@global.key_cache_division_limit;
SET @@global.key_cache_division_limit = 50;
SELECT @@global.key_cache_division_limit;
SET @@global.key_cache_division_limit = 99;
SELECT @@global.key_cache_division_limit;
SET @@global.key_cache_division_limit = 2;
SELECT @@global.key_cache_division_limit;
--echo '#--------------------FN_DYNVARS_058_04-------------------------#'
###########################################################################
# Change the value of key_cache_division_limit to invalid value #
###########################################################################
SET @@global.key_cache_division_limit = -1;
SELECT @@global.key_cache_division_limit;
SET @@global.key_cache_division_limit = 101;
SELECT @@global.key_cache_division_limit;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_cache_division_limit = 10000.01;
SELECT @@global.key_cache_division_limit;
SET @@global.key_cache_division_limit = -1024;
SELECT @@global.key_cache_division_limit;
SET @@global.key_cache_division_limit = 0;
SELECT @@global.key_cache_division_limit;
SET @@global.key_cache_division_limit = 200;
SELECT @@global.key_cache_division_limit;
SET @@global.key_cache_division_limit = 65535;
SELECT @@global.key_cache_division_limit;
echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_cache_division_limit = ON;
SELECT @@global.key_cache_division_limit;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.key_cache_division_limit = 'test';
SELECT @@global.key_cache_division_limit;
--echo '#-------------------FN_DYNVARS_058_05----------------------------#'
###########################################################################
# Test if accessing session key_cache_division_limit gives error #
###########################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.key_cache_division_limit = 0;
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.key_cache_division_limit;
--echo '#----------------------FN_DYNVARS_058_06------------------------#'
##############################################################################
# Check if the value in GLOBAL & SESSION Tables matches values in variable #
##############################################################################
SELECT @@global.key_cache_division_limit = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='key_cache_division_limit';
SELECT @@key_cache_division_limit = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='key_cache_division_limit';
--echo '#---------------------FN_DYNVARS_058_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.key_cache_division_limit = TRUE;
SELECT @@global.key_cache_division_limit;
SET @@global.key_cache_division_limit = FALSE;
SELECT @@global.key_cache_division_limit;
--echo '#---------------------FN_DYNVARS_058_08----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@global.key_cache_division_limit = 90;
SELECT @@key_cache_division_limit = @@global.key_cache_division_limit;
--echo '#---------------------FN_DYNVARS_058_09----------------------#'
###############################################################################
# Check if key_cache_division_limit can be accessed with and without @@ sign #
###############################################################################;
--Error ER_GLOBAL_VARIABLE
SET key_cache_division_limit = 80;
SELECT @@key_cache_division_limit;
--Error ER_PARSE_ERROR
SET local.key_cache_division_limit = 10;
--Error ER_UNKNOWN_TABLE
SELECT local.key_cache_division_limit;
--Error ER_PARSE_ERROR
SET global.key_cache_division_limit = 10;
--Error ER_UNKNOWN_TABLE
SELECT global.key_cache_division_limit;
--Error ER_BAD_FIELD_ERROR
SELECT key_cache_division_limit = @@session.key_cache_division_limit;
##############################
# Restore initial value #
##############################
SET @@global.key_cache_division_limit = @start_value;
SELECT @@global.key_cache_division_limit;
#####################################################################
# END OF key_cache_division_limit TESTS #
#####################################################################

View file

@ -0,0 +1,34 @@
#
# This file contains default,min and max values for sys variables for redhat linux
#
--disable_query_log
SET @default_flush_time = 0;
SET @min_flush_time = 0;
#SET @max_flush_time = 0;
SET @default_key_buffer_size = 131072;
SET @min_key_buffer_size = 36;
#SET @default_join_buffer_size = 131072;
#SET @min_join_buffer_size = 8200;
#SET @max_join_buffer_size = 4294967295;
SET @default_max_join_size = 4294967295;
SET @min_max_join_size = 1;
SET @max_max_join_size = 4294967295;
SET @default_sql_max_join_size = 4294967295;
SET @min_sql_max_join_size = 1;
SET @max_sql_max_join_size = 4294967295;
SET @default_sql_select_limit = 4294967295;
SET @min_sql_select_limit = 0;
SET @max_sql_select_limit = 4294967295;
SET @default_wait_timeout= 28800;
SET @min_wait_timeout= 1;
SET @max_wait_timeout= 31536000;
--enable_query_log

View file

@ -0,0 +1,15 @@
#
# This script is included by tests of system variables to include system
# dependant values for the variables: default, minimum and maximum values
#
if (`SELECT convert(@@version_compile_os using latin1)
IN ('Win32','Win64','Windows')`)
{
--source include/windows_sys_vars.inc
}
if (!`SELECT convert(@@version_compile_os using latin1)
IN ('Win32','Win64','Windows')`)
{
--source include/linux_sys_vars.inc
}

View file

@ -0,0 +1,210 @@
############## mysql-test\t\log_warnings_basic.test ###############
# #
# Variable Name: log_warnings #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 1 #
# Range: - #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable log_warnings #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
############################################################
# START OF log_warnings TESTS #
############################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.log_warnings;
SELECT @start_global_value;
SET @start_session_value = @@session.log_warnings;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_067_01-------------------------#'
########################################################################
# Display the DEFAULT value of log_warnings #
########################################################################
SET @@global.log_warnings = 100;
SET @@global.log_warnings = DEFAULT;
SELECT @@global.log_warnings;
SET @@session.log_warnings = 200;
SET @@session.log_warnings = DEFAULT;
SELECT @@session.log_warnings;
--echo '#--------------------FN_DYNVARS_067_02-------------------------#'
########################################################################
# Check the DEFAULT value of log_warnings #
########################################################################
SET @@global.log_warnings = DEFAULT;
SELECT @@global.log_warnings = 1;
SET @@session.log_warnings = DEFAULT;
SELECT @@session.log_warnings = 1;
--echo '#--------------------FN_DYNVARS_067_03-------------------------#'
######################################################################
# Change the value of log_warnings to a valid value for GLOBAL Scope #
######################################################################
SET @@global.log_warnings = 0;
SELECT @@global.log_warnings;
SET @@global.log_warnings = 1;
SELECT @@global.log_warnings;
SET @@global.log_warnings = 60020;
SELECT @@global.log_warnings;
SET @@global.log_warnings = 65535;
SELECT @@global.log_warnings;
SET @@global.log_warnings = 65536;
SELECT @@global.log_warnings;
--echo '#--------------------FN_DYNVARS_067_04-------------------------#'
#######################################################################
# Change the value of log_warnings to a valid value for SESSION Scope #
#######################################################################
SET @@session.log_warnings = 0;
SELECT @@session.log_warnings;
SET @@session.log_warnings = 1;
SELECT @@session.log_warnings;
SET @@session.log_warnings = 50050;
SELECT @@session.log_warnings;
SET @@session.log_warnings = 65535;
SELECT @@session.log_warnings;
SET @@session.log_warnings = 65550;
SELECT @@session.log_warnings;
--echo '#------------------FN_DYNVARS_067_05-----------------------#'
########################################################
# Change the value of log_warnings to an invalid value #
########################################################
SET @@global.log_warnings = 100000000000;
SELECT @@global.log_warnings;
SET @@global.log_warnings = -1024;
SELECT @@global.log_warnings;
--Error ER_PARSE_ERROR
SET @@global.log_warnings = 65530.34.;
SELECT @@global.log_warnings;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.log_warnings = test;
SELECT @@global.log_warnings;
SET @@session.log_warnings = 100000000000;
SELECT @@session.log_warnings;
SET @@session.log_warnings = -2;
SELECT @@session.log_warnings;
--Error ER_PARSE_ERROR
SET @@session.log_warnings = 65530.34.;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.log_warnings = test;
SELECT @@session.log_warnings;
--echo '#------------------FN_DYNVARS_067_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.log_warnings = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='log_warnings';
--echo '#------------------FN_DYNVARS_067_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.log_warnings = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='log_warnings';
--echo '#------------------FN_DYNVARS_067_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.log_warnings = TRUE;
SELECT @@global.log_warnings;
SET @@global.log_warnings = FALSE;
SELECT @@global.log_warnings;
--echo '#---------------------FN_DYNVARS_067_09----------------------#'
#################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
#################################################################################
SET @@global.log_warnings = 10;
SELECT @@log_warnings = @@global.log_warnings;
--echo '#---------------------FN_DYNVARS_067_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@log_warnings = 100;
SELECT @@log_warnings = @@local.log_warnings;
SELECT @@local.log_warnings = @@session.log_warnings;
--echo '#---------------------FN_DYNVARS_067_11----------------------#'
#######################################################################
# Check if log_warnings can be accessed with and without @@ sign #
#######################################################################
SET log_warnings = 1;
SELECT @@log_warnings;
--Error ER_UNKNOWN_TABLE
SELECT local.log_warnings;
--Error ER_UNKNOWN_TABLE
SELECT session.log_warnings;
--Error ER_BAD_FIELD_ERROR
SELECT log_warnings = @@session.log_warnings;
####################################
# Restore initial value #
####################################
SET @@global.log_warnings = @start_global_value;
SELECT @@global.log_warnings;
SET @@session.log_warnings = @start_session_value;
SELECT @@session.log_warnings;
#############################################################
# END OF log_warnings TESTS #
#############################################################

View file

@ -3,7 +3,7 @@ connection slave;
#(the server was started with skip-slave-start)
--disable_warnings
stop slave;
--wait_for_slave_to_stop
source include/wait_for_slave_to_stop.inc;
--enable_warnings
connection master;
--disable_warnings
@ -20,3 +20,4 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--enable_warnings
start slave;
source include/wait_for_slave_to_start.inc;

View file

@ -0,0 +1,187 @@
############## mysql-test\t\max_binlog_cache_size_basic.test ###############
# #
# Variable Name: max_binlog_cache_size #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value:4294967295 #
# Range: 4096-4294967295 #
# #
# #
# #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable max_binlog_cache_size #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
########################################################################
# START OF max_binlog_cache_size TESTS #
########################################################################
########################################################################
# Saving initial value of max_binlog_cache_size in a temporary variable#
########################################################################
SET @start_value = @@global.max_binlog_cache_size;
SELECT @start_value;
--echo '#--------------------FN_DYNVARS_072_01------------------------#'
########################################################################
# Display the DEFAULT value of max_binlog_cache_size #
########################################################################
SET @@global.max_binlog_cache_size = 5000;
SET @@global.max_binlog_cache_size = DEFAULT;
SELECT @@global.max_binlog_cache_size;
--echo '#---------------------FN_DYNVARS_072_02-------------------------#'
###############################################
# Verify default value of variable #
###############################################
SET @@global.max_binlog_cache_size = @start_value;
SELECT @@global.max_binlog_cache_size = 4294967295;
--echo 'Bug# 34876: Incorrect Default Value is assigned to variable';
--echo '#--------------------FN_DYNVARS_072_03------------------------#'
########################################################################
# Change the value of max_binlog_cache_size to a valid value #
########################################################################
SET @@global.max_binlog_cache_size = 4096;
SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = 4294967295;
SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = 4294967294;
SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = 4097;
SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = 65535;
SELECT @@global.max_binlog_cache_size;
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#--------------------FN_DYNVARS_072_04-------------------------#'
###########################################################################
# Change the value of max_binlog_cache_size to invalid value #
###########################################################################
SET @@global.max_binlog_cache_size = -1;
SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = 100000000000;
SELECT @@global.max_binlog_cache_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_binlog_cache_size = 10000.01;
SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = -1024;
SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = 1024;
SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = 4294967296;
SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = 4095;
SELECT @@global.max_binlog_cache_size;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_binlog_cache_size = ON;
SELECT @@global.max_binlog_cache_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_binlog_cache_size = 'test';
SELECT @@global.max_binlog_cache_size;
--echo '#-------------------FN_DYNVARS_072_05----------------------------#'
###########################################################################
# Test if accessing session max_binlog_cache_size gives error #
###########################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.max_binlog_cache_size = 4096;
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.max_binlog_cache_size;
--echo '#----------------------FN_DYNVARS_072_06------------------------#'
##############################################################################
# Check if the value in GLOBAL & SESSION Tables matches values in variable #
##############################################################################
SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='max_binlog_cache_size';
SELECT @@max_binlog_cache_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='max_binlog_cache_size';
--echo '#---------------------FN_DYNVARS_072_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.max_binlog_cache_size = TRUE;
SELECT @@global.max_binlog_cache_size;
SET @@global.max_binlog_cache_size = FALSE;
SELECT @@global.max_binlog_cache_size;
--echo '#---------------------FN_DYNVARS_072_08----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@global.max_binlog_cache_size = 5000;
SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size;
--echo '#---------------------FN_DYNVARS_072_09----------------------#'
################################################################################
# Check if max_binlog_cache_size can be accessed with and without @@ sign #
################################################################################
--Error ER_GLOBAL_VARIABLE
SET max_binlog_cache_size = 6000;
SELECT @@max_binlog_cache_size;
--Error ER_PARSE_ERROR
SET local.max_binlog_cache_size = 7000;
--Error ER_UNKNOWN_TABLE
SELECT local.max_binlog_cache_size;
--Error ER_PARSE_ERROR
SET global.max_binlog_cache_size = 8000;
--Error ER_UNKNOWN_TABLE
SELECT global.max_binlog_cache_size;
--Error ER_BAD_FIELD_ERROR
SELECT max_binlog_cache_size = @@session.max_binlog_cache_size;
##############################
# Restore initial value #
##############################
SET @@global.max_binlog_cache_size = @start_value;
SELECT @@global.max_binlog_cache_size;
########################################################################
# END OF max_binlog_cache_size TESTS #
########################################################################

View file

@ -0,0 +1,182 @@
############## mysql-test\t\max_connect_errors_basic.test ###############
# #
# Variable Name: max_connect_errors #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 10 #
# Range: 1-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable max_connect_errors #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
##################################################################
# START OF max_connect_errors TESTS #
##################################################################
######################################################################
# Saving initial value of max_connect_errors in a temporary variable #
######################################################################
SET @start_value = @@global.max_connect_errors;
SELECT @start_value;
--echo '#--------------------FN_DYNVARS_073_01------------------------#'
##################################################################
# Display the DEFAULT value of max_connect_errors #
##################################################################
SET @@global.max_connect_errors = 5000;
SET @@global.max_connect_errors = DEFAULT;
SELECT @@global.max_connect_errors;
--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
--echo '#---------------------FN_DYNVARS_073_02-------------------------#'
###############################################
# Verify default value of variable #
###############################################
SET @@global.max_connect_errors = @start_value;
SELECT @@global.max_connect_errors = 10;
--echo '#--------------------FN_DYNVARS_073_03------------------------#'
##################################################################
# Change the value of max_connect_errors to a valid value #
##################################################################
SET @@global.max_connect_errors = 4096;
SELECT @@global.max_connect_errors;
SET @@global.max_connect_errors = 4294967294;
SELECT @@global.max_connect_errors;
SET @@global.max_connect_errors = 4294967295;
SELECT @@global.max_connect_errors;
SET @@global.max_connect_errors = 1;
SELECT @@global.max_connect_errors;
SET @@global.max_connect_errors = 2;
SELECT @@global.max_connect_errors;
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#--------------------FN_DYNVARS_073_04-------------------------#'
#####################################################################
# Change the value of max_connect_errors to invalid value #
#####################################################################
SET @@global.max_connect_errors = -1;
SELECT @@global.max_connect_errors;
SET @@global.max_connect_errors = 100000000000;
SELECT @@global.max_connect_errors;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_connect_errors = 10000.01;
SELECT @@global.max_connect_errors;
SET @@global.max_connect_errors = -1024;
SELECT @@global.max_connect_errors;
SET @@global.max_connect_errors = 0;
SELECT @@global.max_connect_errors;
SET @@global.max_connect_errors = 4294967296;
SELECT @@global.max_connect_errors;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_connect_errors = ON;
SELECT @@global.max_connect_errors;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_connect_errors = 'test';
SELECT @@global.max_connect_errors;
--echo '#-------------------FN_DYNVARS_073_05----------------------------#'
#####################################################################
# Test if accessing session max_connect_errors gives error #
#####################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.max_connect_errors = 4096;
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.max_connect_errors;
--echo '#----------------------FN_DYNVARS_073_06------------------------#'
##############################################################################
# Check if the value in GLOBAL & SESSION Tables matches values in variable #
##############################################################################
SELECT @@global.max_connect_errors = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='max_connect_errors';
SELECT @@max_connect_errors = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='max_connect_errors';
--echo '#---------------------FN_DYNVARS_073_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.max_connect_errors = TRUE;
SELECT @@global.max_connect_errors;
SET @@global.max_connect_errors = FALSE;
SELECT @@global.max_connect_errors;
--echo '#---------------------FN_DYNVARS_073_08----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@global.max_connect_errors = 5000;
SELECT @@max_connect_errors = @@global.max_connect_errors;
--echo '#---------------------FN_DYNVARS_073_09----------------------#'
##########################################################################
# Check if max_connect_errors can be accessed with and without @@ sign #
##########################################################################
--Error ER_GLOBAL_VARIABLE
SET max_connect_errors = 6000;
SELECT @@max_connect_errors;
--Error ER_PARSE_ERROR
SET local.max_connect_errors = 7000;
--Error ER_UNKNOWN_TABLE
SELECT local.max_connect_errors;
--Error ER_PARSE_ERROR
SET global.max_connect_errors = 8000;
--Error ER_UNKNOWN_TABLE
SELECT global.max_connect_errors;
--Error ER_BAD_FIELD_ERROR
SELECT max_connect_errors = @@session.max_connect_errors;
##############################
# Restore initial value #
##############################
SET @@global.max_connect_errors = @start_value;
SELECT @@global.max_connect_errors;
##################################################################
# END OF max_connect_errors TESTS #
##################################################################

View file

@ -0,0 +1,222 @@
############## mysql-test\t\max_heap_table_size_basic.test ###############
# #
# Variable Name: max_heap_table_size #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 16777216 #
# Range: 16384-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable max_heap_table_size #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
###############################################################
# START OF max_heap_table_size TESTS #
###############################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.max_heap_table_size;
SELECT @start_global_value;
SET @start_session_value = @@session.max_heap_table_size;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_077_01-------------------------#'
###############################################################
# Display the DEFAULT value of max_heap_table_size #
###############################################################
SET @@global.max_heap_table_size = 1677721610;
SET @@global.max_heap_table_size = DEFAULT;
SELECT @@global.max_heap_table_size;
SET @@session.max_heap_table_size = 1677721610;
SET @@session.max_heap_table_size = DEFAULT;
SELECT @@session.max_heap_table_size;
--echo '#--------------------FN_DYNVARS_077_02-------------------------#'
##################################################################
# Check the DEFAULT value of max_heap_table_size #
##################################################################
SET @@global.max_heap_table_size = DEFAULT;
SELECT @@global.max_heap_table_size = 16777216;
SET @@session.max_heap_table_size = DEFAULT;
SELECT @@session.max_heap_table_size = 16777216;
--echo '#--------------------FN_DYNVARS_077_03-------------------------#'
############################################################################
# Change the value of max_heap_table_size to a valid value for GLOBAL Scope #
############################################################################
SET @@global.max_heap_table_size = 16384;
SELECT @@global.max_heap_table_size;
SET @@global.max_heap_table_size = 16385;
SELECT @@global.max_heap_table_size;
SET @@global.max_heap_table_size = 65535;
SELECT @@global.max_heap_table_size;
SET @@global.max_heap_table_size = 4294967294;
SELECT @@global.max_heap_table_size;
SET @@global.max_heap_table_size = 4294967295;
SELECT @@global.max_heap_table_size;
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#--------------------FN_DYNVARS_077_04-------------------------#'
#############################################################################
# Change the value of max_heap_table_size to a valid value for SESSION Scope #
#############################################################################
SET @@session.max_heap_table_size = 16384;
SELECT @@session.max_heap_table_size;
SET @@session.max_heap_table_size = 16385;
SELECT @@session.max_heap_table_size;
SET @@session.max_heap_table_size = 65535;
SELECT @@session.max_heap_table_size;
SET @@session.max_heap_table_size = 4294967294;
SELECT @@session.max_heap_table_size;
SET @@session.max_heap_table_size = 4294967295;
SELECT @@session.max_heap_table_size;
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#------------------FN_DYNVARS_077_05-----------------------#'
##############################################################
# Change the value of max_heap_table_size to an invalid value #
##############################################################
SET @@global.max_heap_table_size = -1;
SELECT @@global.max_heap_table_size;
SET @@global.max_heap_table_size = -1024;
SELECT @@global.max_heap_table_size;
SET @@global.max_heap_table_size = 1024;
SELECT @@global.max_heap_table_size;
SET @@global.max_heap_table_size = 16383;
SELECT @@global.max_heap_table_size;
SET @@global.max_heap_table_size = 4294967296;
SELECT @@global.max_heap_table_size;
--Error ER_PARSE_ERROR
SET @@global.max_heap_table_size = 65530.34.;
SELECT @@global.max_heap_table_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_heap_table_size = test;
SELECT @@global.max_heap_table_size;
SET @@session.max_heap_table_size = -1;
SELECT @@session.max_heap_table_size;
SET @@session.max_heap_table_size = 16383;
SELECT @@session.max_heap_table_size;
SET @@session.max_heap_table_size = 4294967296;
SELECT @@session.max_heap_table_size;
--Error ER_PARSE_ERROR
SET @@session.max_heap_table_size = 65530.34.;
SET @@session.max_heap_table_size = 10737418241;
SELECT @@session.max_heap_table_size;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.max_heap_table_size = test;
SELECT @@session.max_heap_table_size;
--echo '#------------------FN_DYNVARS_077_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.max_heap_table_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='max_heap_table_size';
--echo '#------------------FN_DYNVARS_077_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.max_heap_table_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='max_heap_table_size';
--echo '#------------------FN_DYNVARS_077_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.max_heap_table_size = TRUE;
SELECT @@global.max_heap_table_size;
SET @@global.max_heap_table_size = FALSE;
SELECT @@global.max_heap_table_size;
--echo '#---------------------FN_DYNVARS_077_09----------------------#'
#################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
#################################################################################
SET @@global.max_heap_table_size = 163845;
SELECT @@max_heap_table_size = @@global.max_heap_table_size;
--echo '#---------------------FN_DYNVARS_077_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@max_heap_table_size = 16777216;
SELECT @@max_heap_table_size = @@local.max_heap_table_size;
SELECT @@local.max_heap_table_size = @@session.max_heap_table_size;
--echo '#---------------------FN_DYNVARS_077_11----------------------#'
#############################################################################
# Check if max_heap_table_size can be accessed with and without @@ sign #
#############################################################################
SET max_heap_table_size = 316777216;
SELECT @@max_heap_table_size;
--Error ER_UNKNOWN_TABLE
SELECT local.max_heap_table_size;
--Error ER_UNKNOWN_TABLE
SELECT session.max_heap_table_size;
--Error ER_BAD_FIELD_ERROR
SELECT max_heap_table_size = @@session.max_heap_table_size;
####################################
# Restore initial value #
####################################
SET @@global.max_heap_table_size = @start_global_value;
SELECT @@global.max_heap_table_size;
SET @@session.max_heap_table_size = @start_session_value;
SELECT @@session.max_heap_table_size;
#######################################################
# END OF max_heap_table_size TESTS #
#######################################################

View file

@ -0,0 +1,213 @@
############## mysql-test\t\max_seeks_for_key_basic.test ###############
# #
# Variable Name: max_seeks_for_key #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 4294967295 #
# Range: 1-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable max_seeks_for_key #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
#################################################################
# START OF max_seeks_for_key TESTS #
#################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.max_seeks_for_key;
SELECT @start_global_value;
SET @start_session_value = @@session.max_seeks_for_key;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_083_01-------------------------#'
#################################################################
# Display the DEFAULT value of max_seeks_for_key #
#################################################################
SET @@global.max_seeks_for_key = 100;
SET @@global.max_seeks_for_key = DEFAULT;
SELECT @@global.max_seeks_for_key;
SET @@session.max_seeks_for_key = 200;
SET @@session.max_seeks_for_key = DEFAULT;
SELECT @@session.max_seeks_for_key;
--echo '#--------------------FN_DYNVARS_083_02-------------------------#'
#################################################################
# Check the DEFAULT value of max_seeks_for_key #
#################################################################
SET @@global.max_seeks_for_key = DEFAULT;
SELECT @@global.max_seeks_for_key = 4294967295;
SET @@session.max_seeks_for_key = DEFAULT;
SELECT @@session.max_seeks_for_key = 4294967295;
--echo '#--------------------FN_DYNVARS_083_03-------------------------#'
###########################################################################
# Change the value of max_seeks_for_key to a valid value for GLOBAL Scope #
###########################################################################
SET @@global.max_seeks_for_key = 1;
SELECT @@global.max_seeks_for_key;
SET @@global.max_seeks_for_key = 2;
SELECT @@global.max_seeks_for_key;
SET @@global.max_seeks_for_key = 65536;
SELECT @@global.max_seeks_for_key;
SET @@global.max_seeks_for_key = 4294967295;
SELECT @@global.max_seeks_for_key;
SET @@global.max_seeks_for_key = 4294967294;
SELECT @@global.max_seeks_for_key;
--echo '#--------------------FN_DYNVARS_083_04-------------------------#'
############################################################################
# Change the value of max_seeks_for_key to a valid value for SESSION Scope #
############################################################################
SET @@session.max_seeks_for_key = 1;
SELECT @@session.max_seeks_for_key;
SET @@session.max_seeks_for_key = 2;
SELECT @@session.max_seeks_for_key;
SET @@session.max_seeks_for_key = 4294967295;
SELECT @@session.max_seeks_for_key;
SET @@session.max_seeks_for_key = 4294967294;
SELECT @@session.max_seeks_for_key;
SET @@session.max_seeks_for_key = 65535;
SELECT @@session.max_seeks_for_key;
--echo '#------------------FN_DYNVARS_083_05-----------------------#'
#############################################################
# Change the value of max_seeks_for_key to an invalid value #
#############################################################
SET @@global.max_seeks_for_key = 0;
SELECT @@global.max_seeks_for_key;
SET @@global.max_seeks_for_key = -1024;
SELECT @@global.max_seeks_for_key;
SET @@global.max_seeks_for_key = 4294967296;
SELECT @@global.max_seeks_for_key;
--Error ER_PARSE_ERROR
SET @@global.max_seeks_for_key = 65530.34.;
SELECT @@global.max_seeks_for_key;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_seeks_for_key = test;
SELECT @@global.max_seeks_for_key;
SET @@session.max_seeks_for_key = 0;
SELECT @@session.max_seeks_for_key;
SET @@session.max_seeks_for_key = -2;
SELECT @@session.max_seeks_for_key;
--Error ER_PARSE_ERROR
SET @@session.max_seeks_for_key = 65530.34.;
SET @@session.max_seeks_for_key = 4294967296;
SELECT @@session.max_seeks_for_key;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.max_seeks_for_key = test;
SELECT @@session.max_seeks_for_key;
--echo '#------------------FN_DYNVARS_083_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.max_seeks_for_key = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='max_seeks_for_key';
--echo '#------------------FN_DYNVARS_083_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.max_seeks_for_key = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='max_seeks_for_key';
--echo '#------------------FN_DYNVARS_083_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.max_seeks_for_key = TRUE;
SELECT @@global.max_seeks_for_key;
SET @@global.max_seeks_for_key = FALSE;
SELECT @@global.max_seeks_for_key;
--echo '#---------------------FN_DYNVARS_083_09----------------------#'
#################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
#################################################################################
SET @@global.max_seeks_for_key = 10;
SELECT @@max_seeks_for_key = @@global.max_seeks_for_key;
--echo '#---------------------FN_DYNVARS_083_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@max_seeks_for_key = 100;
SELECT @@max_seeks_for_key = @@local.max_seeks_for_key;
SELECT @@local.max_seeks_for_key = @@session.max_seeks_for_key;
--echo '#---------------------FN_DYNVARS_083_11----------------------#'
############################################################################
# Check if max_seeks_for_key can be accessed with and without @@ sign #
############################################################################
SET max_seeks_for_key = 1;
SELECT @@max_seeks_for_key;
--Error ER_UNKNOWN_TABLE
SELECT local.max_seeks_for_key;
--Error ER_UNKNOWN_TABLE
SELECT session.max_seeks_for_key;
--Error ER_BAD_FIELD_ERROR
SELECT max_seeks_for_key = @@session.max_seeks_for_key;
####################################
# Restore initial value #
####################################
SET @@global.max_seeks_for_key = @start_global_value;
SELECT @@global.max_seeks_for_key;
SET @@session.max_seeks_for_key = @start_session_value;
SELECT @@session.max_seeks_for_key;
#############################################################
# END OF max_seeks_for_key TESTS #
#############################################################

View file

@ -0,0 +1,227 @@
############## mysql-test\t\max_tmp_tables_basic.test ###############
# #
# Variable Name: max_tmp_tables #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 32 #
# Range: 1-4294967295 #
# #
# #
# #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable max_tmp_tables #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
####################################
# START OF max_tmp_tables TESTS #
####################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.max_tmp_tables;
SELECT @start_global_value;
SET @start_session_value = @@session.max_tmp_tables;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_086_01-------------------------#'
######################################################
# Display the DEFAULT value of max_tmp_tables #
######################################################
SET @@global.max_tmp_tables = 1000;
SET @@global.max_tmp_tables = DEFAULT;
SELECT @@global.max_tmp_tables;
SET @@session.max_tmp_tables = 1000;
SET @@session.max_tmp_tables = DEFAULT;
SELECT @@session.max_tmp_tables;
--echo '#--------------------FN_DYNVARS_086_02-------------------------#'
######################################################
# Check the DEFAULT value of max_tmp_tables #
######################################################
SET @@global.max_tmp_tables = DEFAULT;
SELECT @@global.max_tmp_tables = 32;
SET @@session.max_tmp_tables = DEFAULT;
SELECT @@session.max_tmp_tables = 32;
--echo '#--------------------FN_DYNVARS_086_03-------------------------#'
########################################################################
# Change the value of max_tmp_tables to a valid value for GLOBAL Scope #
########################################################################
SET @@global.max_tmp_tables = 1;
SELECT @@global.max_tmp_tables;
SET @@global.max_tmp_tables = 2;
SELECT @@global.max_tmp_tables;
SET @@global.max_tmp_tables = 65536;
SELECT @@global.max_tmp_tables;
SET @@global.max_tmp_tables = 4294967295;
SELECT @@global.max_tmp_tables;
SET @@global.max_tmp_tables = 4294967294;
SELECT @@global.max_tmp_tables;
--echo '#--------------------FN_DYNVARS_086_04-------------------------#'
#########################################################################
# Change the value of max_tmp_tables to a valid value for SESSION Scope #
#########################################################################
SET @@session.max_tmp_tables = 1;
SELECT @@session.max_tmp_tables;
SET @@session.max_tmp_tables = 2;
SELECT @@session.max_tmp_tables;
SET @@session.max_tmp_tables = 65536;
SELECT @@session.max_tmp_tables;
SET @@session.max_tmp_tables = 4294967295;
SELECT @@session.max_tmp_tables;
SET @@session.max_tmp_tables = 4294967294;
SELECT @@session.max_tmp_tables;
--echo '#------------------FN_DYNVARS_086_05-----------------------#'
##########################################################
# Change the value of max_tmp_tables to an invalid value #
##########################################################
SET @@global.max_tmp_tables = -1024;
SELECT @@global.max_tmp_tables;
SET @@global.max_tmp_tables = 4294967296;
SELECT @@global.max_tmp_tables;
SET @@global.max_tmp_tables = -1;
SELECT @@global.max_tmp_tables;
SET @@global.max_tmp_tables = 429496729500;
SELECT @@global.max_tmp_tables;
--Error ER_PARSE_ERROR
SET @@global.max_tmp_tables = 65530.34.;
SELECT @@global.max_tmp_tables;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_tmp_tables = test;
SELECT @@global.max_tmp_tables;
SET @@session.max_tmp_tables = 4294967296;
SELECT @@session.max_tmp_tables;
SET @@session.max_tmp_tables = -1;
SELECT @@session.max_tmp_tables;
SET @@session.max_tmp_tables = 429496729500;
SELECT @@session.max_tmp_tables;
SET @@session.max_tmp_tables = -001;
SELECT @@session.max_tmp_tables;
--Error ER_PARSE_ERROR
SET @@session.max_tmp_tables = 65530.34.;
SET @@session.max_tmp_tables = 10737418241;
SELECT @@session.max_tmp_tables;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.max_tmp_tables = test;
SELECT @@session.max_tmp_tables;
--echo '#------------------FN_DYNVARS_086_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.max_tmp_tables = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='max_tmp_tables';
--echo '#------------------FN_DYNVARS_086_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.max_tmp_tables = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='max_tmp_tables';
--echo '#------------------FN_DYNVARS_086_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.max_tmp_tables = TRUE;
SELECT @@global.max_tmp_tables;
SET @@global.max_tmp_tables = FALSE;
SELECT @@global.max_tmp_tables;
--echo '#---------------------FN_DYNVARS_086_09----------------------#'
#################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
#################################################################################
SET @@global.max_tmp_tables = 20;
SELECT @@max_tmp_tables = @@global.max_tmp_tables;
--echo '#---------------------FN_DYNVARS_086_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@max_tmp_tables = 255;
SELECT @@max_tmp_tables = @@local.max_tmp_tables;
SELECT @@local.max_tmp_tables = @@session.max_tmp_tables;
--echo '#---------------------FN_DYNVARS_086_11----------------------#'
#########################################################################
# Check if max_tmp_tables can be accessed with and without @@ sign #
#########################################################################
SET max_tmp_tables = 102;
SELECT @@max_tmp_tables;
--Error ER_UNKNOWN_TABLE
SELECT local.max_tmp_tables;
--Error ER_UNKNOWN_TABLE
SELECT session.max_tmp_tables;
--Error ER_BAD_FIELD_ERROR
SELECT max_tmp_tables = @@session.max_tmp_tables;
####################################
# Restore initial value #
####################################
SET @@global.max_tmp_tables = @start_global_value;
SELECT @@global.max_tmp_tables;
SET @@session.max_tmp_tables = @start_session_value;
SELECT @@session.max_tmp_tables;
###################################################
# END OF max_tmp_tables TESTS #
###################################################

View file

@ -0,0 +1,158 @@
############## mysql-test\t\max_write_lock_count_basic.test ###############
# #
# Variable Name: max_write_lock_count #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 4294967295 #
# Range:1-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable max_write_lock_count #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
##########################################
# START OF max_write_lock_count TESTS #
##########################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.max_write_lock_count;
SELECT @start_global_value;
--echo '#--------------------FN_DYNVARS_088_01-------------------------#'
############################################################
# Display the DEFAULT value of max_write_lock_count #
############################################################
SET @@global.max_write_lock_count = 1000;
SET @@global.max_write_lock_count = DEFAULT;
SELECT @@global.max_write_lock_count;
--echo '#--------------------FN_DYNVARS_088_02-------------------------#'
############################################################
# Check the DEFAULT value of max_write_lock_count #
############################################################
SET @@global.max_write_lock_count = DEFAULT;
SELECT @@global.max_write_lock_count = 4294967295;
--echo '#--------------------FN_DYNVARS_088_03-------------------------#'
##############################################################################
# Change the value of max_write_lock_count to a valid value for GLOBAL Scope #
##############################################################################
SET @@global.max_write_lock_count = 1;
SELECT @@global.max_write_lock_count;
SET @@global.max_write_lock_count = 2;
SELECT @@global.max_write_lock_count;
SET @@global.max_write_lock_count = 65536;
SELECT @@global.max_write_lock_count;
SET @@global.max_write_lock_count = 4294967295;
SELECT @@global.max_write_lock_count;
SET @@global.max_write_lock_count = 4294967294;
SELECT @@global.max_write_lock_count;
--echo '#------------------FN_DYNVARS_088_04-----------------------#'
################################################################
# Change the value of max_write_lock_count to an invalid value #
################################################################
SET @@global.max_write_lock_count = -1024;
SELECT @@global.max_write_lock_count;
SET @@global.max_write_lock_count = 4294967296;
SELECT @@global.max_write_lock_count;
SET @@global.max_write_lock_count = -1;
SELECT @@global.max_write_lock_count;
SET @@global.max_write_lock_count = 429496729500;
SELECT @@global.max_write_lock_count;
--Error ER_PARSE_ERROR
SET @@global.max_write_lock_count = 65530.34.;
SELECT @@global.max_write_lock_count;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_write_lock_count = test;
SELECT @@global.max_write_lock_count;
--echo '#------------------FN_DYNVARS_088_05-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.max_write_lock_count = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='max_write_lock_count';
--echo '#------------------FN_DYNVARS_088_06-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.max_write_lock_count = TRUE;
SELECT @@global.max_write_lock_count;
SET @@global.max_write_lock_count = FALSE;
SELECT @@global.max_write_lock_count;
--echo '#---------------------FN_DYNVARS_088_07----------------------#'
#################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
#################################################################################
SET @@global.max_write_lock_count = 20;
SELECT @@max_write_lock_count = @@global.max_write_lock_count;
--echo '#---------------------FN_DYNVARS_088_08----------------------#'
###############################################################################
# Check if max_write_lock_count can be accessed with and without @@ sign #
###############################################################################
SET @@global.max_write_lock_count = 102;
SELECT @@max_write_lock_count;
--Error ER_UNKNOWN_TABLE
SELECT local.max_write_lock_count;
--Error ER_UNKNOWN_TABLE
SELECT global.max_write_lock_count;
--Error ER_BAD_FIELD_ERROR
SELECT max_write_lock_count = @@global.max_write_lock_count;
####################################
# Restore initial value #
####################################
SET @@global.max_write_lock_count = @start_global_value;
SELECT @@global.max_write_lock_count;
###################################################
# END OF max_write_lock_count TESTS #
###################################################

View file

@ -0,0 +1,219 @@
############## mysql-test\t\min_examined_row_limit_basic.test ###############
# #
# Variable Name: min_examined_row_limit #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 0 #
# Range:0-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable min_examined_row_limit #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
######################################################################
# START OF min_examined_row_limit TESTS #
######################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.min_examined_row_limit;
SELECT @start_global_value;
SET @start_session_value = @@session.min_examined_row_limit;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_089_01-------------------------#'
######################################################################
# Display the DEFAULT value of min_examined_row_limit #
######################################################################
SET @@global.min_examined_row_limit = 100;
SET @@global.min_examined_row_limit = DEFAULT;
SELECT @@global.min_examined_row_limit;
SET @@session.min_examined_row_limit = 200;
SET @@session.min_examined_row_limit = DEFAULT;
SELECT @@session.min_examined_row_limit;
--echo '#--------------------FN_DYNVARS_089_02-------------------------#'
########################################################################
# Check the DEFAULT value of min_examined_row_limit #
########################################################################
SET @@global.min_examined_row_limit = DEFAULT;
SELECT @@global.min_examined_row_limit = 0;
SET @@session.min_examined_row_limit = DEFAULT;
SELECT @@session.min_examined_row_limit = 0;
--echo '#--------------------FN_DYNVARS_089_03-------------------------#'
################################################################################
# Change the value of min_examined_row_limit to a valid value for GLOBAL Scope #
################################################################################
SET @@global.min_examined_row_limit = 0;
SELECT @@global.min_examined_row_limit;
SET @@global.min_examined_row_limit = 1;
SELECT @@global.min_examined_row_limit;
SET @@global.min_examined_row_limit = 60020;
SELECT @@global.min_examined_row_limit;
SET @@global.min_examined_row_limit = 65535;
SELECT @@global.min_examined_row_limit;
SET @@global.min_examined_row_limit = 4294967295;
SELECT @@global.min_examined_row_limit;
SET @@global.min_examined_row_limit = 4294967294;
SELECT @@global.min_examined_row_limit;
--echo '#--------------------FN_DYNVARS_089_04-------------------------#'
###################################################################################
# Change the value of min_examined_row_limit to a valid value for SESSION Scope #
###################################################################################
SET @@session.min_examined_row_limit = 0;
SELECT @@session.min_examined_row_limit;
SET @@session.min_examined_row_limit = 1;
SELECT @@session.min_examined_row_limit;
SET @@session.min_examined_row_limit = 50050;
SELECT @@session.min_examined_row_limit;
SET @@session.min_examined_row_limit = 65535;
SELECT @@session.min_examined_row_limit;
SET @@session.min_examined_row_limit = 4294967295;
SELECT @@session.min_examined_row_limit;
SET @@session.min_examined_row_limit = 4294967294;
SELECT @@session.min_examined_row_limit;
--echo '#------------------FN_DYNVARS_089_05-----------------------#'
####################################################################
# Change the value of min_examined_row_limit to an invalid value #
####################################################################
SET @@global.min_examined_row_limit = 429496726;
SELECT @@global.min_examined_row_limit;
SET @@global.min_examined_row_limit = -1024;
SELECT @@global.min_examined_row_limit;
SET @@global.min_examined_row_limit = 429496729500;
SELECT @@global.min_examined_row_limit;
--Error ER_PARSE_ERROR
SET @@global.min_examined_row_limit = 65530.34.;
SELECT @@global.min_examined_row_limit;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.min_examined_row_limit = test;
SELECT @@global.min_examined_row_limit;
SET @@session.min_examined_row_limit = 4294967296;
SELECT @@session.min_examined_row_limit;
SET @@session.min_examined_row_limit = -1;
SELECT @@session.min_examined_row_limit;
--Error ER_PARSE_ERROR
SET @@session.min_examined_row_limit = 65530.34.;
SET @@session.min_examined_row_limit = 4294967295021;
SELECT @@session.min_examined_row_limit;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.min_examined_row_limit = test;
SELECT @@session.min_examined_row_limit;
--echo '#------------------FN_DYNVARS_089_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.min_examined_row_limit = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='min_examined_row_limit';
--echo '#------------------FN_DYNVARS_089_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.min_examined_row_limit = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='min_examined_row_limit';
--echo '#------------------FN_DYNVARS_089_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.min_examined_row_limit = TRUE;
SELECT @@global.min_examined_row_limit;
SET @@global.min_examined_row_limit = FALSE;
SELECT @@global.min_examined_row_limit;
--echo '#---------------------FN_DYNVARS_089_09----------------------#'
####################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
####################################################################################
SET @@global.min_examined_row_limit = 10;
SELECT @@min_examined_row_limit = @@global.min_examined_row_limit;
--echo '#---------------------FN_DYNVARS_089_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@min_examined_row_limit = 100;
SELECT @@min_examined_row_limit = @@local.min_examined_row_limit;
SELECT @@local.min_examined_row_limit = @@session.min_examined_row_limit;
--echo '#---------------------FN_DYNVARS_089_11----------------------#'
###################################################################################
# Check if min_examined_row_limit can be accessed with and without @@ sign #
###################################################################################
SET min_examined_row_limit = 1;
SELECT @@min_examined_row_limit;
--Error ER_UNKNOWN_TABLE
SELECT local.min_examined_row_limit;
--Error ER_UNKNOWN_TABLE
SELECT session.min_examined_row_limit;
--Error ER_BAD_FIELD_ERROR
SELECT min_examined_row_limit = @@session.min_examined_row_limit;
####################################
# Restore initial value #
####################################
SET @@global.min_examined_row_limit = @start_global_value;
SELECT @@global.min_examined_row_limit;
SET @@session.min_examined_row_limit = @start_session_value;
SELECT @@session.min_examined_row_limit;
#############################################################
# END OF min_examined_row_limit TESTS #
#############################################################

View file

@ -1310,6 +1310,7 @@ SELECT * FROM t1;
--echo # Switch to connection con2
connection con2;
--reap
SELECT * FROM t1;
--echo # Switch to connection con1

View file

@ -0,0 +1,219 @@
############## mysql-test\t\multi_range_count_basic.test ###############
# #
# Variable Name: multi_range_count #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 256 #
# Range:1-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable multi_range_count #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
#################################################################
# START OF multi_range_count TESTS #
#################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.multi_range_count;
SELECT @start_global_value;
SET @start_session_value = @@session.multi_range_count;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_090_01-------------------------#'
#################################################################
# Display the DEFAULT value of multi_range_count #
#################################################################
SET @@global.multi_range_count = 100;
SET @@global.multi_range_count = DEFAULT;
SELECT @@global.multi_range_count;
SET @@session.multi_range_count = 200;
SET @@session.multi_range_count = DEFAULT;
SELECT @@session.multi_range_count;
--echo '#--------------------FN_DYNVARS_090_02-------------------------#'
#################################################################
# Check the DEFAULT value of multi_range_count #
#################################################################
SET @@global.multi_range_count = DEFAULT;
SELECT @@global.multi_range_count = 256;
SET @@session.multi_range_count = DEFAULT;
SELECT @@session.multi_range_count = 256;
--echo '#--------------------FN_DYNVARS_090_03-------------------------#'
###########################################################################
# Change the value of multi_range_count to a valid value for GLOBAL Scope #
###########################################################################
SET @@global.multi_range_count = 1;
SELECT @@global.multi_range_count;
SET @@global.multi_range_count = 60020;
SELECT @@global.multi_range_count;
SET @@global.multi_range_count = 65535;
SELECT @@global.multi_range_count;
SET @@global.multi_range_count = 4294967295;
SELECT @@global.multi_range_count;
SET @@global.multi_range_count = 4294967294;
SELECT @@global.multi_range_count;
--echo '#--------------------FN_DYNVARS_090_04-------------------------#'
############################################################################
# Change the value of multi_range_count to a valid value for SESSION Scope #
############################################################################
SET @@session.multi_range_count = 1;
SELECT @@session.multi_range_count;
SET @@session.multi_range_count = 50050;
SELECT @@session.multi_range_count;
SET @@session.multi_range_count = 65535;
SELECT @@session.multi_range_count;
SET @@session.multi_range_count = 4294967295;
SELECT @@session.multi_range_count;
SET @@session.multi_range_count = 4294967294;
SELECT @@session.multi_range_count;
--echo '#------------------FN_DYNVARS_090_05-----------------------#'
#############################################################
# Change the value of multi_range_count to an invalid value #
#############################################################
SET @@global.multi_range_count = 0;
SELECT @@global.multi_range_count;
SET @@global.multi_range_count = 4294967296;
SELECT @@global.multi_range_count;
SET @@global.multi_range_count = -1024;
SELECT @@global.multi_range_count;
SET @@global.multi_range_count = 429496729500;
SELECT @@global.multi_range_count;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.multi_range_count = 65530.34;
SELECT @@global.multi_range_count;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.multi_range_count = test;
SELECT @@global.multi_range_count;
SET @@session.multi_range_count = 0;
SELECT @@session.multi_range_count;
SET @@session.multi_range_count = 4294967296;
SELECT @@session.multi_range_count;
SET @@session.multi_range_count = -1;
SELECT @@session.multi_range_count;
--Error ER_PARSE_ERROR
SET @@session.multi_range_count = 65530.34.;
SET @@session.multi_range_count = 4294967295021;
SELECT @@session.multi_range_count;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.multi_range_count = test;
SELECT @@session.multi_range_count;
--echo '#------------------FN_DYNVARS_090_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.multi_range_count = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='multi_range_count';
--echo '#------------------FN_DYNVARS_090_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.multi_range_count = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='multi_range_count';
--echo '#------------------FN_DYNVARS_090_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.multi_range_count = TRUE;
SELECT @@global.multi_range_count;
SET @@global.multi_range_count = FALSE;
SELECT @@global.multi_range_count;
--echo '#---------------------FN_DYNVARS_090_09----------------------#'
#################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
#################################################################################
SET @@global.multi_range_count = 10;
SELECT @@multi_range_count = @@global.multi_range_count;
--echo '#---------------------FN_DYNVARS_090_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@multi_range_count = 100;
SELECT @@multi_range_count = @@local.multi_range_count;
SELECT @@local.multi_range_count = @@session.multi_range_count;
--echo '#---------------------FN_DYNVARS_090_11----------------------#'
############################################################################
# Check if multi_range_count can be accessed with and without @@ sign #
############################################################################
SET multi_range_count = 1;
SELECT @@multi_range_count;
--Error ER_UNKNOWN_TABLE
SELECT local.multi_range_count;
--Error ER_UNKNOWN_TABLE
SELECT session.multi_range_count;
--Error ER_BAD_FIELD_ERROR
SELECT multi_range_count = @@session.multi_range_count;
####################################
# Restore initial value #
####################################
SET @@global.multi_range_count = @start_global_value;
SELECT @@global.multi_range_count;
SET @@session.multi_range_count = @start_session_value;
SELECT @@session.multi_range_count;
######################################################
# END OF multi_range_count TESTS #
######################################################

View file

@ -0,0 +1,184 @@
############## mysql-test\t\myisam_max_sort_file_size_basic.test ################
# #
# Variable Name: myisam_max_sort_file_size #
# Scope: GLOBAL & SESSION #
# Access Type: Dynamic #
# Data Type: Numeric #
# Default Value: 1 #
# Range: 1 - 65536 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Rizwan Maredia #
# #
# Description: Test Cases of Dynamic System Variable myisam_max_sort_file_size #
# that checks the behavior of this variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
################################################################################
--source include/load_sysvars.inc
###################################################################
# START OF myisam_max_sort_file_size TESTS #
###################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.myisam_max_sort_file_size;
SELECT @start_global_value;
--echo '#--------------------FN_DYNVARS_094_01-------------------------#'
###################################################################
# Display the DEFAULT value of myisam_max_sort_file_size #
###################################################################
SET @@global.myisam_max_sort_file_size = 500000;
SET @@global.myisam_max_sort_file_size = DEFAULT;
SELECT @@global.myisam_max_sort_file_size;
--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
--echo '#--------------------FN_DYNVARS_094_02-------------------------#'
###################################################################
# Check the DEFAULT value of myisam_max_sort_file_size #
###################################################################
SET @@global.myisam_max_sort_file_size = DEFAULT;
SELECT @@global.myisam_max_sort_file_size = 2147483648;
--echo '#--------------------FN_DYNVARS_094_03-------------------------#'
##################################################################################
# Change the value of myisam_max_sort_file_size to a valid value for GLOBAL Scope #
##################################################################################
SET @@global.myisam_max_sort_file_size = 0;
SELECT @@global.myisam_max_sort_file_size;
SET @@global.myisam_max_sort_file_size = 1024;
SELECT @@global.myisam_max_sort_file_size;
SET @@global.myisam_max_sort_file_size = 123456789;
SELECT @@global.myisam_max_sort_file_size;
SET @@global.myisam_max_sort_file_size = 2147483648*2;
SELECT @@global.myisam_max_sort_file_size;
SET @@global.myisam_max_sort_file_size = 2147483648*1024;
SELECT @@global.myisam_max_sort_file_size;
SELECT @@global.myisam_max_sort_file_size;
SET @@global.myisam_max_sort_file_size = 2147483648*2147483648;
--echo '#--------------------FN_DYNVARS_094_04-------------------------#'
#################################################################################
# Check if variable can be access with session scope #
#################################################################################
--Error ER_GLOBAL_VARIABLE
SET @@myisam_max_sort_file_size = 2;
--Error ER_GLOBAL_VARIABLE
SET @@session.myisam_max_sort_file_size = 3;
--Error ER_GLOBAL_VARIABLE
SET @@local.myisam_max_sort_file_size = 4;
--echo '#------------------FN_DYNVARS_094_05-----------------------#'
####################################################################
# Change the value of myisam_max_sort_file_size to an invalid value #
####################################################################
SET @@global.myisam_max_sort_file_size = -1;
SELECT @@global.myisam_max_sort_file_size;
SET @@global.myisam_max_sort_file_size = -2147483648;
SELECT @@global.myisam_max_sort_file_size;
SET @@global.myisam_max_sort_file_size = -2147483649;
SELECT @@global.myisam_max_sort_file_size;
--Error ER_PARSE_ERROR
SET @@global.myisam_max_sort_file_size = 65530.34.;
SELECT @@global.myisam_max_sort_file_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.myisam_max_sort_file_size = 2147483649.56;
SELECT @@global.myisam_max_sort_file_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.myisam_max_sort_file_size = 1G;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--echo '#------------------FN_DYNVARS_094_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SET @@global.myisam_max_sort_file_size = 3000;
SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='myisam_max_sort_file_size';
--echo '#------------------FN_DYNVARS_094_07-----------------------#'
###########################################################################
# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES #
###########################################################################
SELECT count(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='myisam_max_sort_file_size';
--echo '#------------------FN_DYNVARS_094_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.myisam_max_sort_file_size = TRUE;
SELECT @@global.myisam_max_sort_file_size;
SET @@global.myisam_max_sort_file_size = FALSE;
SELECT @@global.myisam_max_sort_file_size;
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
#################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
#################################################################################
SET @@global.myisam_max_sort_file_size = 512;
SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size;
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
##################################################################################
# Check if myisam_max_sort_file_size can be accessed without @@ sign and scope #
##################################################################################
--Error ER_GLOBAL_VARIABLE
SET myisam_max_sort_file_size = 2048;
--Error ER_BAD_FIELD_ERROR
SELECT myisam_max_sort_file_size;
SELECT @@myisam_max_sort_file_size;
#verifying another syntax for setting value#
SET global myisam_max_sort_file_size = 64;
####################################
# Restore initial value #
####################################
SET @@global.myisam_max_sort_file_size = @start_global_value;
SELECT @@global.myisam_max_sort_file_size;
########################################################
# END OF myisam_max_sort_file_size TESTS #
########################################################

View file

@ -0,0 +1,242 @@
############## mysql-test\t\myisam_repair_threads_basic.test ##################
# #
# Variable Name: myisam_repair_threads #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 1 #
# Range: 1-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Sharique Abdullah #
# #
# Description: Test Cases of Dynamic System Variable myisam_repair_threads #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
######################################################################
# START OF myisam_repair_threads TESTS #
######################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.myisam_repair_threads;
SELECT @start_global_value;
SET @start_session_value = @@session.myisam_repair_threads;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
#################################################################
# Display the DEFAULT value of myisam_block_size #
#################################################################
SET @@global.myisam_repair_threads = 100;
SET @@global.myisam_repair_threads = DEFAULT;
SELECT @@global.myisam_repair_threads ;
SET @@session.myisam_repair_threads = 200;
SET @@session.myisam_repair_threads = DEFAULT;
SELECT @@session.myisam_repair_threads ;
--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
######################################################################
# Check the DEFAULT value of myisam_repair_threads #
######################################################################
SET @@global.myisam_repair_threads = DEFAULT;
SELECT @@global.myisam_repair_threads = 1;
SET @@session.myisam_repair_threads = DEFAULT;
SELECT @@session.myisam_repair_threads = 1;
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
###############################################################################
# Change the value of myisam_repair_threads to a valid value for GLOBAL Scope#
###############################################################################
SET @@global.myisam_repair_threads = 1;
SELECT @@global.myisam_repair_threads ;
SET @@global.myisam_repair_threads = 4294967295;
SELECT @@global.myisam_repair_threads ;
SET @@global.myisam_repair_threads = 655354;
SELECT @@global.myisam_repair_threads ;
--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
###############################################################################
# Change the value of myisam_repair_threads to a valid value for SESSION
# Scope
###############################################################################
SET @@session.myisam_repair_threads = 1;
SELECT @@session.myisam_repair_threads ;
SET @@session.myisam_repair_threads = 4294967295;
SELECT @@session.myisam_repair_threads ;
SET @@session.myisam_repair_threads = 655345;
SELECT @@session.myisam_repair_threads ;
--echo '#------------------FN_DYNVARS_005_05-----------------------#'
##################################################################
# Change the value of myisam_repair_threads to an invalid value #
##################################################################
SET @@global.myisam_repair_threads = 0;
SELECT @@global.myisam_repair_threads ;
SET @@global.myisam_repair_threads = -1024;
SELECT @@global.myisam_repair_threads ;
SET @@global.myisam_repair_threads = 429496729533;
SELECT @@global.myisam_repair_threads ;
--Error ER_PARSE_ERROR
SET @@global.myisam_repair_threads = 65530.34.;
SELECT @@global.myisam_repair_threads ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.myisam_repair_threads = test;
SELECT @@global.myisam_repair_threads ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.myisam_repair_threads = "test";
SELECT @@global.myisam_repair_threads ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.myisam_repair_threads = 'test';
SELECT @@global.myisam_repair_threads ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.myisam_repair_threads = ON;
SELECT @@global.myisam_repair_threads ;
SET @@session.myisam_repair_threads = 0;
SELECT @@session.myisam_repair_threads ;
SET @@session.myisam_repair_threads = -2;
SELECT @@session.myisam_repair_threads ;
--Error ER_PARSE_ERROR
SET @@session.myisam_repair_threads = 65530.34.;
SELECT @@session.myisam_repair_threads ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.myisam_repair_threads = test;
SELECT @@session.myisam_repair_threads ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.myisam_repair_threads = "test";
SELECT @@session.myisam_repair_threads ;
--echo '#------------------FN_DYNVARS_005_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.myisam_repair_threads = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='myisam_repair_threads ';
--echo '#------------------FN_DYNVARS_005_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.myisam_repair_threads = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='myisam_repair_threads ';
--echo '#------------------FN_DYNVARS_005_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.myisam_repair_threads = TRUE;
SELECT @@global.myisam_repair_threads ;
SET @@global.myisam_repair_threads = FALSE;
SELECT @@global.myisam_repair_threads ;
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
###############################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
###############################################################################
SET @@global.myisam_repair_threads = 10;
SELECT @@myisam_repair_threads = @@global.myisam_repair_threads ;
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to
# same session variable #
########################################################################################################
SET @@myisam_repair_threads = 100;
SELECT @@myisam_repair_threads = @@local.myisam_repair_threads ;
SELECT @@local.myisam_repair_threads = @@session.myisam_repair_threads ;
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
###################################################################################
# Check if myisam_repair_threads can be accessed with and without @@ sign #
###################################################################################
SET myisam_repair_threads = 1;
SELECT @@myisam_repair_threads ;
--Error ER_UNKNOWN_TABLE
SELECT local.myisam_repair_threads ;
--Error ER_UNKNOWN_TABLE
SELECT session.myisam_repair_threads ;
--Error ER_BAD_FIELD_ERROR
SELECT myisam_repair_threads = @@session.myisam_repair_threads ;
####################################
# Restore initial value #
####################################
SET @@global.myisam_repair_threads = @start_global_value;
SELECT @@global.myisam_repair_threads ;
SET @@session.myisam_repair_threads = @start_session_value;
SELECT @@session.myisam_repair_threads ;
#############################################################
# END OF myisam_repair_threads TESTS #
#############################################################

View file

@ -0,0 +1,240 @@
############## mysql-test\t\myisam_sort_buffer_size_basic.test ###############
# #
# Variable Name: myisam_sort_buffer_size #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: #
# Range: #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Rizwan #
# #
# Description: Test Cases of Dynamic System Variable myisam_sort_buffer_size #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
########################################################################
# START OF myisam_sort_buffer_size TESTS #
########################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.myisam_sort_buffer_size ;
SELECT @start_global_value;
SET @start_session_value = @@session.myisam_sort_buffer_size ;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
########################################################################
# Display the DEFAULT value of myisam_block_size #
########################################################################
SET @@global.myisam_sort_buffer_size = 100;
SET @@global.myisam_sort_buffer_size = DEFAULT;
SELECT @@global.myisam_sort_buffer_size ;
SET @@session.myisam_sort_buffer_size = 200;
SET @@session.myisam_sort_buffer_size = DEFAULT;
SELECT @@session.myisam_sort_buffer_size ;
--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
########################################################################
# Check the DEFAULT value of myisam_sort_buffer_size #
########################################################################
SET @@global.myisam_sort_buffer_size = DEFAULT;
SELECT @@global.myisam_sort_buffer_size = 8388608;
SET @@session.myisam_sort_buffer_size = DEFAULT;
SELECT @@session.myisam_sort_buffer_size = 8388608;
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
##################################################################################
# Change the value of myisam_sort_buffer_size to a valid value for GLOBAL Scope #
##################################################################################
SET @@global.myisam_sort_buffer_size = 4;
SELECT @@global.myisam_sort_buffer_size ;
SET @@global.myisam_sort_buffer_size = 4294967295;
SELECT @@global.myisam_sort_buffer_size ;
SET @@global.myisam_sort_buffer_size = 655354;
SELECT @@global.myisam_sort_buffer_size ;
--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
###################################################################################
# Change the value of myisam_sort_buffer_size to a valid value for SESSION Scope #
###################################################################################
SET @@session.myisam_sort_buffer_size = 4;
SELECT @@session.myisam_sort_buffer_size ;
SET @@session.myisam_sort_buffer_size = 4294967295;
SELECT @@session.myisam_sort_buffer_size ;
SET @@session.myisam_sort_buffer_size = 655345;
SELECT @@session.myisam_sort_buffer_size ;
--echo '#------------------FN_DYNVARS_005_05-----------------------#'
####################################################################
# Change the value of myisam_sort_buffer_size to an invalid value #
####################################################################
SET @@global.myisam_sort_buffer_size = 0;
SELECT @@global.myisam_sort_buffer_size ;
SET @@global.myisam_sort_buffer_size = -1024;
SELECT @@global.myisam_sort_buffer_size ;
SET @@global.myisam_sort_buffer_size = 429496729533;
SELECT @@global.myisam_sort_buffer_size ;
--Error ER_PARSE_ERROR
SET @@global.myisam_sort_buffer_size = 65530.34.;
SELECT @@global.myisam_sort_buffer_size ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.myisam_sort_buffer_size = test;
SELECT @@global.myisam_sort_buffer_size ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.myisam_sort_buffer_size = "test";
SELECT @@global.myisam_sort_buffer_size ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.myisam_sort_buffer_size = 'test';
SELECT @@global.myisam_sort_buffer_size ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.myisam_sort_buffer_size = ON;
SELECT @@global.myisam_sort_buffer_size ;
SET @@session.myisam_sort_buffer_size = 0;
SELECT @@session.myisam_sort_buffer_size ;
SET @@session.myisam_sort_buffer_size = -2;
SELECT @@session.myisam_sort_buffer_size ;
--Error ER_PARSE_ERROR
SET @@session.myisam_sort_buffer_size = 65530.34.;
SELECT @@session.myisam_sort_buffer_size ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.myisam_sort_buffer_size = test;
SELECT @@session.myisam_sort_buffer_size ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.myisam_sort_buffer_size = "test";
SELECT @@session.myisam_sort_buffer_size ;
--echo '#------------------FN_DYNVARS_005_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.myisam_sort_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='myisam_sort_buffer_size ';
--echo '#------------------FN_DYNVARS_005_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.myisam_sort_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='myisam_sort_buffer_size ';
--echo '#------------------FN_DYNVARS_005_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.myisam_sort_buffer_size = TRUE;
SELECT @@global.myisam_sort_buffer_size ;
SET @@global.myisam_sort_buffer_size = FALSE;
SELECT @@global.myisam_sort_buffer_size ;
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
####################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
####################################################################################
SET @@global.myisam_sort_buffer_size = 10;
SELECT @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size ;
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@myisam_sort_buffer_size = 100;
SELECT @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size ;
SELECT @@local.myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ;
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
###################################################################################
# Check if myisam_sort_buffer_size can be accessed with and without @@ sign #
###################################################################################
SET myisam_sort_buffer_size = 1;
SELECT @@myisam_sort_buffer_size ;
--Error ER_UNKNOWN_TABLE
SELECT local.myisam_sort_buffer_size ;
--Error ER_UNKNOWN_TABLE
SELECT session.myisam_sort_buffer_size ;
--Error ER_BAD_FIELD_ERROR
SELECT myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ;
####################################
# Restore initial value #
####################################
SET @@global.myisam_sort_buffer_size = @start_global_value;
SELECT @@global.myisam_sort_buffer_size ;
SET @@session.myisam_sort_buffer_size = @start_session_value;
SELECT @@session.myisam_sort_buffer_size ;
#############################################################
# END OF myisam_sort_buffer_size TESTS #
#############################################################

View file

@ -0,0 +1,217 @@
############## mysql-test\t\net_retry_count_basic.test ###############
# #
# Variable Name: net_retry_count #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value:10 #
# Range: 1-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable net_retry_count #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
###############################################################
# START OF net_retry_count TESTS #
###############################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.net_retry_count;
SELECT @start_global_value;
SET @start_session_value = @@session.net_retry_count;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_111_01-------------------------#'
###############################################################
# Display the DEFAULT value of net_retry_count #
###############################################################
SET @@global.net_retry_count = 100;
SET @@global.net_retry_count = DEFAULT;
SELECT @@global.net_retry_count;
SET @@session.net_retry_count = 200;
SET @@session.net_retry_count = DEFAULT;
SELECT @@session.net_retry_count;
--echo '#--------------------FN_DYNVARS_111_02-------------------------#'
###############################################################
# Check the DEFAULT value of net_retry_count #
###############################################################
SET @@global.net_retry_count = DEFAULT;
SELECT @@global.net_retry_count = 10;
SET @@session.net_retry_count = DEFAULT;
SELECT @@session.net_retry_count = 10;
--echo '#--------------------FN_DYNVARS_111_03-------------------------#'
#########################################################################
# Change the value of net_retry_count to a valid value for GLOBAL Scope #
#########################################################################
SET @@global.net_retry_count = 1;
SELECT @@global.net_retry_count;
SET @@global.net_retry_count = 2;
SELECT @@global.net_retry_count;
SET @@global.net_retry_count = 4294967295;
SELECT @@global.net_retry_count;
SET @@global.net_retry_count = 4294967294;
SELECT @@global.net_retry_count;
SET @@global.net_retry_count = 65536;
SELECT @@global.net_retry_count;
--echo '#--------------------FN_DYNVARS_111_04-------------------------#'
##########################################################################
# Change the value of net_retry_count to a valid value for SESSION Scope #
##########################################################################
SET @@session.net_retry_count = 1;
SELECT @@session.net_retry_count;
SET @@session.net_retry_count = 2;
SELECT @@session.net_retry_count;
SET @@session.net_retry_count = 65535;
SELECT @@session.net_retry_count;
SET @@session.net_retry_count = 4294967295;
SELECT @@session.net_retry_count;
SET @@session.net_retry_count = 4294967294;
SELECT @@session.net_retry_count;
--echo '#------------------FN_DYNVARS_111_05-----------------------#'
###########################################################
# Change the value of net_retry_count to an invalid value #
###########################################################
SET @@global.net_retry_count = 0;
SELECT @@global.net_retry_count;
SET @@global.net_retry_count = -1024;
SELECT @@global.net_retry_count;
SET @@global.net_retry_count = 4294967296;
SELECT @@global.net_retry_count;
SET @@global.net_retry_count = 429496729500;
SELECT @@global.net_retry_count;
--Error ER_PARSE_ERROR
SET @@global.net_retry_count = 65530.34.;
SELECT @@global.net_retry_count;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.net_retry_count = test;
SELECT @@global.net_retry_count;
SET @@session.net_retry_count = 0;
SELECT @@session.net_retry_count;
SET @@session.net_retry_count = -2;
SELECT @@session.net_retry_count;
--Error ER_PARSE_ERROR
SET @@session.net_retry_count = 65530.34.;
SET @@session.net_retry_count = 6555015425;
SELECT @@session.net_retry_count;
SET @@session.net_retry_count = 4294967296;
SELECT @@session.net_retry_count;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.net_retry_count = test;
SELECT @@session.net_retry_count;
--echo '#------------------FN_DYNVARS_111_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.net_retry_count = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='net_retry_count';
--echo '#------------------FN_DYNVARS_111_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.net_retry_count = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='net_retry_count';
--echo '#------------------FN_DYNVARS_111_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.net_retry_count = TRUE;
SELECT @@global.net_retry_count;
SET @@global.net_retry_count = FALSE;
SELECT @@global.net_retry_count;
--echo '#---------------------FN_DYNVARS_111_09----------------------#'
#################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
#################################################################################
SET @@global.net_retry_count = 10;
SELECT @@net_retry_count = @@global.net_retry_count;
--echo '#---------------------FN_DYNVARS_111_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@net_retry_count = 100;
SELECT @@net_retry_count = @@local.net_retry_count;
SELECT @@local.net_retry_count = @@session.net_retry_count;
--echo '#---------------------FN_DYNVARS_111_11----------------------#'
##########################################################################
# Check if net_retry_count can be accessed with and without @@ sign #
##########################################################################
SET net_retry_count = 1;
SELECT @@net_retry_count;
--Error ER_UNKNOWN_TABLE
SELECT local.net_retry_count;
--Error ER_UNKNOWN_TABLE
SELECT session.net_retry_count;
--Error ER_BAD_FIELD_ERROR
SELECT net_retry_count = @@session.net_retry_count;
####################################
# Restore initial value #
####################################
SET @@global.net_retry_count = @start_global_value;
SELECT @@global.net_retry_count;
SET @@session.net_retry_count = @start_session_value;
SELECT @@session.net_retry_count;
####################################################
# END OF net_retry_count TESTS #
####################################################

View file

@ -0,0 +1,225 @@
############## mysql-test\t\query_alloc_block_size_basic.test ###############
# #
# Variable Name: query_alloc_block_size #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 8192 #
# Range: 1024-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable query_alloc_block_size #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
###################################################################
# START OF query_alloc_block_size TESTS #
###################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.query_alloc_block_size;
SELECT @start_global_value;
SET @start_session_value = @@session.query_alloc_block_size;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_130_01-------------------------#'
###################################################################
# Display the DEFAULT value of query_alloc_block_size #
###################################################################
SET @@global.query_alloc_block_size = 10000;
SET @@global.query_alloc_block_size = DEFAULT;
SELECT @@global.query_alloc_block_size;
SET @@session.query_alloc_block_size = 20000;
SET @@session.query_alloc_block_size = DEFAULT;
SELECT @@session.query_alloc_block_size;
--echo '#--------------------FN_DYNVARS_130_02-------------------------#'
###################################################################
# Check the DEFAULT value of query_alloc_block_size #
###################################################################
SET @@global.query_alloc_block_size = DEFAULT;
SELECT @@global.query_alloc_block_size = 8192;
SET @@session.query_alloc_block_size = DEFAULT;
SELECT @@session.query_alloc_block_size = 8192;
--echo '#--------------------FN_DYNVARS_130_03-------------------------#'
#############################################################################
# Change the value of query_alloc_block_size to a valid value for GLOBAL Scope #
#############################################################################
SET @@global.query_alloc_block_size = 1024;
SELECT @@global.query_alloc_block_size;
SET @@global.query_alloc_block_size = 1025;
SELECT @@global.query_alloc_block_size;
SET @@global.query_alloc_block_size = 4294967295;
SELECT @@global.query_alloc_block_size;
SET @@global.query_alloc_block_size = 4294967294;
SELECT @@global.query_alloc_block_size;
SET @@global.query_alloc_block_size = 65536;
SELECT @@global.query_alloc_block_size;
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#--------------------FN_DYNVARS_130_04-------------------------#'
#################################################################################
# Change the value of query_alloc_block_size to a valid value for SESSION Scope #
#################################################################################
SET @@session.query_alloc_block_size = 1024;
SELECT @@session.query_alloc_block_size;
SET @@session.query_alloc_block_size = 1025;
SELECT @@session.query_alloc_block_size;
SET @@session.query_alloc_block_size = 4294967295;
SELECT @@session.query_alloc_block_size;
SET @@session.query_alloc_block_size = 4294967294;
SELECT @@session.query_alloc_block_size;
SET @@session.query_alloc_block_size = 655536;
SELECT @@session.query_alloc_block_size;
--echo '#------------------FN_DYNVARS_130_05-----------------------#'
##################################################################
# Change the value of query_alloc_block_size to an invalid value #
##################################################################
SET @@global.query_alloc_block_size = 64;
SELECT @@global.query_alloc_block_size;
SET @@global.query_alloc_block_size = -1;
SELECT @@global.query_alloc_block_size;
SET @@global.query_alloc_block_size = 1023;
SELECT @@global.query_alloc_block_size;
SET @@global.query_alloc_block_size = 4294967296;
SELECT @@global.query_alloc_block_size;
--Error ER_PARSE_ERROR
SET @@global.query_alloc_block_size = 65530.34.;
SELECT @@global.query_alloc_block_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_alloc_block_size = test;
SELECT @@global.query_alloc_block_size;
SET @@session.query_alloc_block_size = 64;
SELECT @@session.query_alloc_block_size;
SET @@session.query_alloc_block_size = -2;
SELECT @@session.query_alloc_block_size;
--Error ER_PARSE_ERROR
SET @@session.query_alloc_block_size = 65530.34.;
SET @@session.query_alloc_block_size = 1023;
SELECT @@session.query_alloc_block_size;
SET @@session.query_alloc_block_size = 4294967296;
SELECT @@session.query_alloc_block_size;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.query_alloc_block_size = test;
SELECT @@session.query_alloc_block_size;
--echo '#------------------FN_DYNVARS_130_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
#SET @@global.query_alloc_block_size = 1;
#SET @@session.query_alloc_block_size = 12;
--echo 'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement';
SET @@global.query_alloc_block_size = 1;
SET @@session.query_alloc_block_size = 12;
SELECT @@global.query_alloc_block_size =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='query_alloc_block_size';
--echo '#------------------FN_DYNVARS_130_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.query_alloc_block_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='query_alloc_block_size';
--echo '#------------------FN_DYNVARS_130_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.query_alloc_block_size = TRUE;
SELECT @@global.query_alloc_block_size;
SET @@global.query_alloc_block_size = FALSE;
SELECT @@global.query_alloc_block_size;
--echo '#---------------------FN_DYNVARS_130_09----------------------#'
#################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
#################################################################################
SET @@global.query_alloc_block_size = 2048;
SELECT @@query_alloc_block_size = @@global.query_alloc_block_size;
--echo '#---------------------FN_DYNVARS_130_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@query_alloc_block_size = 5000;
SELECT @@query_alloc_block_size = @@local.query_alloc_block_size;
SELECT @@local.query_alloc_block_size = @@session.query_alloc_block_size;
--echo '#---------------------FN_DYNVARS_130_11----------------------#'
##############################################################################
# Check if query_alloc_block_size can be accessed with and without @@ sign #
##############################################################################
SET query_alloc_block_size = 1024;
SELECT @@query_alloc_block_size;
--Error ER_UNKNOWN_TABLE
SELECT local.query_alloc_block_size;
--Error ER_UNKNOWN_TABLE
SELECT session.query_alloc_block_size;
--Error ER_BAD_FIELD_ERROR
SELECT query_alloc_block_size = @@session.query_alloc_block_size;
####################################
# Restore initial value #
####################################
SET @@global.query_alloc_block_size = @start_global_value;
SELECT @@global.query_alloc_block_size;
SET @@session.query_alloc_block_size = @start_session_value;
SELECT @@session.query_alloc_block_size;
########################################################
# END OF query_alloc_block_size TESTS #
########################################################

View file

@ -0,0 +1,178 @@
############## mysql-test\t\query_cache_limit_basic.test ###############
# #
# Variable Name: query_cache_limit #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 1048576 #
# Min value: 0 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable query_cache_limit #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/have_query_cache.inc
--source include/load_sysvars.inc
########################################################################
# START OF query_cache_limit TESTS #
########################################################################
########################################################################
# Saving initial value of query_cache_limit in a temporary variable #
########################################################################
SET @start_value = @@global.query_cache_limit;
SELECT @start_value;
--echo '#--------------------FN_DYNVARS_131_01------------------------#'
########################################################################
# Display the DEFAULT value of query_cache_limit #
########################################################################
SET @@global.query_cache_limit = 99;
SET @@global.query_cache_limit = DEFAULT;
SELECT @@global.query_cache_limit;
--echo '#---------------------FN_DYNVARS_131_02-------------------------#'
###############################################
# Verify default value of variable #
###############################################
SET @@global.query_cache_limit = @start_value;
SELECT @@global.query_cache_limit = 1048576;
--echo '#--------------------FN_DYNVARS_131_03------------------------#'
########################################################################
# Change the value of query_cache_limit to a valid value #
########################################################################
SET @@global.query_cache_limit = 0;
SELECT @@global.query_cache_limit;
SET @@global.query_cache_limit = 1;
SELECT @@global.query_cache_limit;
SET @@global.query_cache_limit = 1048576;
SELECT @@global.query_cache_limit;
SET @@global.query_cache_limit = 1048575;
SELECT @@global.query_cache_limit;
--echo '#--------------------FN_DYNVARS_131_04-------------------------#'
###########################################################################
# Change the value of query_cache_limit to invalid value #
###########################################################################
SET @@global.query_cache_limit = -1;
SELECT @@global.query_cache_limit;
SET @@global.query_cache_limit = 4294967296;
SELECT @@global.query_cache_limit;
SET @@global.query_cache_limit = 10240022115;
SELECT @@global.query_cache_limit;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_cache_limit = 10000.01;
SELECT @@global.query_cache_limit;
SET @@global.query_cache_limit = -1024;
SELECT @@global.query_cache_limit;
SET @@global.query_cache_limit = 42949672950;
SELECT @@global.query_cache_limit;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_cache_limit = ON;
SELECT @@global.query_cache_limit;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_cache_limit = 'test';
SELECT @@global.query_cache_limit;
--echo '#-------------------FN_DYNVARS_131_05----------------------------#'
###########################################################################
# Test if accessing session query_cache_limit gives error #
###########################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.query_cache_limit = 0;
SELECT @@query_cache_limit;
--echo '#----------------------FN_DYNVARS_131_06------------------------#'
##############################################################################
# Check if the value in GLOBAL & SESSION Tables matches values in variable #
##############################################################################
SELECT @@global.query_cache_limit = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='query_cache_limit';
SELECT @@query_cache_limit = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='query_cache_limit';
--echo '#---------------------FN_DYNVARS_131_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.query_cache_limit = TRUE;
SELECT @@global.query_cache_limit;
SET @@global.query_cache_limit = FALSE;
SELECT @@global.query_cache_limit;
--echo '#---------------------FN_DYNVARS_131_08----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@global.query_cache_limit = 1;
SELECT @@query_cache_limit = @@global.query_cache_limit;
--echo '#---------------------FN_DYNVARS_131_09----------------------#'
##########################################################################
# Check if query_cache_limit can be accessed with and without @@ sign #
##########################################################################
--Error ER_GLOBAL_VARIABLE
SET query_cache_limit = 1;
SELECT @@query_cache_limit;
--Error ER_PARSE_ERROR
SET local.query_cache_limit = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.query_cache_limit;
--Error ER_PARSE_ERROR
SET global.query_cache_limit = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.query_cache_limit;
--Error ER_BAD_FIELD_ERROR
SELECT query_cache_limit = @@session.query_cache_limit;
##############################
# Restore initial value #
##############################
SET @@global.query_cache_limit = @start_value;
SELECT @@global.query_cache_limit;
########################################################################
# END OF query_cache_limit TESTS #
########################################################################

View file

@ -0,0 +1,187 @@
############## mysql-test\t\query_cache_min_res_unit_basic.test ###############
# #
# Variable Name: query_cache_min_res_unit #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value:1024 #
# Min Value:0 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman Rawala #
# #
# Description: Test Cases of Dynamic System Variable query_cache_min_res_unit #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/have_query_cache.inc
--source include/load_sysvars.inc
########################################################################
########################################################################
# START OF query_cache_min_res_unit TESTS #
########################################################################
###############################################################################
# Saving initial value of query_cache_min_res_unit in a temporary variable #
###############################################################################
SET @start_value = @@global.query_cache_min_res_unit;
SELECT @start_value;
--echo '#--------------------FN_DYNVARS_132_01------------------------#'
###############################################################################
# Display the DEFAULT value of query_cache_min_res_unit #
###############################################################################
SET @@global.query_cache_min_res_unit = 99;
SET @@global.query_cache_min_res_unit = DEFAULT;
SELECT @@global.query_cache_min_res_unit;
--echo '#---------------------FN_DYNVARS_132_02-------------------------#'
###############################################
# Verify default value of variable #
###############################################
SET @@global.query_cache_min_res_unit = @start_value;
SELECT @@global.query_cache_min_res_unit = 4096;
--echo '#--------------------FN_DYNVARS_132_03------------------------#'
################################################################################
# Change the value of query_cache_min_res_unit to a valid value #
################################################################################
SET @@global.query_cache_min_res_unit = 0;
SELECT @@global.query_cache_min_res_unit;
SET @@global.query_cache_min_res_unit = 1;
SELECT @@global.query_cache_min_res_unit;
--echo 'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512';
SET @@global.query_cache_min_res_unit = 512;
SELECT @@global.query_cache_min_res_unit;
SET @@global.query_cache_min_res_unit = 513;
SELECT @@global.query_cache_min_res_unit;
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.query_cache_min_res_unit = 1048576;
SELECT @@global.query_cache_min_res_unit;
SET @@global.query_cache_min_res_unit = 1048575;
SELECT @@global.query_cache_min_res_unit;
--echo '#--------------------FN_DYNVARS_132_04-------------------------#'
###################################################################################
# Change the value of query_cache_min_res_unit to invalid value #
###################################################################################
SET @@global.query_cache_min_res_unit = -1;
SELECT @@global.query_cache_min_res_unit;
SET @@global.query_cache_min_res_unit = 4294967296;
SELECT @@global.query_cache_min_res_unit;
SET @@global.query_cache_min_res_unit = 511;
SELECT @@global.query_cache_min_res_unit;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_cache_min_res_unit = 10000.01;
SELECT @@global.query_cache_min_res_unit;
SET @@global.query_cache_min_res_unit = -1024;
SELECT @@global.query_cache_min_res_unit;
SET @@global.query_cache_min_res_unit = 42949672950;
SELECT @@global.query_cache_min_res_unit;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_cache_min_res_unit = ON;
SELECT @@global.query_cache_min_res_unit;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_cache_min_res_unit = 'test';
SELECT @@global.query_cache_min_res_unit;
--echo '#-------------------FN_DYNVARS_132_05----------------------------#'
###################################################################################
# Test if accessing session query_cache_min_res_unit gives error #
###################################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.query_cache_min_res_unit = 0;
SELECT @@query_cache_min_res_unit;
--echo '#----------------------FN_DYNVARS_132_06------------------------#'
##############################################################################
# Check if the value in GLOBAL & SESSION Tables matches values in variable #
##############################################################################
SELECT @@global.query_cache_min_res_unit = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='query_cache_min_res_unit';
SELECT @@query_cache_min_res_unit = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='query_cache_min_res_unit';
--echo '#---------------------FN_DYNVARS_132_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.query_cache_min_res_unit = TRUE;
SELECT @@global.query_cache_min_res_unit;
SET @@global.query_cache_min_res_unit = FALSE;
SELECT @@global.query_cache_min_res_unit;
--echo '#---------------------FN_DYNVARS_132_08----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@global.query_cache_min_res_unit = 1;
SELECT @@query_cache_min_res_unit = @@global.query_cache_min_res_unit;
--echo '#---------------------FN_DYNVARS_132_09----------------------#'
##################################################################################
# Check if query_cache_min_res_unit can be accessed with and without @@ sign #
##################################################################################
--Error ER_GLOBAL_VARIABLE
SET query_cache_min_res_unit = 1;
SELECT @@query_cache_min_res_unit;
--Error ER_PARSE_ERROR
SET local.query_cache_min_res_unit = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.query_cache_min_res_unit;
--Error ER_PARSE_ERROR
SET global.query_cache_min_res_unit = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.query_cache_min_res_unit;
--Error ER_BAD_FIELD_ERROR
SELECT query_cache_min_res_unit = @@session.query_cache_min_res_unit;
##############################
# Restore initial value #
##############################
SET @@global.query_cache_min_res_unit = @start_value;
SELECT @@global.query_cache_min_res_unit;
########################################################################
# END OF query_cache_min_res_unit TESTS #
########################################################################

View file

@ -0,0 +1,175 @@
############## mysql-test\t\query_cache_size_basic.test ###############
# #
# Variable Name: query_cache_size #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 0 #
# Range: - #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable query_cache_size #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/have_query_cache.inc
--source include/load_sysvars.inc
########################################################################
# START OF query_cache_size TESTS #
########################################################################
###############################################################################
# Saving initial value of query_cache_size in a temporary variable #
###############################################################################
SET @start_value = @@global.query_cache_size;
SELECT @start_value;
--echo '#--------------------FN_DYNVARS_133_01------------------------#'
###############################################################################
# Display the DEFAULT value of query_cache_size #
###############################################################################
SET @@global.query_cache_size = 99;
SET @@global.query_cache_size = DEFAULT;
SELECT @@global.query_cache_size;
--echo '#---------------------FN_DYNVARS_133_02-------------------------#'
###############################################
# Verify default value of variable #
###############################################
SET @@global.query_cache_size = @start_value;
SELECT @@global.query_cache_size = 0;
--echo '#--------------------FN_DYNVARS_133_03------------------------#'
################################################################################
# Change the value of query_cache_size to a valid value #
################################################################################
SET @@global.query_cache_size = 0;
SELECT @@global.query_cache_size;
SET @@global.query_cache_size = 1;
SELECT @@global.query_cache_size;
SET @@global.query_cache_size = 512;
SELECT @@global.query_cache_size;
SET @@global.query_cache_size = 1024;
SELECT @@global.query_cache_size;
--echo : 'Bug#34880: Warnings are coming on assinging valid values to variable
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.query_cache_size = 1048576;
SELECT @@global.query_cache_size;
SET @@global.query_cache_size = 1048575;
SELECT @@global.query_cache_size;
--echo '#--------------------FN_DYNVARS_133_04-------------------------#'
###################################################################################
# Change the value of query_cache_size to invalid value #
###################################################################################
SET @@global.query_cache_size = -1;
SELECT @@global.query_cache_size;
SET @@global.query_cache_size = 4294967296;
SELECT @@global.query_cache_size;
SET @@global.query_cache_size = 511;
SELECT @@global.query_cache_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_cache_size = 10000.01;
SELECT @@global.query_cache_size;
SET @@global.query_cache_size = -1024;
SELECT @@global.query_cache_size;
SET @@global.query_cache_size = 42949672950;
SELECT @@global.query_cache_size;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_cache_size = ON;
SELECT @@global.query_cache_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_cache_size = 'test';
SELECT @@global.query_cache_size;
--echo '#-------------------FN_DYNVARS_133_05----------------------------#'
###################################################################################
# Test if accessing session query_cache_size gives error #
###################################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.query_cache_size = 0;
SELECT @@query_cache_size;
--echo '#----------------------FN_DYNVARS_133_06------------------------#'
##############################################################################
# Check if the value in GLOBAL & SESSION Tables matches values in variable #
##############################################################################
SELECT @@global.query_cache_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='query_cache_size';
SELECT @@query_cache_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='query_cache_size';
--echo '#---------------------FN_DYNVARS_133_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.query_cache_size = TRUE;
SELECT @@global.query_cache_size;
SET @@global.query_cache_size = FALSE;
SELECT @@global.query_cache_size;
--echo '#---------------------FN_DYNVARS_133_08----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@global.query_cache_size = 1;
SELECT @@query_cache_size = @@global.query_cache_size;
--echo '#---------------------FN_DYNVARS_133_09----------------------#'
##################################################################################
# Check if query_cache_size can be accessed with and without @@ sign #
##################################################################################
--Error ER_GLOBAL_VARIABLE
SET query_cache_size = 1;
SELECT @@query_cache_size;
--Error ER_PARSE_ERROR
SET local.query_cache_size = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.query_cache_size;
--Error ER_PARSE_ERROR
SET global.query_cache_size = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.query_cache_size;
--Error ER_BAD_FIELD_ERROR
SELECT query_cache_size = @@session.query_cache_size;
##############################
# Restore initial value #
##############################
SET @@global.query_cache_size = @start_value;
SELECT @@global.query_cache_size;
########################################################################
# END OF query_cache_size TESTS #
########################################################################

View file

@ -0,0 +1,239 @@
############## mysql-test\t\query_prealloc_size_basic.test ###############
# #
# Variable Name: query_prealloc_size #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 8192 #
# Range: 8192-4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Rizwan #
# #
# Description: Test Cases of Dynamic System Variable query_prealloc_size #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
########################################################################
# START OF query_prealloc_size TESTS #
########################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.query_prealloc_size ;
SELECT @start_global_value;
SET @start_session_value = @@session.query_prealloc_size ;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
########################################################################
# Display the DEFAULT value of myisam_block_size #
########################################################################
SET @@global.query_prealloc_size = 100;
SET @@global.query_prealloc_size = DEFAULT;
SELECT @@global.query_prealloc_size ;
SET @@session.query_prealloc_size = 200;
SET @@session.query_prealloc_size = DEFAULT;
SELECT @@session.query_prealloc_size ;
--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
########################################################################
# Check the DEFAULT value of query_prealloc_size #
########################################################################
SET @@global.query_prealloc_size = DEFAULT;
SELECT @@global.query_prealloc_size = 8192;
SET @@session.query_prealloc_size = DEFAULT;
SELECT @@session.query_prealloc_size = 8192;
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
##################################################################################
# Change the value of query_prealloc_size to a valid value for GLOBAL Scope #
##################################################################################
SET @@global.query_prealloc_size = 8192;
SELECT @@global.query_prealloc_size ;
SET @@global.query_prealloc_size = 4294967295;
SELECT @@global.query_prealloc_size ;
SET @@global.query_prealloc_size = 655354;
SELECT @@global.query_prealloc_size ;
--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
###################################################################################
# Change the value of query_prealloc_size to a valid value for SESSION Scope #
###################################################################################
SET @@session.query_prealloc_size = 8192;
SELECT @@session.query_prealloc_size ;
SET @@session.query_prealloc_size = 4294967295;
SELECT @@session.query_prealloc_size ;
SET @@session.query_prealloc_size = 655345;
SELECT @@session.query_prealloc_size ;
--echo '#------------------FN_DYNVARS_005_05-----------------------#'
####################################################################
# Change the value of query_prealloc_size to an invalid value #
####################################################################
SET @@global.query_prealloc_size = 0;
SELECT @@global.query_prealloc_size ;
SET @@global.query_prealloc_size = -1024;
SELECT @@global.query_prealloc_size ;
SET @@global.query_prealloc_size = 429496729533;
SELECT @@global.query_prealloc_size ;
--Error ER_PARSE_ERROR
SET @@global.query_prealloc_size = 65530.34.;
SELECT @@global.query_prealloc_size ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_prealloc_size = test;
SELECT @@global.query_prealloc_size ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_prealloc_size = "test";
SELECT @@global.query_prealloc_size ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_prealloc_size = 'test';
SELECT @@global.query_prealloc_size ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.query_prealloc_size = ON;
SELECT @@global.query_prealloc_size ;
SET @@session.query_prealloc_size = 0;
SELECT @@session.query_prealloc_size ;
SET @@session.query_prealloc_size = -2;
SELECT @@session.query_prealloc_size ;
--Error ER_PARSE_ERROR
SET @@session.query_prealloc_size = 65530.34.;
SELECT @@session.query_prealloc_size ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.query_prealloc_size = test;
SELECT @@session.query_prealloc_size ;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.query_prealloc_size = "test";
SELECT @@session.query_prealloc_size ;
--echo '#------------------FN_DYNVARS_005_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.query_prealloc_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='query_prealloc_size ';
--echo '#------------------FN_DYNVARS_005_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.query_prealloc_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='query_prealloc_size ';
--echo '#------------------FN_DYNVARS_005_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.query_prealloc_size = TRUE;
SELECT @@global.query_prealloc_size ;
SET @@global.query_prealloc_size = FALSE;
SELECT @@global.query_prealloc_size ;
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
####################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
####################################################################################
SET @@global.query_prealloc_size = 10;
SELECT @@query_prealloc_size = @@global.query_prealloc_size ;
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@query_prealloc_size = 100;
SELECT @@query_prealloc_size = @@local.query_prealloc_size ;
SELECT @@local.query_prealloc_size = @@session.query_prealloc_size ;
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
###################################################################################
# Check if query_prealloc_size can be accessed with and without @@ sign #
###################################################################################
SET query_prealloc_size = 1;
SELECT @@query_prealloc_size ;
--Error ER_UNKNOWN_TABLE
SELECT local.query_prealloc_size ;
--Error ER_UNKNOWN_TABLE
SELECT session.query_prealloc_size ;
--Error ER_BAD_FIELD_ERROR
SELECT query_prealloc_size = @@session.query_prealloc_size ;
####################################
# Restore initial value #
####################################
SET @@global.query_prealloc_size = @start_global_value;
SELECT @@global.query_prealloc_size ;
SET @@session.query_prealloc_size = @start_session_value;
SELECT @@session.query_prealloc_size ;
#############################################################
# END OF query_prealloc_size TESTS #
#############################################################

View file

@ -0,0 +1,208 @@
############## mysql-test\t\range_alloc_block_size_basic.test ###############
# #
# Variable Name: range_alloc_block_size #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value:2048 #
# Max value: 4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable range_alloc_block_size #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
######################################################################
# START OF range_alloc_block_size TESTS #
######################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.range_alloc_block_size;
SELECT @start_global_value;
SET @start_session_value = @@session.range_alloc_block_size;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_137_01-------------------------#'
######################################################################
# Display the DEFAULT value of range_alloc_block_size #
######################################################################
SET @@global.range_alloc_block_size = 100;
SET @@global.range_alloc_block_size = DEFAULT;
SELECT @@global.range_alloc_block_size;
SET @@session.range_alloc_block_size = 200;
SET @@session.range_alloc_block_size = DEFAULT;
SELECT @@session.range_alloc_block_size;
--echo '#--------------------FN_DYNVARS_137_02-------------------------#'
######################################################################
# Check the DEFAULT value of range_alloc_block_size #
######################################################################
SET @@global.range_alloc_block_size = DEFAULT;
SELECT @@global.range_alloc_block_size = 2048;
SET @@session.range_alloc_block_size = DEFAULT;
SELECT @@session.range_alloc_block_size = 2048;
--echo '#--------------------FN_DYNVARS_137_03-------------------------#'
################################################################################
# Change the value of range_alloc_block_size to a valid value for GLOBAL Scope #
################################################################################
SET @@global.range_alloc_block_size = 2048;
SELECT @@global.range_alloc_block_size;
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
SET @@global.range_alloc_block_size = 4294967295;
SELECT @@global.range_alloc_block_size;
SET @@global.range_alloc_block_size = 4294967294;
SELECT @@global.range_alloc_block_size;
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#--------------------FN_DYNVARS_137_04-------------------------#'
###################################################################################
# Change the value of range_alloc_block_size to a valid value for SESSION Scope #
###################################################################################
SET @@session.range_alloc_block_size = 2048;
SELECT @@session.range_alloc_block_size;
SET @@session.range_alloc_block_size = 4294967295;
SELECT @@session.range_alloc_block_size;
SET @@session.range_alloc_block_size = 4294967294;
SELECT @@session.range_alloc_block_size;
--echo '#------------------FN_DYNVARS_137_05-----------------------#'
##################################################################
# Change the value of range_alloc_block_size to an invalid value #
##################################################################
SET @@global.range_alloc_block_size = 0;
SELECT @@global.range_alloc_block_size;
SET @@global.range_alloc_block_size = -1024;
SELECT @@global.range_alloc_block_size;
SET @@global.range_alloc_block_size = 42949672951;
SELECT @@global.range_alloc_block_size;
--Error ER_PARSE_ERROR
SET @@global.range_alloc_block_size = 65530.34.;
SELECT @@global.range_alloc_block_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.range_alloc_block_size = test;
SELECT @@global.range_alloc_block_size;
SET @@session.range_alloc_block_size = 0;
SELECT @@session.range_alloc_block_size;
SET @@session.range_alloc_block_size = -2;
SELECT @@session.range_alloc_block_size;
--Error ER_PARSE_ERROR
SET @@session.range_alloc_block_size = 65530.34.;
SET @@session.range_alloc_block_size = 4294967296;
SELECT @@session.range_alloc_block_size;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.range_alloc_block_size = test;
SELECT @@session.range_alloc_block_size;
--echo '#------------------FN_DYNVARS_137_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.range_alloc_block_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='range_alloc_block_size';
--echo '#------------------FN_DYNVARS_137_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.range_alloc_block_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='range_alloc_block_size';
--echo '#------------------FN_DYNVARS_137_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.range_alloc_block_size = TRUE;
SELECT @@global.range_alloc_block_size;
SET @@global.range_alloc_block_size = FALSE;
SELECT @@global.range_alloc_block_size;
--echo '#---------------------FN_DYNVARS_137_09----------------------#'
####################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
####################################################################################
SET @@global.range_alloc_block_size = 10;
SELECT @@range_alloc_block_size = @@global.range_alloc_block_size;
--echo '#---------------------FN_DYNVARS_137_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@range_alloc_block_size = 100;
SELECT @@range_alloc_block_size = @@local.range_alloc_block_size;
SELECT @@local.range_alloc_block_size = @@session.range_alloc_block_size;
--echo '#---------------------FN_DYNVARS_137_11----------------------#'
###################################################################################
# Check if range_alloc_block_size can be accessed with and without @@ sign #
###################################################################################
SET range_alloc_block_size = 1;
SELECT @@range_alloc_block_size;
--Error ER_UNKNOWN_TABLE
SELECT local.range_alloc_block_size;
--Error ER_UNKNOWN_TABLE
SELECT session.range_alloc_block_size;
--Error ER_BAD_FIELD_ERROR
SELECT range_alloc_block_size = @@session.range_alloc_block_size;
####################################
# Restore initial value #
####################################
SET @@global.range_alloc_block_size = @start_global_value;
SELECT @@global.range_alloc_block_size;
SET @@session.range_alloc_block_size = @start_session_value;
SELECT @@session.range_alloc_block_size;
#############################################################
# END OF range_alloc_block_size TESTS #
#############################################################

View file

@ -41,18 +41,17 @@ let $wait_condition=
# check that table t1 contains something
--echo "Checking event data on the master"
--enable_info
--replace_column 3 TIMESTAMP
SELECT * FROM t1 ORDER BY id;
--disable_info
let $events_done=`SELECT count(*) FROM t1 id`;
--disable_query_log
eval SELECT $events_done > 0 as ONE;
--enable_query_log
sync_slave_with_master;
--echo "Checking event data on the slave"
--enable_info
--replace_column 3 TIMESTAMP
SELECT * FROM t1 ORDER BY id;
--disable_info
--disable_query_log
eval SELECT count(*) - $events_done as ZERO FROM t1 id;
--enable_query_log
--echo "Checking event is inactive on slave"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce';

View file

@ -0,0 +1,171 @@
############## mysql-test\t\rpl_recovery_rank_basic.test #######################
# #
# Variable Name: rpl_recovery_rank #
# Scope: GLOBAL & SESSION #
# Access Type: Dynamic #
# Data Type: Numeric #
# Default Value: 1 #
# Range: 1 - 65536 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Rizwan Maredia #
# #
# Description: Test Cases of Dynamic System Variable rpl_recovery_rank #
# that checks the behavior of this variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
################################################################################
--source include/load_sysvars.inc
###################################################################
# START OF rpl_recovery_rank TESTS #
###################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.rpl_recovery_rank;
SELECT @start_global_value;
--echo '#--------------------FN_DYNVARS_142_01-------------------------#'
###################################################################
# Check the DEFAULT value of rpl_recovery_rank #
###################################################################
SET @@global.rpl_recovery_rank = 500000;
SET @@global.rpl_recovery_rank = DEFAULT;
SELECT @@global.rpl_recovery_rank;
--echo '#--------------------FN_DYNVARS_142_02-------------------------#'
##################################################################################
# Change the value of rpl_recovery_rank to a valid value for GLOBAL Scope #
##################################################################################
SET @@global.rpl_recovery_rank = 0;
SELECT @@global.rpl_recovery_rank;
SET @@global.rpl_recovery_rank = 1024;
SELECT @@global.rpl_recovery_rank;
SET @@global.rpl_recovery_rank = 123456789;
SELECT @@global.rpl_recovery_rank;
SET @@global.rpl_recovery_rank = 2147483648*2;
SELECT @@global.rpl_recovery_rank;
SET @@global.rpl_recovery_rank = 2147483648*1024;
SELECT @@global.rpl_recovery_rank;
SELECT @@global.rpl_recovery_rank;
SET @@global.rpl_recovery_rank = 2147483648*2147483648;
SELECT @@global.rpl_recovery_rank;
--echo '#--------------------FN_DYNVARS_142_03-------------------------#'
#################################################################################
# Check if variable can be access with session scope #
#################################################################################
--Error ER_GLOBAL_VARIABLE
SET @@rpl_recovery_rank = 2;
--Error ER_GLOBAL_VARIABLE
SET @@session.rpl_recovery_rank = 3;
--Error ER_GLOBAL_VARIABLE
SET @@local.rpl_recovery_rank = 4;
--echo '#------------------FN_DYNVARS_142_04-----------------------#'
####################################################################
# Change the value of rpl_recovery_rank to an invalid value #
####################################################################
SET @@global.rpl_recovery_rank = -1;
SELECT @@global.rpl_recovery_rank;
SET @@global.rpl_recovery_rank = -2147483648;
SELECT @@global.rpl_recovery_rank;
SET @@global.rpl_recovery_rank = -2147483649;
SELECT @@global.rpl_recovery_rank;
--Error ER_PARSE_ERROR
SET @@global.rpl_recovery_rank = 65530.34.;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.rpl_recovery_rank = 2147483649.56;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.rpl_recovery_rank = 1G;
--echo '#------------------FN_DYNVARS_142_05-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SET @@global.rpl_recovery_rank = 3000;
SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='rpl_recovery_rank';
--echo '#------------------FN_DYNVARS_142_06-----------------------#'
###########################################################################
# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES #
###########################################################################
SELECT count(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='rpl_recovery_rank';
--echo '#------------------FN_DYNVARS_142_07-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.rpl_recovery_rank = TRUE;
SELECT @@global.rpl_recovery_rank;
SET @@global.rpl_recovery_rank = FALSE;
SELECT @@global.rpl_recovery_rank;
--echo '#---------------------FN_DYNVARS_001_08----------------------#'
#################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
#################################################################################
SET @@global.rpl_recovery_rank = 512;
SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank;
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
##################################################################################
# Check if rpl_recovery_rank can be accessed without @@ sign and scope #
##################################################################################
--Error ER_GLOBAL_VARIABLE
SET rpl_recovery_rank = 2048;
--Error ER_BAD_FIELD_ERROR
SELECT rpl_recovery_rank;
SELECT @@rpl_recovery_rank;
#verifying another another syntax for setting value
SET global rpl_recovery_rank = 64;
####################################
# Restore initial value #
####################################
SET @@global.rpl_recovery_rank = @start_global_value;
SELECT @@global.rpl_recovery_rank;
########################################################
# END OF rpl_recovery_rank TESTS #
########################################################

View file

@ -0,0 +1,190 @@
############## mysql-test\t\server_id_basic.test ################
# #
# Variable Name: server_id #
# Scope: GLOBAL & SESSION #
# Access Type: Dynamic #
# Data Type: Numeric #
# Default Value: 1 #
# Range: 1 - 65536 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Rizwan Maredia #
# #
# Description: Test Cases of Dynamic System Variable server_id #
# that checks the behavior of this variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
################################################################################
--source include/load_sysvars.inc
###################################################################
# START OF server_id TESTS #
###################################################################
#############################################################
# Save initial value #
#############################################################
let $save_general_log= `SELECT @@global.general_log`;
SET @@global.general_log= 0;
SET @start_global_value = @@global.server_id;
SELECT @start_global_value;
--echo '#--------------------FN_DYNVARS_144_01-------------------------#'
###################################################################
# Display the DEFAULT value of server_id #
###################################################################
SET @@global.server_id = 500000;
SET @@global.server_id = DEFAULT;
SELECT @@global.server_id;
--echo '#--------------------FN_DYNVARS_144_02-------------------------#'
###################################################################
# Check the DEFAULT value of server_id #
###################################################################
SET @@global.server_id = DEFAULT;
SELECT @@global.server_id = 0;
--echo '#--------------------FN_DYNVARS_144_03-------------------------#'
##################################################################################
# Change the value of server_id to a valid value for GLOBAL Scope #
##################################################################################
SET @@global.server_id = 0;
SELECT @@global.server_id;
SET @@global.server_id = 1;
SELECT @@global.server_id;
SET @@global.server_id = 15;
SELECT @@global.server_id;
SET @@global.server_id = 1024;
SELECT @@global.server_id;
SET @@global.server_id = 123456789;
SELECT @@global.server_id;
SET @@global.server_id = 2147483648;
SELECT @@global.server_id;
SET @@global.server_id = 2147483648*2-1;
SELECT @@global.server_id;
--echo '#--------------------FN_DYNVARS_144_04-------------------------#'
#################################################################################
# Check if variable can be access with session scope #
#################################################################################
--Error ER_GLOBAL_VARIABLE
SET @@server_id = 2;
--Error ER_GLOBAL_VARIABLE
SET @@session.server_id = 3;
--Error ER_GLOBAL_VARIABLE
SET @@local.server_id = 4;
--echo '#------------------FN_DYNVARS_144_05-----------------------#'
####################################################################
# Change the value of server_id to an invalid value #
####################################################################
SET @@global.server_id = -1;
SELECT @@global.server_id;
SET @@global.server_id = -2147483648;
SELECT @@global.server_id;
SET @@global.server_id = 2147483649*2;
SELECT @@global.server_id;
--Error ER_PARSE_ERROR
SET @@global.server_id = 65530.34.;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.server_id = '125';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.server_id = 7483649.56;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.server_id = 1G;
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#------------------FN_DYNVARS_144_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SET @@global.server_id = 3000;
SELECT @@global.server_id = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='server_id';
--echo '#------------------FN_DYNVARS_144_07-----------------------#'
###########################################################################
# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES #
###########################################################################
SELECT count(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='server_id';
--echo '#------------------FN_DYNVARS_144_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.server_id = TRUE;
SELECT @@global.server_id;
SET @@global.server_id = FALSE;
SELECT @@global.server_id;
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
#################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
#################################################################################
SET @@global.server_id = 512;
SELECT @@server_id = @@global.server_id;
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
##################################################################################
# Check if server_id can be accessed without @@ sign and scope #
##################################################################################
--Error ER_GLOBAL_VARIABLE
SET server_id = 2048;
--Error ER_BAD_FIELD_ERROR
SELECT server_id;
SELECT @@server_id;
#verifying another another syntax for setting value
SET global server_id = 99;
####################################
# Restore initial value #
####################################
SET @@global.server_id = @start_global_value;
SELECT @@global.server_id;
eval SET @@global.general_log= $save_general_log;
########################################################
# END OF server_id TESTS #
########################################################

View file

@ -0,0 +1,188 @@
############# mysql-test\t\slave_transaction_retries_basic.test ###############
# #
# Variable Name: slave_transaction_retries #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 10 #
# Range: #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Rizwan #
# #
# Description: Test Cases of Dynamic System Variable slave_transaction_retries#
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
###################################################################
# START OF slave_transaction_retries TESTS #
###################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.slave_transaction_retries;
SELECT @start_global_value;
--echo '#--------------------FN_DYNVARS_149_01-------------------------#'
###################################################################
# Display the DEFAULT value of slave_transaction_retries #
###################################################################
SET @@global.slave_transaction_retries = 50;
SET @@global.slave_transaction_retries = DEFAULT;
SELECT @@global.slave_transaction_retries;
--echo '#--------------------FN_DYNVARS_149_02-------------------------#'
###################################################################
# Check the DEFAULT value of slave_transaction_retries #
###################################################################
SET @@global.slave_transaction_retries = DEFAULT;
SELECT @@global.slave_transaction_retries = 10;
--echo '#--------------------FN_DYNVARS_149_03-------------------------#'
################################################################################
# Change the value of slave_transaction_retries to a valid value for
# GLOBAL Scope
################################################################################
SET @@global.slave_transaction_retries = 0;
SELECT @@global.slave_transaction_retries;
SET @@global.slave_transaction_retries = 1;
SELECT @@global.slave_transaction_retries;
SET @@global.slave_transaction_retries = 15;
SELECT @@global.slave_transaction_retries;
SET @@global.slave_transaction_retries = 1024;
SELECT @@global.slave_transaction_retries;
SET @@global.slave_transaction_retries = 2147483648;
SELECT @@global.slave_transaction_retries;
SET @@global.slave_transaction_retries = 2147483648*2-1;
SELECT @@global.slave_transaction_retries;
SET @@global.slave_transaction_retries = 2147483649*2;
SELECT @@global.slave_transaction_retries;
SET @@global.slave_transaction_retries = 4294967295;
SELECT @@global.slave_transaction_retries;
--echo '#--------------------FN_DYNVARS_149_04-------------------------#'
###############################################################################
# Check if variable can be access with session scope #
###############################################################################
--Error ER_GLOBAL_VARIABLE
SET @@slave_transaction_retries = 2;
--Error ER_GLOBAL_VARIABLE
SET @@session.slave_transaction_retries = 3;
--Error ER_GLOBAL_VARIABLE
SET @@local.slave_transaction_retries = 4;
--echo '#------------------FN_DYNVARS_149_05-----------------------#'
####################################################################
# Change the value of slave_transaction_retries to an invalid value#
####################################################################
SET @@global.slave_transaction_retries = -1;
SELECT @@global.slave_transaction_retries;
SET @@global.slave_transaction_retries = 2147483649*2147483649;
SELECT @@global.slave_transaction_retries;
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--Error ER_PARSE_ERROR
SET @@global.slave_transaction_retries = 65530.34.;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.slave_transaction_retries = '100';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.slave_transaction_retries = 7483649.56;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.slave_transaction_retries = ON;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.slave_transaction_retries = OFF;
--echo '#------------------FN_DYNVARS_149_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SET @@global.slave_transaction_retries = 3000;
SELECT @@global.slave_transaction_retries = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='slave_transaction_retries';
--echo '#------------------FN_DYNVARS_149_07-----------------------#'
###########################################################################
# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES #
###########################################################################
SELECT count(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='slave_transaction_retries';
--echo '#------------------FN_DYNVARS_149_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.slave_transaction_retries = TRUE;
SELECT @@global.slave_transaction_retries;
SET @@global.slave_transaction_retries = FALSE;
SELECT @@global.slave_transaction_retries;
--echo '#---------------------FN_DYNVARS_149_09----------------------#'
###############################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
###############################################################################
SET @@global.slave_transaction_retries = 60*60;
SELECT @@slave_transaction_retries = @@global.slave_transaction_retries;
--echo '#---------------------FN_DYNVARS_149_10----------------------#'
###############################################################################
# Check if slave_transaction_retries can be accessed without @@ sign
# and scope
###############################################################################
--Error ER_GLOBAL_VARIABLE
SET slave_transaction_retries = 2048;
--Error ER_BAD_FIELD_ERROR
SELECT slave_transaction_retries;
SELECT @@slave_transaction_retries;
#verifying another another syntax for setting value
SET global slave_transaction_retries = 99;
####################################
# Restore initial value #
####################################
SET @@global.slave_transaction_retries = @start_global_value;
SELECT @@global.slave_transaction_retries;
########################################################
# END OF slave_transaction_retries TESTS #
########################################################

View file

@ -0,0 +1,213 @@
############## mysql-test\t\sort_buffer_size_basic.test #######################
# #
# Variable Name: sort_buffer_size #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 2097144 #
# Range:max value:4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable sort_buffer_size #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
########################################################################
######################################################################
# START OF sort_buffer_size TESTS #
######################################################################
#############################################################
# Save initial value #
#############################################################
# due to difference when running on Windows (bug filed)
--source include/not_windows.inc
SET @start_global_value = @@global.sort_buffer_size;
SELECT @start_global_value;
SET @start_session_value = @@session.sort_buffer_size;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_151_01-------------------------#'
######################################################################
# Display the DEFAULT value of sort_buffer_size #
######################################################################
SET @@global.sort_buffer_size = 1000;
SET @@global.sort_buffer_size = DEFAULT;
SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
SET @@session.sort_buffer_size = 2000;
SET @@session.sort_buffer_size = DEFAULT;
SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
--echo '#--------------------FN_DYNVARS_151_02-------------------------#'
######################################################################
# Check the DEFAULT value of sort_buffer_size #
######################################################################
SET @@global.sort_buffer_size = DEFAULT;
SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
SET @@session.sort_buffer_size = DEFAULT;
SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
--echo '#--------------------FN_DYNVARS_151_03-------------------------#'
################################################################################
# Change the value of sort_buffer_size to a valid value for GLOBAL Scope #
################################################################################
SET @@global.sort_buffer_size = 32776;
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
SET @@global.sort_buffer_size = 32777;
SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
SET @@global.sort_buffer_size = 4294967295;
SELECT @@global.sort_buffer_size;
SET @@global.sort_buffer_size = 4294967294;
SELECT @@global.sort_buffer_size;
--echo 'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
--echo '#--------------------FN_DYNVARS_151_04-------------------------#'
###################################################################################
# Change the value of sort_buffer_size to a valid value for SESSION Scope #
###################################################################################
SET @@session.sort_buffer_size = 32776;
SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
SET @@session.sort_buffer_size = 32777;
SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
SET @@session.sort_buffer_size = 4294967295;
SELECT @@session.sort_buffer_size;
SET @@session.sort_buffer_size = 4294967294;
SELECT @@session.sort_buffer_size;
--echo '#------------------FN_DYNVARS_151_05-----------------------#'
##################################################################
# Change the value of sort_buffer_size to an invalid value #
##################################################################
SET @@global.sort_buffer_size = 32775;
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
SET @@global.sort_buffer_size = -1024;
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
SET @@global.sort_buffer_size = 4294967296;
SELECT @@global.sort_buffer_size;
--Error ER_PARSE_ERROR
SET @@global.sort_buffer_size = 65530.34.;
SELECT @@global.sort_buffer_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.sort_buffer_size = test;
SELECT @@global.sort_buffer_size;
SET @@session.sort_buffer_size = 32775;
SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
SET @@session.sort_buffer_size = -2;
SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
--Error ER_PARSE_ERROR
SET @@session.sort_buffer_size = 65530.34.;
SET @@session.sort_buffer_size = 4294967296;
SELECT @@session.sort_buffer_size;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.sort_buffer_size = test;
SELECT @@session.sort_buffer_size;
--echo '#------------------FN_DYNVARS_151_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
--echo '#------------------FN_DYNVARS_151_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
--echo '#------------------FN_DYNVARS_151_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.sort_buffer_size = TRUE;
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
SET @@global.sort_buffer_size = FALSE;
SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
echo 'Bug: Errors should be displayed on assigning TRUE/FALSE to variable';
--echo '#---------------------FN_DYNVARS_151_09----------------------#'
####################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
####################################################################################
SET @@global.sort_buffer_size = 9000;
SELECT @@sort_buffer_size = @@global.sort_buffer_size;
--echo '#---------------------FN_DYNVARS_151_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@sort_buffer_size = 9000;
SELECT @@sort_buffer_size = @@local.sort_buffer_size;
SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
--echo '#---------------------FN_DYNVARS_151_11----------------------#'
###################################################################################
# Check if sort_buffer_size can be accessed with and without @@ sign #
###################################################################################
SET sort_buffer_size = 9100;
SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
SELECT @@sort_buffer_size;
--Error ER_UNKNOWN_TABLE
SELECT local.sort_buffer_size;
--Error ER_UNKNOWN_TABLE
SELECT session.sort_buffer_size;
--Error ER_BAD_FIELD_ERROR
SELECT sort_buffer_size = @@session.sort_buffer_size;
####################################
# Restore initial value #
####################################
SET @@global.sort_buffer_size = @start_global_value;
SELECT @@global.sort_buffer_size;
SET @@session.sort_buffer_size = @start_session_value;
SELECT @@session.sort_buffer_size;
#############################################################
# END OF sort_buffer_size TESTS #
#############################################################

View file

@ -0,0 +1,156 @@
#################### mysql-test\t\sync_binlog_basic.test ######################
# #
# Variable Name: sync_binlog #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 0 #
# Range: 0 - 4294967295 #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Salman Rawala #
# #
# Description: Test Cases of Dynamic System Variable sync_binlog #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
##################################################################
# START OF sync_binlog TESTS #
##################################################################
##################################################################
# Saving initial value of sync_binlog in a temporary variable #
##################################################################
SET @start_value = @@global.sync_binlog;
SELECT @start_value;
--echo '#--------------------FN_DYNVARS_168_01------------------------#'
##################################################################
# Display the DEFAULT value of sync_binlog #
##################################################################
SET @@global.sync_binlog = 99;
SET @@global.sync_binlog = DEFAULT;
SELECT @@global.sync_binlog;
--echo '#---------------------FN_DYNVARS_168_02-------------------------#'
###############################################
# Verify default value of variable #
###############################################
SET @@global.sync_binlog = @start_value;
SELECT @@global.sync_binlog = 0;
--echo '#--------------------FN_DYNVARS_168_03------------------------#'
###################################################################
# Change the value of sync_binlog to a valid value #
###################################################################
SET @@global.sync_binlog = 0;
SELECT @@global.sync_binlog;
SET @@global.sync_binlog = 1;
SELECT @@global.sync_binlog;
SET @@global.sync_binlog = 4294967295;
SELECT @@global.sync_binlog;
SET @@global.sync_binlog = 4294967294;
SELECT @@global.sync_binlog;
SET @@global.sync_binlog = 65536;
SELECT @@global.sync_binlog;
--echo '#--------------------FN_DYNVARS_168_04-------------------------#'
######################################################################
# Change the value of sync_binlog to invalid value #
######################################################################
SET @@global.sync_binlog = -1;
SELECT @@global.sync_binlog;
SET @@global.sync_binlog = 4294967296;
SELECT @@global.sync_binlog;
SET @@global.sync_binlog = 10240022115;
SELECT @@global.sync_binlog;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.sync_binlog = 10000.01;
SELECT @@global.sync_binlog;
SET @@global.sync_binlog = -1024;
SELECT @@global.sync_binlog;
SET @@global.sync_binlog = 42949672950;
SELECT @@global.sync_binlog;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.sync_binlog = ON;
SELECT @@global.sync_binlog;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.sync_binlog = 'test';
SELECT @@global.sync_binlog;
--echo '#-------------------FN_DYNVARS_168_05----------------------------#'
###########################################################################
# Test if accessing session sync_binlog gives error #
###########################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.sync_binlog = 0;
SELECT @@sync_binlog;
--echo '#----------------------FN_DYNVARS_168_06------------------------#'
##############################################################################
# Check if the value in GLOBAL & SESSION Tables matches values in variable #
##############################################################################
SELECT @@global.sync_binlog = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='sync_binlog';
--echo '#---------------------FN_DYNVARS_168_07----------------------#'
##########################################################################
# Check if sync_binlog can be accessed with and without @@ sign #
##########################################################################
--Error ER_GLOBAL_VARIABLE
SET sync_binlog = 1;
SELECT @@sync_binlog;
--Error ER_PARSE_ERROR
SET local.sync_binlog = 1;
--Error ER_UNKNOWN_TABLE
SELECT local.sync_binlog;
--Error ER_PARSE_ERROR
SET global.sync_binlog = 1;
--Error ER_UNKNOWN_TABLE
SELECT global.sync_binlog;
--Error ER_BAD_FIELD_ERROR
SELECT sync_binlog = @@session.sync_binlog;
##############################
# Restore initial value #
##############################
SET @@global.sync_binlog = @start_value;
SELECT @@global.sync_binlog;
########################################################################
# END OF sync_binlog TESTS #
########################################################################

View file

@ -0,0 +1,162 @@
################## mysql-test\t\timestamp_basic.test ##########################
# #
# Variable Name: timestamp #
# Scope: SESSION #
# Access Type: Dynamic #
# Data Type: string #
# Default Value: #
# Range: #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Rizwan #
# #
# Description: Test Cases of Dynamic System Variable timestamp #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
#######################################################################
# START OF timestamp TESTS #
#######################################################################
#######################################################################
# Saving initial value of timestamp in a temporary variable #
#######################################################################
SET @session_start_value = @@session.timestamp;
--echo '#--------------------FN_DYNVARS_001_01------------------------#'
########################################################################
# Display the DEFAULT value of timestamp #
########################################################################
SET @@timestamp = DEFAULT;
#SELECT @@timestamp;
--echo 'timestamp does not have any DEFAULT value'
--echo '#---------------------FN_DYNVARS_001_02-------------------------#'
##############################################################
# see if accessable using global scope #
##############################################################
--Error ER_LOCAL_VARIABLE
SET @@global.timestamp = "1000";
--echo '#--------------------FN_DYNVARS_001_03------------------------#'
########################################################################
# Change the value of timestamp to a valid value #
########################################################################
SET @@timestamp = 0;
#SELECT @@timestamp;
--echo 'Setting 0 resets timestamp to session default timestamp'
SET @@timestamp = 123456789123456;
SELECT @@timestamp;
SET @@timestamp = 60*60*60*60*365;
SELECT @@timestamp;
SET @@timestamp = -1000000000;
SELECT @@timestamp;
SET @temp_ts = @@timestamp - @@timestamp;
SELECT @temp_ts;
--echo '#--------------------FN_DYNVARS_001_04-------------------------#'
###########################################################################
# Change the value of timestamp to invalid value #
###########################################################################
# for session scope
--Error ER_WRONG_TYPE_FOR_VAR
SET @@timestamp = "100";
--echo 'Bug# 34836: Documentation says its a string variable but infact its numeric'
--Error ER_WRONG_TYPE_FOR_VAR
SET @@timestamp = " ";
--Error ER_WRONG_TYPE_FOR_VAR
SET @@timestamp = 1.1;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@timestamp = 9999999999999999999999;
--echo '#----------------------FN_DYNVARS_001_06------------------------#'
#########################################################################
# Check if the value in SESSION Table matches value in variable #
#########################################################################
SELECT @@timestamp = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='timestamp';
--echo '#---------------------FN_DYNVARS_001_08-------------------------#'
#############################################################################
# Check if ON, OFF, TRUE and FALSE values can be used on variable #
#############################################################################
--Error ER_WRONG_TYPE_FOR_VAR
SET @@timestamp = OFF;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@timestamp = ON;
SET @@timestamp = TRUE;
SELECT @@timestamp;
SET @@timestamp = FALSE;
#SELECT @@timestamp;
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
#############################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points
# to same session variable
#############################################################################
SET @@timestamp = 123456;
SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
SET @@timestamp = 654321;
SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
#####################################################################
# Check if timestamp can be accessed with and without @@ sign #
#####################################################################
SET timestamp = 1;
SELECT @@timestamp;
--Error ER_UNKNOWN_TABLE
SELECT local.timestamp;
--Error ER_UNKNOWN_TABLE
SELECT session.timestamp;
--Error ER_BAD_FIELD_ERROR
SELECT timestamp = @@session.timestamp;
##############################
# Restore initial value #
##############################
SET @@timestamp = @session_start_value;
#######################################################################
# END OF timestamp TESTS #
#######################################################################

View file

@ -0,0 +1,233 @@
############## mysql-test\t\tmp_table_size_basic.test #########################
# #
# Variable Name: tmp_table_size #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 33554432 #
# Range: 1024-4294967295 #
# #
# #
# Creation Date: 2008-02-13 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable tmp_table_size #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html#option_mysqld_tmp_table_size #
# #
###############################################################################
--source include/load_sysvars.inc
##############################################################
# START OF tmp_table_size TESTS #
##############################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.tmp_table_size;
SELECT @start_global_value;
SET @start_session_value = @@session.tmp_table_size;
SELECT @start_session_value;
--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
##############################################################
# Display the DEFAULT value of tmp_table_size #
##############################################################
SET @@global.tmp_table_size = 100;
SET @@global.tmp_table_size = DEFAULT;
SELECT @@global.tmp_table_size;
--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
SET @@session.tmp_table_size = 200;
SET @@session.tmp_table_size = DEFAULT;
SELECT @@session.tmp_table_size;
--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
########################################################################
# Check the DEFAULT value of tmp_table_size #
########################################################################
SET @@global.tmp_table_size = DEFAULT;
SELECT @@global.tmp_table_size = 33554432;
SET @@session.tmp_table_size = DEFAULT;
SELECT @@session.tmp_table_size = 33554432;
--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
########################################################################
# Change the value of tmp_table_size to a valid value for GLOBAL Scope #
########################################################################
SET @@global.tmp_table_size = 1024;
SELECT @@global.tmp_table_size;
SET @@global.tmp_table_size = 60020;
SELECT @@global.tmp_table_size;
SET @@global.tmp_table_size = 4294967295;
SELECT @@global.tmp_table_size;
--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
#########################################################################
# Change the value of tmp_table_size to a valid value for SESSION Scope #
#########################################################################
SET @@session.tmp_table_size = 1024;
SELECT @@session.tmp_table_size;
SET @@session.tmp_table_size =4294967295;
SELECT @@session.tmp_table_size;
SET @@session.tmp_table_size = 65535;
SELECT @@session.tmp_table_size;
--echo '#------------------FN_DYNVARS_005_05-----------------------#'
##########################################################
# Change the value of tmp_table_size to an invalid value #
##########################################################
SET @@global.tmp_table_size = 0;
SELECT @@global.tmp_table_size;
SET @@global.tmp_table_size = -1024;
SELECT @@global.tmp_table_size;
SET @@global.tmp_table_size = 1000;
SELECT @@global.tmp_table_size;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size = ON;
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size = OFF;
SET @@global.tmp_table_size = True;
SELECT @@global.tmp_table_size;
SET @@global.tmp_table_size = False;
SELECT @@global.tmp_table_size;
--echo 'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size = 65530.34;
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tmp_table_size ="Test";
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@session.tmp_table_size = ON;
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@session.tmp_table_size = OFF;
SET @@session.tmp_table_size = True;
SELECT @@session.tmp_table_size;
SET @@session.tmp_table_size = False;
SELECT @@session.tmp_table_size;
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@session.tmp_table_size = "Test";
SET @@session.tmp_table_size = 12345678901;
SELECT @@session.tmp_table_size;
--echo '#------------------FN_DYNVARS_005_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.tmp_table_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
--echo '#------------------FN_DYNVARS_005_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.tmp_table_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='tmp_table_size';
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
########################################################################
# Check if global and session variables are independent of each other #
########################################################################
SET @@global.tmp_table_size = 1024;
SET @@tmp_table_size = 4294967295;
SELECT @@tmp_table_size = @@global.tmp_table_size;
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
##################################################################
# Check if accessing variable with SESSION,LOCAL and without #
# SCOPE points to same session variable #
##################################################################
SET @@tmp_table_size = 100;
SELECT @@tmp_table_size = @@local.tmp_table_size;
SELECT @@local.tmp_table_size = @@session.tmp_table_size;
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
#########################################################################
# Check if tmp_table_size can be accessed with and without @@ sign #
#########################################################################
SET tmp_table_size = 1027;
SELECT @@tmp_table_size;
--Error ER_UNKNOWN_TABLE
SELECT local.tmp_table_size;
--Error ER_UNKNOWN_TABLE
SELECT global.tmp_table_size;
--Error ER_BAD_FIELD_ERROR
SELECT tmp_table_size = @@session.tmp_table_size;
####################################
# Restore initial value #
####################################
SET @@global.tmp_table_size = @start_global_value;
SELECT @@global.tmp_table_size;
SET @@session.tmp_table_size = @start_session_value;
SELECT @@session.tmp_table_size;
###################################################
# END OF tmp_table_size TESTS #
###################################################

View file

@ -0,0 +1,240 @@
############## mysql-test\t\transaction_alloc_block_size_basic.test ###########
# #
# Variable Name: transaction_alloc_block_size #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 8192 #
# Range: 1024-4294967295 #
# #
# #
# Creation Date: 2008-02-14 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable #
# transaction_alloc_block_size #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
########################################################################
# START OF transaction_alloc_block_size TESTS #
########################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.transaction_alloc_block_size;
SELECT @start_global_value;
SET @start_session_value = @@session.transaction_alloc_block_size;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
########################################################################
# Display the DEFAULT value of transaction_alloc_block_size #
########################################################################
SET @@global.transaction_alloc_block_size = 100;
SET @@global.transaction_alloc_block_size = DEFAULT;
SELECT @@global.transaction_alloc_block_size;
SET @@session.transaction_alloc_block_size = 200;
SET @@session.transaction_alloc_block_size = DEFAULT;
SELECT @@session.transaction_alloc_block_size;
--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
########################################################################
# Check the DEFAULT value of transaction_alloc_block_size #
########################################################################
SET @@global.transaction_alloc_block_size = DEFAULT;
SELECT @@global.transaction_alloc_block_size = 8192;
SET @@session.transaction_alloc_block_size = DEFAULT;
SELECT @@session.transaction_alloc_block_size = 8192;
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
##################################################################
# Change the value of variable to a valid value for GLOBAL Scope #
##################################################################
SET @@global.transaction_alloc_block_size = 1024;
SELECT @@global.transaction_alloc_block_size;
SET @@global.transaction_alloc_block_size = 60020;
SELECT @@global.transaction_alloc_block_size;
SET @@global.transaction_alloc_block_size = 4294967295;
SELECT @@global.transaction_alloc_block_size;
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
###################################################################
# Change the value of variable to a valid value for SESSION Scope #
###################################################################
SET @@session.transaction_alloc_block_size = 1024;
SELECT @@session.transaction_alloc_block_size;
SET @@session.transaction_alloc_block_size =4294967295;
SELECT @@session.transaction_alloc_block_size;
SET @@session.transaction_alloc_block_size = 65535;
SELECT @@session.transaction_alloc_block_size;
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
--echo '#------------------FN_DYNVARS_005_05-----------------------#'
########################################################################
# Change the value of transaction_alloc_block_size to an invalid value #
########################################################################
SET @@global.transaction_alloc_block_size = 0;
SELECT @@global.transaction_alloc_block_size;
SET @@global.transaction_alloc_block_size = -1024;
SELECT @@global.transaction_alloc_block_size;
SET @@global.transaction_alloc_block_size = 123456789201;
SELECT @@global.transaction_alloc_block_size;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@global.transaction_alloc_block_size = ON;
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@global.transaction_alloc_block_size = OFF;
SET @@global.transaction_alloc_block_size = True;
SELECT @@global.transaction_alloc_block_size;
SET @@global.transaction_alloc_block_size = False;
SELECT @@global.transaction_alloc_block_size;
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@global.transaction_alloc_block_size = 65530.34;
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@global.transaction_alloc_block_size ="Test";
SET @@global.transaction_alloc_block_size = 1000;
SELECT @@global.transaction_alloc_block_size;
SET @@session.transaction_alloc_block_size = 12345678901;
SELECT @@session.transaction_alloc_block_size;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@session.transaction_alloc_block_size = ON;
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@session.transaction_alloc_block_size = OFF;
SET @@session.transaction_alloc_block_size = True;
SELECT @@session.transaction_alloc_block_size;
SET @@session.transaction_alloc_block_size = False;
SELECT @@session.transaction_alloc_block_size;
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@session.transaction_alloc_block_size = "Test";
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.transaction_alloc_block_size = 'test';
--echo '#------------------FN_DYNVARS_005_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='transaction_alloc_block_size';
--echo '#------------------FN_DYNVARS_005_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='transaction_alloc_block_size';
--echo '#---------------------FN_DYNVARS_001_08----------------------#'
###########################################################################
# Check if global and session variable are independent of each other #
###########################################################################
SET @@transaction_alloc_block_size = 1024;
SET @@global.transaction_alloc_block_size = 4294967295;
SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size;
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
########################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE #
# points to same session variable #
########################################################################
SET @@transaction_alloc_block_size = 100;
SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size;
SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size;
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
################################################################
# Check if variable can be accessed with and without @@ sign #
################################################################
SET transaction_alloc_block_size = 1027;
SELECT @@transaction_alloc_block_size;
--Error ER_UNKNOWN_TABLE
SELECT local.transaction_alloc_block_size;
--Error ER_UNKNOWN_TABLE
SELECT session.transaction_alloc_block_size;
--Error ER_BAD_FIELD_ERROR
SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size;
####################################
# Restore initial value #
####################################
SET @@global.transaction_alloc_block_size = @start_global_value;
SELECT @@global.transaction_alloc_block_size;
SET @@session.tmp_table_size = @start_session_value;
SELECT @@session.transaction_alloc_block_size;
#############################################################
# END OF transaction_alloc_block_size TESTS #
#############################################################

View file

@ -0,0 +1,229 @@
############## mysql-test\t\transaction_prealloc_size_basic.test ##############
# #
# Variable Name: transaction_prealloc_size #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 4096 #
# Range: #
# #
# #
# Creation Date: 2008-02-14 #
# Author: Sharique Abdullah #
# #
# Description: Test Cases of Dynamic System Variable transaction_prealloc_size#
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html#option_mysqld_transaction_prealloc_size #
# #
###############################################################################
--source include/load_sysvars.inc
########################################################################
# START OF transaction_prealloc_size TESTS #
########################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.transaction_prealloc_size;
SELECT @start_global_value;
SET @start_session_value = @@session.transaction_prealloc_size;
SELECT @start_session_value;
--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
########################################################################
# Display the DEFAULT value of transaction_prealloc_size #
########################################################################
SET @@global.transaction_prealloc_size = 100;
SET @@global.transaction_prealloc_size = DEFAULT;
SELECT @@global.transaction_prealloc_size;
SET @@session.transaction_prealloc_size = 200;
SET @@session.transaction_prealloc_size = DEFAULT;
SELECT @@session.transaction_prealloc_size;
--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
########################################################################
# Check the DEFAULT value of transaction_prealloc_size #
########################################################################
SET @@global.transaction_prealloc_size = DEFAULT;
SELECT @@global.transaction_prealloc_size = 4096;
SET @@session.transaction_prealloc_size = DEFAULT;
SELECT @@session.transaction_prealloc_size = 4096;
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
##################################################################
# Change the value of variable to a valid value for GLOBAL Scope #
##################################################################
SET @@global.transaction_prealloc_size = 1024;
SELECT @@global.transaction_prealloc_size;
SET @@global.transaction_prealloc_size = 60020;
SELECT @@global.transaction_prealloc_size;
SET @@global.transaction_prealloc_size = 4294966272;
SELECT @@global.transaction_prealloc_size;
--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
###################################################################
# Change the value of variable to a valid value for SESSION Scope #
###################################################################
SET @@session.transaction_prealloc_size = 1024;
SELECT @@session.transaction_prealloc_size;
SET @@session.transaction_prealloc_size =4294966272;
SELECT @@session.transaction_prealloc_size;
SET @@session.transaction_prealloc_size = 65535;
SELECT @@session.transaction_prealloc_size;
--echo '#------------------FN_DYNVARS_005_05-----------------------#'
#####################################################################
# Change the value of transaction_prealloc_size to an invalid value #
#####################################################################
SET @@global.transaction_prealloc_size = 0;
SELECT @@global.transaction_prealloc_size;
SET @@global.transaction_prealloc_size = -1024;
SELECT @@global.transaction_prealloc_size;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@global.transaction_prealloc_size = ON;
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@global.transaction_prealloc_size = OFF;
SET @@global.transaction_prealloc_size = True;
SELECT @@global.transaction_prealloc_size;
SET @@global.transaction_prealloc_size = False;
SELECT @@global.transaction_prealloc_size;
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@global.transaction_prealloc_size = 65530.34;
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@global.transaction_prealloc_size ="Test";
SET @@global.transaction_prealloc_size = 1000;
SELECT @@global.transaction_prealloc_size;
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@session.transaction_prealloc_size = ON;
-- Error ER_WRONG_TYPE_FOR_VAR
SET @@session.transaction_prealloc_size = OFF;
SET @@session.transaction_prealloc_size = True;
SELECT @@session.transaction_prealloc_size;
SET @@session.transaction_prealloc_size = False;
SELECT @@session.transaction_prealloc_size;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.transaction_prealloc_size = "Test";
SET @@session.transaction_prealloc_size = 123456789031;
SELECT @@session.transaction_prealloc_size;
--echo '#------------------FN_DYNVARS_005_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='transaction_prealloc_size';
--echo '#------------------FN_DYNVARS_005_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='transaction_prealloc_size';
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
###########################################################################
# Check if global and session variable are independent of each other #
###########################################################################
SET @@global.transaction_prealloc_size = 1024;
SET @@global.transaction_prealloc_size = 10;
SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size;
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
########################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE #
# points to same session variable #
########################################################################
SET @@transaction_prealloc_size = 100;
SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size;
SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size;
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
###############################################################################
# Check if transaction_prealloc_size can be accessed with and without @@ sign #
###############################################################################
SET transaction_prealloc_size = 1027;
SELECT @@transaction_prealloc_size;
--Error ER_UNKNOWN_TABLE
SELECT local.transaction_prealloc_size;
--Error ER_UNKNOWN_TABLE
SELECT session.transaction_prealloc_size;
--Error ER_BAD_FIELD_ERROR
SELECT transaction_prealloc_size = @@session.transaction_prealloc_size;
####################################
# Restore initial value #
####################################
SET @@global.transaction_prealloc_size = @start_global_value;
SELECT @@global.transaction_prealloc_size;
SET @@session.transaction_prealloc_size = @start_session_value;
SELECT @@session.transaction_prealloc_size;
#############################################################
# END OF transaction_prealloc_size TESTS #
#############################################################

View file

@ -0,0 +1,31 @@
###################################################
#Author: Mats (based on file written by Jeb)
#Date: 2008-05-06
#Purpose: To wait for slave SQL thread to start
#Details:
# 1) Fill in and setup variables
# 2) loop through looking for both
# io and sql threads to start
# 3) If loops too long die.
####################################################
connection slave;
let $row_number= 1;
let $run= 1;
let $counter= 300;
while ($run)
{
let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
if (`SELECT '$sql_result' = 'Yes'`){
let $run= 0;
}
sleep 0.1;
if (!$counter){
--echo "Failed while waiting for slave SQL to start"
query_vertical SHOW SLAVE STATUS;
exit;
}
dec $counter;
}

View file

@ -0,0 +1,218 @@
############## mysql-test\t\wait_timeout_basic.test ###########################
# #
# Variable Name: wait_timeout #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: #
# Range: #
# #
# #
# Creation Date: 2008-02-07 #
# Author: Sharique Abdullah #
# #
# Description: Test Cases of Dynamic System Variable wait_timeout #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html#option_mysqld_wait_timeouts #
# #
###############################################################################
# Due to differnces between linux and windows in the results
--source include/not_windows.inc
--source include/load_sysvars.inc
############################################################
# START OF wait_timeout TESTS #
############################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.wait_timeout;
SET @start_session_value = @@session.wait_timeout;
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
############################################################
# Display the DEFAULT value of wait_timeout #
############################################################
SET @@global.wait_timeout = 100;
SET @@global.wait_timeout = DEFAULT;
SELECT @@global.wait_timeout;
SET @@session.wait_timeout = 200;
SET @@session.wait_timeout = DEFAULT;
SELECT @@session.wait_timeout;
--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
############################################################
# Check the DEFAULT value of wait_timeout #
############################################################
SET @@global.wait_timeout = DEFAULT;
SELECT @@global.wait_timeout = @default_wait_timeout;
SET @@session.wait_timeout = DEFAULT;
SELECT @@session.wait_timeout = @default_wait_timeout;
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
######################################################################
# Change the value of wait_timeout to a valid value for GLOBAL Scope #
######################################################################
#SET @@global.wait_timeout= @min_wait_timeout;
SET @@global.wait_timeout= 1;
SELECT @@global.wait_timeout;
SET @@global.wait_timeout = 60020;
SELECT @@global.wait_timeout;
#SET @@global.wait_timeout = @max_wait_timeout;
SET @@global.wait_timeout = 31536000;
SELECT @@global.wait_timeout = @max_wait_timeout;
--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
#######################################################################
# Change the value of wait_timeout to a valid value for SESSION Scope #
#######################################################################
#SET @@session.wait_timeout = @min_wait_timeout;
#SELECT @@session.wait_timeout;
SET @@session.wait_timeout =6000;
SELECT @@session.wait_timeout;
#SET @@session.wait_timeout = @max_wait_timeout;
#SELECT @@session.wait_timeout = @max_wait_timeout;
--echo '#------------------FN_DYNVARS_005_05-----------------------#'
########################################################
# Change the value of wait_timeout to an invalid value #
########################################################
SET @@global.wait_timeout = 0;
SET @@global.wait_timeout = -1024;
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.wait_timeout = ON;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.wait_timeout = OFF;
SET @@global.wait_timeout = True;
SELECT @@global.wait_timeout;
SET @@global.wait_timeout = False;
SELECT @@global.wait_timeout;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.wait_timeout = 65530.34;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.wait_timeout ="Test";
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.wait_timeout = ON;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.wait_timeout = OFF;
SET @@session.wait_timeout = True;
SELECT @@session.wait_timeout;
SET @@session.wait_timeout = False;
SELECT @@session.wait_timeout;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.wait_timeout = "Test";
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.wait_timeout = 'test';
SET @@session.wait_timeout = 123456789031;
SELECT @@session.wait_timeout = @max_wait_timeout;
--echo '#------------------FN_DYNVARS_005_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.wait_timeout = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wait_timeout';
--echo '#------------------FN_DYNVARS_005_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.wait_timeout = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='wait_timeout';
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
###########################################################################
# Check if global and session variable are independent of each other #
###########################################################################
SET @@global.wait_timeout = 30000;
SET @@global.wait_timeout = 40000;
SELECT @@wait_timeout = @@global.wait_timeout;
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
########################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE #
# points to same session variable #
########################################################################
SET @@wait_timeout = 100;
SELECT @@wait_timeout = @@local.wait_timeout;
SELECT @@local.wait_timeout = @@session.wait_timeout;
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
#######################################################################
# Check if wait_timeout can be accessed with and without @@ sign #
#######################################################################
SET wait_timeout = 1027;
SELECT @@wait_timeout;
--Error ER_UNKNOWN_TABLE
SELECT local.wait_timeout;
--Error ER_UNKNOWN_TABLE
SELECT session.wait_timeout;
--Error ER_BAD_FIELD_ERROR
SELECT wait_timeout = @@session.wait_timeout;
####################################
# Restore initial value #
####################################
SET @@global.wait_timeout = @start_global_value;
SET @@session.wait_timeout = @start_session_value;
#################################################
# END OF wait_timeout TESTS #
#################################################

View file

@ -0,0 +1,34 @@
#
# This file contains default,min and max values for sys variables for windows
#
--disable_query_log
SET @default_flush_time = 1800;
SET @min_flush_time = 0;
#SET @max_flush_time = 0;
SET @default_key_buffer_size= 131072;
SET @min_key_buffer_size= 8;
#SET @default_join_buffer_size = 131072;
#SET @min_join_buffer_size = 8200;
#SET @max_join_buffer_size = 4294967295;
SET @default_max_join_size = 4294967295;
SET @min_max_join_size = 1;
SET @max_max_join_size = 4294967295;
SET @default_sql_max_join_size = 4294967295;
SET @min_sql_max_join_size = 1;
SET @max_sql_max_join_size = 4294967295;
SET @default_sql_select_limit = 4294967295;
SET @min_sql_select_limit = 0;
SET @max_sql_select_limit = 4294967295;
let $default_wait_timeout = 28800;
let $min_wait_timeout = 1;
let $max_wait_timeout = 2147483;
--enable_query_log

0
mysql-test/mysql-test-run.pl Executable file → Normal file
View file

View file

@ -0,0 +1,117 @@
SET @start_value = @@autocommit;
SELECT @start_value;
@start_value
1
'#--------------------FN_DYNVARS_003_01------------------------#'
SET @@autocommit = 0;
SET @@autocommit = DEFAULT;
SELECT @@autocommit;
@@autocommit
0
'Bug: variable DEFAULT value not working and is not throwing error'
'#---------------------FN_DYNVARS_003_02-------------------------#'
SET @@autocommit = @start_value;
SELECT @@autocommit = 1;
@@autocommit = 1
1
'#--------------------FN_DYNVARS_003_03------------------------#'
SET @@autocommit = 0;
SELECT @@autocommit;
@@autocommit
0
SET @@autocommit = 1;
SELECT @@autocommit;
@@autocommit
1
'#--------------------FN_DYNVARS_003_04-------------------------#'
SET @@autocommit = 2;
ERROR 42000: Variable 'autocommit' can't be set to the value of '2'
SET @@autocommit = -1;
ERROR 42000: Variable 'autocommit' can't be set to the value of '-1'
SET @@autocommit = TRUEF;
ERROR 42000: Variable 'autocommit' can't be set to the value of 'TRUEF'
SET @@autocommit = TRUE_F;
ERROR 42000: Variable 'autocommit' can't be set to the value of 'TRUE_F'
SET @@autocommit = FALSE0;
ERROR 42000: Variable 'autocommit' can't be set to the value of 'FALSE0'
SET @@autocommit = OON;
ERROR 42000: Variable 'autocommit' can't be set to the value of 'OON'
SET @@autocommit = ONN;
ERROR 42000: Variable 'autocommit' can't be set to the value of 'ONN'
SET @@autocommit = OOFF;
ERROR 42000: Variable 'autocommit' can't be set to the value of 'OOFF'
SET @@autocommit = 0FF;
ERROR 42000: Variable 'autocommit' can't be set to the value of '0FF'
SET @@autocommit = ' ';
ERROR 42000: Variable 'autocommit' can't be set to the value of ' '
SET @@autocommit = " ";
ERROR 42000: Variable 'autocommit' can't be set to the value of ' '
SET @@autocommit = '';
ERROR 42000: Variable 'autocommit' can't be set to the value of ''
'#-------------------FN_DYNVARS_003_05----------------------------#'
SET @@global.autocommit = 0;
ERROR HY000: Variable 'autocommit' is a SESSION variable and can't be used with SET GLOBAL
SELECT @@global.autocommit;
ERROR HY000: Variable 'autocommit' is a SESSION variable
'#----------------------FN_DYNVARS_003_06------------------------#'
SELECT @@session.autocommit = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='autocommit';
@@session.autocommit = VARIABLE_VALUE
0
Bug # 34839: Values in variable and information_schema do not match for autocommit
'#----------------------FN_DYNVARS_003_07------------------------#'
SET @@autocommit = 1;
SELECT @@autocommit = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='autocommit';
@@autocommit = VARIABLE_VALUE
0
'#---------------------FN_DYNVARS_003_08-------------------------#'
SET @@autocommit = OFF;
SELECT @@autocommit;
@@autocommit
0
SET @@autocommit = ON;
SELECT @@autocommit;
@@autocommit
1
'#---------------------FN_DYNVARS_003_09----------------------#'
SET @@autocommit = TRUE;
SELECT @@autocommit;
@@autocommit
1
SET @@autocommit = FALSE;
SELECT @@autocommit;
@@autocommit
0
'#---------------------FN_DYNVARS_003_10----------------------#'
SET @@autocommit = 0;
SELECT @@autocommit = @@local.autocommit;
@@autocommit = @@local.autocommit
1
SELECT @@local.autocommit = @@session.autocommit;
@@local.autocommit = @@session.autocommit
1
SET @@autocommit = 1;
SELECT @@autocommit = @@local.autocommit;
@@autocommit = @@local.autocommit
1
SELECT @@session.autocommit = @@autocommit;
@@session.autocommit = @@autocommit
1
'#---------------------FN_DYNVARS_003_11----------------------#'
SET autocommit = 1;
SELECT @@autocommit;
@@autocommit
1
SELECT local.autocommit;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.autocommit;
ERROR 42S02: Unknown table 'session' in field list
SELECT autocommit = @@session.autocommit;
ERROR 42S22: Unknown column 'autocommit' in 'field list'
SET @@autocommit = @start_value;
SELECT @@autocommit;
@@autocommit
1

View file

@ -0,0 +1,165 @@
SET @start_global_value = @@global.auto_increment_increment;
SELECT @start_global_value;
@start_global_value
1
SET @start_session_value = @@session.auto_increment_increment;
SELECT @start_session_value;
@start_session_value
1
'#--------------------FN_DYNVARS_001_01-------------------------#'
SET @@global.auto_increment_increment = 100;
SET @@global.auto_increment_increment = DEFAULT;
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
SET @@session.auto_increment_increment = 200;
SET @@session.auto_increment_increment = DEFAULT;
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1
'#--------------------FN_DYNVARS_001_02-------------------------#'
SET @@global.auto_increment_increment = DEFAULT;
SELECT @@global.auto_increment_increment = 1;
@@global.auto_increment_increment = 1
1
SET @@session.auto_increment_increment = DEFAULT;
SELECT @@session.auto_increment_increment = 1;
@@session.auto_increment_increment = 1
1
'#--------------------FN_DYNVARS_001_03-------------------------#'
SET @@global.auto_increment_increment = 1;
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
SET @@global.auto_increment_increment = 60020;
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
60020
SET @@global.auto_increment_increment = 65535;
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
65535
'#--------------------FN_DYNVARS_001_04-------------------------#'
SET @@session.auto_increment_increment = 1;
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1
SET @@session.auto_increment_increment = 50050;
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
50050
SET @@session.auto_increment_increment = 65535;
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
65535
'#------------------FN_DYNVARS_001_05-----------------------#'
SET @@global.auto_increment_increment = 0;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
SET @@global.auto_increment_increment = -1024;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
SET @@global.auto_increment_increment = 65536;
Warnings:
Warning 1292 Truncated incorrect auto_increment_increment value: '65536'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
65535
SET @@global.auto_increment_increment = 65530.34.;
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
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
65535
SET @@global.auto_increment_increment = test;
ERROR 42000: Incorrect argument type to variable 'auto_increment_increment'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
65535
SET @@session.auto_increment_increment = 0;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1
SET @@session.auto_increment_increment = -2;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1
SET @@session.auto_increment_increment = 65530.34.;
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
SET @@session.auto_increment_increment = 65550;
Warnings:
Warning 1292 Truncated incorrect auto_increment_increment value: '65550'
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
65535
'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.auto_increment_increment = test;
ERROR 42000: Incorrect argument type to variable 'auto_increment_increment'
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
65535
'#------------------FN_DYNVARS_001_06-----------------------#'
SELECT @@global.auto_increment_increment = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='auto_increment_increment';
@@global.auto_increment_increment = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_001_07-----------------------#'
SELECT @@session.auto_increment_increment = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='auto_increment_increment';
@@session.auto_increment_increment = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_001_08-----------------------#'
SET @@global.auto_increment_increment = TRUE;
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
SET @@global.auto_increment_increment = FALSE;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.auto_increment_increment = 10;
SET @@session.auto_increment_increment = 11;
SELECT @@auto_increment_increment = @@global.auto_increment_increment;
@@auto_increment_increment = @@global.auto_increment_increment
0
'#---------------------FN_DYNVARS_001_10----------------------#'
SET @@auto_increment_increment = 100;
SELECT @@auto_increment_increment = @@local.auto_increment_increment;
@@auto_increment_increment = @@local.auto_increment_increment
1
SELECT @@local.auto_increment_increment = @@session.auto_increment_increment;
@@local.auto_increment_increment = @@session.auto_increment_increment
1
'#---------------------FN_DYNVARS_001_11----------------------#'
SET auto_increment_increment = 1;
SELECT @@auto_increment_increment;
@@auto_increment_increment
1
SELECT local.auto_increment_increment;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.auto_increment_increment;
ERROR 42S02: Unknown table 'session' in field list
SELECT auto_increment_increment = @@session.auto_increment_increment;
ERROR 42S22: Unknown column 'auto_increment_increment' in 'field list'
SET @@global.auto_increment_increment = @start_global_value;
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
SET @@session.auto_increment_increment = @start_session_value;
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1

View file

@ -0,0 +1,201 @@
SET @global_auto_increment_increment = @@global.auto_increment_increment;
SET @session_auto_increment_increment = @@session.auto_increment_increment;
SET @global_auto_increment_offset = @@global.auto_increment_offset;
SET @session_auto_increment_offset = @@session.auto_increment_offset;
drop table if exists t1;
CREATE TABLE t1
(
id INT NOT NULL auto_increment,
PRIMARY KEY (id),
name VARCHAR(30)
);
'#--------------------FN_DYNVARS_001_01-------------------------#'
## Setting initial value of auto_increment_increment to 5 ##
SET @@auto_increment_increment = 5;
'#--------------------FN_DYNVARS_001_02-------------------------#'
## Inserting first record in table to check behavior of the variable ##
INSERT into t1(name) values('Record_1');
SELECT * from t1;
id name
1 Record_1
## Changing value of variable to 10 ##
SET @@global.auto_increment_increment = 10;
## Inserting record and verifying value of column id ##
INSERT into t1(name) values('Record_2');
SELECT * from t1;
id name
1 Record_1
6 Record_2
## Test behavior of variable after assigning some larger value to it ##
SELECT @@auto_increment_increment;
@@auto_increment_increment
5
SET @@auto_increment_increment = 100;
INSERT into t1(name) values('Record_5');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
'#--------------------FN_DYNVARS_001_03-------------------------#'
## Creating new connection test_con1 ##
## Value of session & global vairable here should be 10 ##
SELECT @@global.auto_increment_increment = 10;
@@global.auto_increment_increment = 10
1
SELECT @@session.auto_increment_increment = 10;
@@session.auto_increment_increment = 10
1
## Setting global value of variable and inserting data in table ##
SET @@global.auto_increment_increment = 20;
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
20
INSERT into t1(name) values('Record_6');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
111 Record_6
## Setting session value of variable and inserting data in table ##
SET @@session.auto_increment_increment = 2;
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
2
INSERT into t1(name) values('Record_8');
INSERT into t1(name) values('Record_9');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
111 Record_6
113 Record_8
115 Record_9
'#--------------------FN_DYNVARS_001_04-------------------------#'
## Creating another new connection test_con2 ##
## Verifying initial values of variable in global & session scope ##
## global & session initial value should be 20 ##
SELECT @@global.auto_increment_increment = 20;
@@global.auto_increment_increment = 20
1
SELECT @@session.auto_increment_increment = 20;
@@session.auto_increment_increment = 20
1
## Setting value of session variable to 5 and verifying its behavior ##
SET @@session.auto_increment_increment = 5;
INSERT into t1(name) values('Record_10');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
111 Record_6
113 Record_8
115 Record_9
116 Record_10
'Bug#35362: Here Record_10 id should be 120 instead of 115 because we'
'have set the value of variable to 5'
SET @@session.auto_increment_increment = 1;
SELECT @@auto_increment_increment;
@@auto_increment_increment
1
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
20
'#--------------------FN_DYNVARS_001_05-------------------------#'
## Switching to test_con1 ##
## Verifying values of global & session value of variable ##
## global value should be 20 ##
SELECT @@global.auto_increment_increment = 20;
@@global.auto_increment_increment = 20
1
## session value should be 2 ##
SELECT @@session.auto_increment_increment = 2;
@@session.auto_increment_increment = 2
1
INSERT into t1(name) values('Record_11');
INSERT into t1(name) values('Record_12');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
111 Record_6
113 Record_8
115 Record_9
116 Record_10
117 Record_11
119 Record_12
'#--------------------FN_DYNVARS_001_06-------------------------#'
## Changing column's datatype to SmallInt and verifying variable's behavior ##
ALTER table t1 MODIFY id SMALLINT NOT NULL auto_increment;
INSERT into t1(name) values('Record_13');
INSERT into t1(name) values('Record_14');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
111 Record_6
113 Record_8
115 Record_9
116 Record_10
117 Record_11
119 Record_12
121 Record_13
123 Record_14
## Changing column's datatype to BigInt and verifying variable's behavior ##
ALTER table t1 MODIFY id BIGINT NOT NULL auto_increment;
INSERT into t1(name) values('Record_15');
INSERT into t1(name) values('Record_16');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
111 Record_6
113 Record_8
115 Record_9
116 Record_10
117 Record_11
119 Record_12
121 Record_13
123 Record_14
125 Record_15
127 Record_16
'#--------------------FN_DYNVARS_001_07-------------------------#'
## Verifying behavior of variable with negative value ##
SET @@auto_increment_increment = -10;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
INSERT into t1(name) values('Record_17');
INSERT into t1(name) values('Record_18');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
111 Record_6
113 Record_8
115 Record_9
116 Record_10
117 Record_11
119 Record_12
121 Record_13
123 Record_14
125 Record_15
127 Record_16
128 Record_17
129 Record_18
'Bug#35364: Variable is incrementing some random values on assigning -ve value'
## Disconnecting test_con2 ##
## Dropping table t1 ##
DROP table if exists t1;
## Disconnecting test_con1 ##
## switching to default connection ##
SET @@global.auto_increment_increment = @global_auto_increment_increment;
SET @@session.auto_increment_increment = @session_auto_increment_increment;
SET @@global.auto_increment_offset = @global_auto_increment_offset;
SET @@session.auto_increment_offset = @session_auto_increment_offset;

View file

@ -0,0 +1,178 @@
SET @start_global_value = @@global.auto_increment_offset;
SELECT @start_global_value;
@start_global_value
1
SET @start_session_value = @@session.auto_increment_offset;
SELECT @start_session_value;
@start_session_value
1
'#--------------------FN_DYNVARS_002_01-------------------------#'
SET @@global.auto_increment_offset = 100;
SET @@global.auto_increment_offset = DEFAULT;
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
SET @@session.auto_increment_offset = 200;
SET @@session.auto_increment_offset = DEFAULT;
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
1
'#--------------------FN_DYNVARS_002_02-------------------------#'
SET @@global.auto_increment_offset = @start_global_value;
SELECT @@global.auto_increment_offset = 1;
@@global.auto_increment_offset = 1
1
SET @@session.auto_increment_offset = @start_session_value;
SELECT @@session.auto_increment_offset = 1;
@@session.auto_increment_offset = 1
1
'#--------------------FN_DYNVARS_002_03-------------------------#'
SET @@global.auto_increment_offset = 1;
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
SET @@global.auto_increment_offset = 60020;
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
60020
SET @@global.auto_increment_offset = 65535;
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
65535
'#--------------------FN_DYNVARS_002_04-------------------------#'
SET @@session.auto_increment_offset = 1;
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
1
SET @@session.auto_increment_offset = 50050;
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
50050
SET @@session.auto_increment_offset = 65535;
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
65535
'#------------------FN_DYNVARS_002_05-----------------------#'
SET @@global.auto_increment_offset = 0;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
SET @@global.auto_increment_offset = -1024;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
SET @@global.auto_increment_offset = 65536;
Warnings:
Warning 1292 Truncated incorrect auto_increment_offset value: '65536'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
65535
SET @@global.auto_increment_offset = ON;
ERROR 42000: Incorrect argument type to variable 'auto_increment_offset'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
65535
SET @@global.auto_increment_offset = OFF;
ERROR 42000: Incorrect argument type to variable 'auto_increment_offset'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
65535
SET @@global.auto_increment_offset = test;
ERROR 42000: Incorrect argument type to variable 'auto_increment_offset'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
65535
SET @@session.auto_increment_offset = 0;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
1
SET @@session.auto_increment_offset = -2;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
1
SET @@session.auto_increment_offset = 65550;
Warnings:
Warning 1292 Truncated incorrect auto_increment_offset value: '65550'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
65535
'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@session.auto_increment_offset = ON;
ERROR 42000: Incorrect argument type to variable 'auto_increment_offset'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
65535
SET @@session.auto_increment_offset = OFF;
ERROR 42000: Incorrect argument type to variable 'auto_increment_offset'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
65535
SET @@session.auto_increment_offset = test;
ERROR 42000: Incorrect argument type to variable 'auto_increment_offset'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
65535
'#------------------FN_DYNVARS_002_06-----------------------#'
SELECT @@global.auto_increment_offset = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='auto_increment_offset';
@@global.auto_increment_offset = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_002_07-----------------------#'
SELECT @@session.auto_increment_offset = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='auto_increment_offset';
@@session.auto_increment_offset = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_002_08-----------------------#'
SET @@global.auto_increment_offset = TRUE;
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
SET @@global.auto_increment_offset = FALSE;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.auto_increment_offset = 10;
SET @@session.auto_increment_offset = 11;
SELECT @@auto_increment_offset = @@global.auto_increment_offset;
@@auto_increment_offset = @@global.auto_increment_offset
0
'#---------------------FN_DYNVARS_001_10----------------------#'
SET @@auto_increment_offset = 100;
SELECT @@auto_increment_offset = @@local.auto_increment_offset;
@@auto_increment_offset = @@local.auto_increment_offset
1
SELECT @@local.auto_increment_offset = @@session.auto_increment_offset;
@@local.auto_increment_offset = @@session.auto_increment_offset
1
'#---------------------FN_DYNVARS_001_11----------------------#'
SET auto_increment_offset = 1;
SELECT @@auto_increment_offset;
@@auto_increment_offset
1
SELECT local.auto_increment_offset;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.auto_increment_offset;
ERROR 42S02: Unknown table 'session' in field list
SELECT auto_increment_offset = @@session.auto_increment_offset;
ERROR 42S22: Unknown column 'auto_increment_offset' in 'field list'
SET @@global.auto_increment_offset = @start_global_value;
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
SET @@session.auto_increment_offset = @start_session_value;
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
1

View file

@ -0,0 +1,257 @@
SET @global_auto_increment_increment = @@global.auto_increment_increment;
SET @session_auto_increment_increment = @@session.auto_increment_increment;
SET @global_auto_increment_offset = @@global.auto_increment_offset;
SET @session_auto_increment_offset = @@session.auto_increment_offset;
drop table if exists t1;
## Creating New Table ##
CREATE TABLE t1
(
id INT NOT NULL auto_increment,
PRIMARY KEY (id),
name VARCHAR(30)
);
'#--------------------FN_DYNVARS_002_01-------------------------#'
## Setting initial value of variable to 5 ##
SET @@auto_increment_increment = 10;
SET @@auto_increment_offset = 5;
'#--------------------FN_DYNVARS_002_02-------------------------#'
## Inserting records in table and verifying variable's behavior ##
INSERT into t1(name) values('Record_1');
SELECT * from t1;
id name
5 Record_1
INSERT into t1(name) values('Record_2');
SELECT * from t1;
id name
5 Record_1
15 Record_2
## Test behavior of variable after updating value of variable ##
SET @@auto_increment_offset = 24;
SELECT @@auto_increment_offset;
@@auto_increment_offset
24
INSERT into t1(name) values('Record_3');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
INSERT into t1(name) values('Record_4');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
'#--------------------FN_DYNVARS_002_03-------------------------#'
## Changing value of global scope before opening new connection ##
SET @@global.auto_increment_increment = 15;
SET @@global.auto_increment_offset = 36;
## New connection test_con1 ##
## Value of session & global vairable here should be 10 ##
SELECT @@global.auto_increment_offset = 36;
@@global.auto_increment_offset = 36
1
SELECT @@session.auto_increment_offset = 36;
@@session.auto_increment_offset = 36
1
## Verify global value effect of variable by inserting new rows in table ##
INSERT into t1(name) values('Record_5');
INSERT into t1(name) values('Record_6');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
## Setting session value of variable and inserting data in table ##
SET @@session.auto_increment_offset = 54;
INSERT into t1(name) values('Record_7');
INSERT into t1(name) values('Record_8');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
54 Record_7
69 Record_8
'#--------------------FN_DYNVARS_002_04-------------------------#'
## Setting value of variable less than last insert id ##
SET @@session.auto_increment_offset = 5;
INSERT into t1(name) values('Record_9');
'Bug#35367: Random value of id is increasing on assigning value to';
'variable that is less than current offset';
INSERT into t1(name) values('Record_10');
INSERT into t1(name) values('Record_11');
INSERT into t1(name) values('Record_12');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
54 Record_7
69 Record_8
80 Record_9
95 Record_10
110 Record_11
125 Record_12
'#--------------------FN_DYNVARS_002_05-------------------------#'
## Assigning value to variable greater than auto_increment_incrent value ##
SET @@auto_increment_offset = 140;
SET @@auto_increment_increment = 10;
INSERT into t1(name) values('Record_13');
INSERT into t1(name) values('Record_14');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
54 Record_7
69 Record_8
80 Record_9
95 Record_10
110 Record_11
125 Record_12
134 Record_13
140 Record_14
'Bug#35369: Some invalid value of id is increasing on assigning value to';
'variable that is greater than auto_increment_increment';
'#--------------------FN_DYNVARS_002_06-------------------------#'
## Changing datatype of column id with primary key to SmallInt ##
ALTER table t1 modify id SMALLINT NOT NULL auto_increment;
INSERT into t1(name) values('Record_15');
INSERT into t1(name) values('Record_16');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
54 Record_7
69 Record_8
80 Record_9
95 Record_10
110 Record_11
125 Record_12
134 Record_13
140 Record_14
150 Record_15
160 Record_16
## Changing datatype of column id with primary key to BigInt ##
ALTER table t1 modify id BIGINT NOT NULL auto_increment;
INSERT into t1(name) values('Record_17');
INSERT into t1(name) values('Record_18');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
54 Record_7
69 Record_8
80 Record_9
95 Record_10
110 Record_11
125 Record_12
134 Record_13
140 Record_14
150 Record_15
160 Record_16
170 Record_17
180 Record_18
'#--------------------FN_DYNVARS_002_07-------------------------#'
## Assigning -ve value to variable ##
SET @@auto_increment_offset = -10;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
SELECT @@auto_increment_offset = -10;
@@auto_increment_offset = -10
0
INSERT into t1(name) values('Record_17');
INSERT into t1(name) values('Record_18');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
54 Record_7
69 Record_8
80 Record_9
95 Record_10
110 Record_11
125 Record_12
134 Record_13
140 Record_14
150 Record_15
160 Record_16
170 Record_17
180 Record_18
181 Record_17
191 Record_18
'Bug#35370: Some invalid value of id is increasing on assigning negative';
' value in variable';
## Assigning value that is out of range of variable ##
SET @@auto_increment_offset = 65536;
Warnings:
Warning 1292 Truncated incorrect auto_increment_offset value: '65536'
SELECT @@auto_increment_offset;
@@auto_increment_offset
65535
INSERT into t1(name) values('Record_17');
INSERT into t1(name) values('Record_18');
INSERT into t1(name) values('Record_19');
INSERT into t1(name) values('Record_20');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
54 Record_7
69 Record_8
80 Record_9
95 Record_10
110 Record_11
125 Record_12
134 Record_13
140 Record_14
150 Record_15
160 Record_16
170 Record_17
180 Record_18
181 Record_17
191 Record_18
199 Record_17
209 Record_18
219 Record_19
229 Record_20
## No effect of auto_increment_offset since value of this variable is greater ##
## than auto_increment_increment ##
## Dropping table ##
DROP table if exists t1;
## Disconnecting connection ##
## switching to default connection ##
SET @@global.auto_increment_increment = @global_auto_increment_increment;
SET @@session.auto_increment_increment = @session_auto_increment_increment;
SET @@global.auto_increment_offset = @global_auto_increment_offset;
SET @@session.auto_increment_offset = @session_auto_increment_offset;

View file

@ -0,0 +1,109 @@
drop table if exists t1;
## Creating new table ##
CREATE TABLE t1
(
id INT NOT NULL auto_increment,
PRIMARY KEY (id),
name varchar(30)
) ENGINE = INNODB;
'#--------------------FN_DYNVARS_003_01-------------------------#'
## Setting variable's value to 0 i.e false ##
SET @@autocommit = 0;
'#--------------------FN_DYNVARS_003_02-------------------------#'
## Creating new connection ##
## Checking value of variable after opening new connection ##
SELECT @@autocommit;
@@autocommit
1
## Setting value of variable to zero and inserting some rows ##
SET @@autocommit = 0;
INSERT into t1(name) values('Record_1');
INSERT into t1(name) values('Record_2');
SELECT * from t1;
id name
1 Record_1
2 Record_2
## Creating another connection and verifying records in table ##
## New Connection test_con2 ##
SELECT * from t1;
id name
'#--------------------FN_DYNVARS_003_03-------------------------#'
## Verifying behavior of variable by commiting rows in test_con1 ##
## Connecting with connection # 01 ##
SELECT * from t1;
id name
1 Record_1
2 Record_2
COMMIT;
## New Connection test_con2 ##
## Now verifying records in table from connection # 02 ##
SELECT * from t1;
id name
1 Record_1
2 Record_2
'#--------------------FN_DYNVARS_003_04-------------------------#'
## Connecting to connection # 01 ##
SELECT * from t1;
id name
1 Record_1
2 Record_2
## Updating value of first row ##
UPDATE t1 set name = 'Record_12' where name = 'Record_1';
SELECT * from t1;
id name
1 Record_12
2 Record_2
## Connecting to connecting # 02 and verifying effect of update query ##
SELECT * from t1;
id name
1 Record_1
2 Record_2
## Now connecting with connection # 01 and using ROLLBACK after it ##
ROLLBACK;
SELECT * from t1;
id name
1 Record_1
2 Record_2
'#--------------------FN_DYNVARS_003_05-------------------------#'
## Connecting with connection # 01 ##
INSERT into t1(name) values('Record_3');
## Connection test_con2 ##
## Now verifying records in table from connection # 02 and changing value ##
## of autocommit to true ##
SELECT * from t1;
id name
1 Record_1
2 Record_2
SET @@autocommit = 1;
INSERT into t1(name) values('Record_4');
INSERT into t1(name) values('Record_5');
SELECT * from t1;
id name
1 Record_1
2 Record_2
4 Record_4
5 Record_5
## Connecting with connection # 01 and inserting few records ##
SELECT * from t1;
id name
1 Record_1
2 Record_2
3 Record_3
'Bug#35373: Records donot get committed in transaction on switching connections'
INSERT into t1(name) values('Record_6');
SELECT * from t1;
id name
1 Record_1
2 Record_2
3 Record_3
6 Record_6
## Now verifying the effect of these new records in second connection ##
SELECT * from t1;
id name
1 Record_1
2 Record_2
4 Record_4
5 Record_5
## Dropping table t1 ##
DROP table t1;
## Disconnecting both connections ##

View file

@ -0,0 +1,101 @@
SET @start_value = @@global.automatic_sp_privileges;
SELECT @start_value;
@start_value
1
'#--------------------FN_DYNVARS_004_01------------------------#'
SET @@global.automatic_sp_privileges = 0;
SET @@global.automatic_sp_privileges = DEFAULT;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
1
'#---------------------FN_DYNVARS_004_02-------------------------#'
SET @@global.automatic_sp_privileges = @start_value;
SELECT @@global.automatic_sp_privileges = TRUE;
@@global.automatic_sp_privileges = TRUE
1
'#--------------------FN_DYNVARS_004_03------------------------#'
SET @@global.automatic_sp_privileges = 0;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
0
SET @@global.automatic_sp_privileges = 1;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
1
'#--------------------FN_DYNVARS_004_04-------------------------#'
SET @@global.automatic_sp_privileges = 2;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of '2'
SET @@global.automatic_sp_privileges = -1;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of '-1'
SET @@global.automatic_sp_privileges = TRUEF;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of 'TRUEF'
SET @@global.automatic_sp_privileges = TRUE_F;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of 'TRUE_F'
SET @@global.automatic_sp_privileges = FALSE0;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of 'FALSE0'
SET @@global.automatic_sp_privileges = OON;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of 'OON'
SET @@global.automatic_sp_privileges = ONN;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of 'ONN'
SET @@global.automatic_sp_privileges = OOFF;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of 'OOFF'
SET @@global.automatic_sp_privileges = 0FF;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of '0FF'
SET @@global.automatic_sp_privileges = ' ';
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of ' '
SET @@global.automatic_sp_privileges = " ";
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of ' '
SET @@global.automatic_sp_privileges = '';
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of ''
'#-------------------FN_DYNVARS_004_05----------------------------#'
SET @@session.automatic_sp_privileges = 1;
ERROR HY000: Variable 'automatic_sp_privileges' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@session.automatic_sp_privileges;
ERROR HY000: Variable 'automatic_sp_privileges' is a GLOBAL variable
'#----------------------FN_DYNVARS_004_06------------------------#'
SELECT @@global.automatic_sp_privileges = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='automatic_sp_privileges';
@@global.automatic_sp_privileges = VARIABLE_VALUE
0
'Bug# 34839: Values in variable and information_schema donot match'
'#---------------------FN_DYNVARS_004_07----------------------#'
SET @@global.automatic_sp_privileges = OFF;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
0
SET @@global.automatic_sp_privileges = ON;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
1
'#---------------------FN_DYNVARS_004_08----------------------#'
SET @@global.automatic_sp_privileges = TRUE;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
1
SET @@global.automatic_sp_privileges = FALSE;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
0
'#---------------------FN_DYNVARS_004_09----------------------#'
SET @@global.automatic_sp_privileges = 1;
SELECT @@automatic_sp_privileges = @@global.automatic_sp_privileges;
@@automatic_sp_privileges = @@global.automatic_sp_privileges
1
'#---------------------FN_DYNVARS_004_10----------------------#'
SET automatic_sp_privileges = 1;
ERROR HY000: Variable 'automatic_sp_privileges' is a GLOBAL variable and should be set with SET GLOBAL
SET local.automatic_sp_privileges = 1;
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 'automatic_sp_privileges = 1' at line 1
SELECT local.automatic_sp_privileges;
ERROR 42S02: Unknown table 'local' in field list
SET global.automatic_sp_privileges = 1;
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 'automatic_sp_privileges = 1' at line 1
SELECT global.automatic_sp_privileges;
ERROR 42S02: Unknown table 'global' in field list
SELECT automatic_sp_privileges = @@session.automatic_sp_privileges;
ERROR 42S22: Unknown column 'automatic_sp_privileges' in 'field list'
SET @@global.automatic_sp_privileges = @start_value;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
1

View file

@ -0,0 +1,59 @@
** Setup **
SET @global_automatic_sp_privileges = @@GLOBAL.automatic_sp_privileges;
CREATE TABLE t1 (a varchar(200));
INSERT INTO t1 VALUES('Procedure Executed.');
CREATE USER 'userTest'@'localhost';
CREATE USER 'userTest1'@'localhost';
** Connection default **
SET GLOBAL automatic_sp_privileges = TRUE;
** Connecting using userTest **
** Connection conUser **
CREATE PROCEDURE testProc ()
BEGIN
SELECT * FROM t1;
END;|
CALL testProc();
a
Procedure Executed.
Expecting SELECT executed
** Connection default**
SET GLOBAL automatic_sp_privileges = FALSE;
** Connecting using userTest1 **
** Connection conUser1 **
CREATE PROCEDURE testProc1 ()
BEGIN
SELECT * FROM t1;
END;|
Expected error access denied
CALL testProc1();
ERROR 42000: execute command denied to user 'userTest1'@'localhost' for routine 'test.testProc1'
Expected error access denied
ALTER PROCEDURE testProc1 COMMENT 'My Comment';
ERROR 42000: alter routine command denied to user 'userTest1'@'localhost' for routine 'test.testProc1'
Expected error access denied
DROP PROCEDURE testProc1;
ERROR 42000: alter routine command denied to user 'userTest1'@'localhost' for routine 'test.testProc1'
** Connection default **
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE testProc1 TO 'userTest1'@'localhost';
** Connection conUser1 **
CALL testProc1();
a
Procedure Executed.
Expecting seelect executed
ALTER PROCEDURE testProc1 COMMENT 'My Comment';
** Cleanup **
** Connection default **
disconnecting connections
SET GLOBAL automatic_sp_privileges = @global_automatic_sp_privileges;
REVOKE EXECUTE, ALTER ROUTINE ON PROCEDURE testProc FROM 'userTest'@'localhost';
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'userTest'@'localhost';
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'userTest1'@'localhost';
DROP PROCEDURE testProc;
DROP PROCEDURE testProc1;
DROP USER 'userTest'@'localhost';
DROP USER 'userTest1'@'localhost';
DROP TABLE t1;

View file

@ -0,0 +1,53 @@
'#---------------------BS_STVARS_001_01----------------------#'
SELECT COUNT(@@GLOBAL.basedir);
COUNT(@@GLOBAL.basedir)
1
1 Expected
'#---------------------BS_STVARS_001_02----------------------#'
SET @@GLOBAL.basedir=1;
ERROR HY000: Variable 'basedir' is a read only variable
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.basedir);
COUNT(@@GLOBAL.basedir)
1
1 Expected
'#---------------------BS_STVARS_001_03----------------------#'
SELECT @@GLOBAL.basedir = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='basedir';
@@GLOBAL.basedir = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.basedir);
COUNT(@@GLOBAL.basedir)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='basedir';
COUNT(VARIABLE_VALUE)
1
1 Expected
'#---------------------BS_STVARS_001_04----------------------#'
SELECT @@basedir = @@GLOBAL.basedir;
@@basedir = @@GLOBAL.basedir
1
1 Expected
'#---------------------BS_STVARS_001_05----------------------#'
SELECT COUNT(@@basedir);
COUNT(@@basedir)
1
1 Expected
SELECT COUNT(@@local.basedir);
ERROR HY000: Variable 'basedir' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.basedir);
ERROR HY000: Variable 'basedir' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.basedir);
COUNT(@@GLOBAL.basedir)
1
1 Expected
SELECT basedir = @@SESSION.basedir;
ERROR 42S22: Unknown column 'basedir' in 'field list'
Expected error 'Readonly variable'

View file

@ -0,0 +1,103 @@
SET @start_value = @@big_tables;
SELECT @start_value;
@start_value
0
'#--------------------FN_DYNVARS_005_01------------------------#'
SET @@big_tables = 1;
SET @@big_tables = DEFAULT;
SELECT @@big_tables;
@@big_tables
1
'Bug# 34829: No default value for variable and setting default does not raise error';
'#--------------------FN_DYNVARS_005_02------------------------#'
SET @@big_tables = 0;
SELECT @@big_tables;
@@big_tables
0
SET @@big_tables = 1;
SELECT @@big_tables;
@@big_tables
1
'#--------------------FN_DYNVARS_005_03-------------------------#'
SET @@big_tables = 2;
ERROR 42000: Variable 'big_tables' can't be set to the value of '2'
SET @@big_tables = -1;
ERROR 42000: Variable 'big_tables' can't be set to the value of '-1'
SET @@big_tables = TRUEF;
ERROR 42000: Variable 'big_tables' can't be set to the value of 'TRUEF'
SET @@big_tables = TRUE_F;
ERROR 42000: Variable 'big_tables' can't be set to the value of 'TRUE_F'
SET @@big_tables = FALSE0;
ERROR 42000: Variable 'big_tables' can't be set to the value of 'FALSE0'
SET @@big_tables = OON;
ERROR 42000: Variable 'big_tables' can't be set to the value of 'OON'
SET @@big_tables = ONN;
ERROR 42000: Variable 'big_tables' can't be set to the value of 'ONN'
SET @@big_tables = OOFF;
ERROR 42000: Variable 'big_tables' can't be set to the value of 'OOFF'
SET @@big_tables = 0FF;
ERROR 42000: Variable 'big_tables' can't be set to the value of '0FF'
SET @@big_tables = ' ';
ERROR 42000: Variable 'big_tables' can't be set to the value of ' '
SET @@big_tables = " ";
ERROR 42000: Variable 'big_tables' can't be set to the value of ' '
SET @@big_tables = '';
ERROR 42000: Variable 'big_tables' can't be set to the value of ''
'#-------------------FN_DYNVARS_005_04----------------------------#'
SET @@global.big_tables = 0;
ERROR HY000: Variable 'big_tables' is a SESSION variable and can't be used with SET GLOBAL
SELECT @@global.big_tables;
ERROR HY000: Variable 'big_tables' is a SESSION variable
'#----------------------FN_DYNVARS_005_05------------------------#'
SELECT @@big_tables = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='big_tables';
@@big_tables = VARIABLE_VALUE
0
Bug # 34839: Values in variable and information_schema do not match for autocommit
'#---------------------FN_DYNVARS_005_06----------------------#'
SET @@big_tables = OFF;
SELECT @@big_tables;
@@big_tables
0
SET @@big_tables = ON;
SELECT @@big_tables;
@@big_tables
1
'#---------------------FN_DYNVARS_005_07----------------------#'
SET @@big_tables = TRUE;
SELECT @@big_tables;
@@big_tables
1
SET @@big_tables = FALSE;
SELECT @@big_tables;
@@big_tables
0
'#---------------------FN_DYNVARS_005_08----------------------#'
SET @@big_tables = 0;
SELECT @@big_tables = @@session.big_tables;
@@big_tables = @@session.big_tables
1
SET @@big_tables = 1;
SELECT @@big_tables = @@local.big_tables and @@local.big_tables = @@session.big_tables;
@@big_tables = @@local.big_tables and @@local.big_tables = @@session.big_tables
1
'#---------------------FN_DYNVARS_005_09----------------------#'
SET big_tables = 1;
SELECT @@big_tables;
@@big_tables
1
SET local.big_tables = 1;
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 'big_tables = 1' at line 1
SELECT local.big_tables;
ERROR 42S02: Unknown table 'local' in field list
SET session.big_tables = 1;
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 'big_tables = 1' at line 1
SELECT session.big_tables;
ERROR 42S02: Unknown table 'session' in field list
select big_tables;
ERROR 42S22: Unknown column 'big_tables' in 'field list'
SET @@big_tables = @start_value;
SELECT @@big_tables;
@@big_tables
0

View file

@ -0,0 +1,102 @@
SET @start_value = @@global.binlog_cache_size;
SELECT @start_value;
@start_value
32768
'#--------------------FN_DYNVARS_006_01------------------------#'
SET @@global.binlog_cache_size = 100;
Warnings:
Warning 1292 Truncated incorrect binlog_cache_size value: '100'
SET @@global.binlog_cache_size = DEFAULT;
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
32768
'#---------------------FN_DYNVARS_006_02-------------------------#'
SET @@global.binlog_cache_size = @start_value;
SELECT @@global.binlog_cache_size = 32768;
@@global.binlog_cache_size = 32768
1
'#--------------------FN_DYNVARS_006_03------------------------#'
SET @@global.binlog_cache_size = 4096;
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4096
SET @@global.binlog_cache_size = 4294967295;
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4294963200
SET @@global.binlog_cache_size = 10000;
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
8192
SET @@global.binlog_cache_size = 21221204;
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
21217280
'Bug: Invalid values are coming in variable on assigning valid values'
'#--------------------FN_DYNVARS_006_04-------------------------#'
SET @@global.binlog_cache_size = 1024;
Warnings:
Warning 1292 Truncated incorrect binlog_cache_size value: '1024'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4096
SET @@global.binlog_cache_size = 10000.01;
ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
SET @@global.binlog_cache_size = -1024;
Warnings:
Warning 1292 Truncated incorrect binlog_cache_size value: '0'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4096
SET @@global.binlog_cache_size = 42949672950;
Warnings:
Warning 1292 Truncated incorrect binlog_cache_size value: '42949672950'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4294963200
'Bug: Errors are not coming on assigning invalid values to variable'
SET @@global.binlog_cache_size = ON;
ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
SET @@global.binlog_cache_size = 'test';
ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
'#-------------------FN_DYNVARS_006_05----------------------------#'
SET @@session.binlog_cache_size = 0;
ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
'#----------------------FN_DYNVARS_006_06------------------------#'
SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size';
@@global.binlog_cache_size = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_006_07----------------------#'
SET @@global.binlog_cache_size = TRUE;
Warnings:
Warning 1292 Truncated incorrect binlog_cache_size value: '1'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4096
SET @@global.binlog_cache_size = FALSE;
Warnings:
Warning 1292 Truncated incorrect binlog_cache_size value: '0'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4096
'Bug: Errors are not coming on assigning TRUE/FALSE to variable'
'#---------------------FN_DYNVARS_006_08----------------------#'
SET @@global.binlog_cache_size = 1;
Warnings:
Warning 1292 Truncated incorrect binlog_cache_size value: '1'
SELECT @@binlog_cache_size = @@global.binlog_cache_size;
@@binlog_cache_size = @@global.binlog_cache_size
1
'#---------------------FN_DYNVARS_006_09----------------------#'
SET binlog_cache_size = 1;
ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
SET global.binlog_cache_size = 1;
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 'binlog_cache_size = 1' at line 1
SELECT global.binlog_cache_size;
ERROR 42S02: Unknown table 'global' in field list
SELECT binlog_cache_size = @@session.binlog_cache_size;
ERROR 42S22: Unknown column 'binlog_cache_size' in 'field list'
SET @@global.binlog_cache_size = @start_value;
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
32768

View file

@ -0,0 +1,100 @@
SET @start_value = @@global.binlog_cache_size;
SELECT @start_value;
@start_value
32768
'#--------------------FN_DYNVARS_006_01------------------------#'
SET @@global.binlog_cache_size = 100;
Warnings:
Warning 1292 Truncated incorrect binlog_cache_size value: '100'
SET @@global.binlog_cache_size = DEFAULT;
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
32768
'#---------------------FN_DYNVARS_006_02-------------------------#'
SET @@global.binlog_cache_size = @start_value;
SELECT @@global.binlog_cache_size = 32768;
@@global.binlog_cache_size = 32768
1
'#--------------------FN_DYNVARS_006_03------------------------#'
SET @@global.binlog_cache_size = 4096;
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4096
SET @@global.binlog_cache_size = 4294967295;
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4294963200
SET @@global.binlog_cache_size = 10000;
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
8192
SET @@global.binlog_cache_size = 21221204;
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
21217280
'Bug: Invalid values are coming in variable on assigning valid values'
'#--------------------FN_DYNVARS_006_04-------------------------#'
SET @@global.binlog_cache_size = 1024;
Warnings:
Warning 1292 Truncated incorrect binlog_cache_size value: '1024'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4096
SET @@global.binlog_cache_size = 10000.01;
ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
SET @@global.binlog_cache_size = -1024;
Warnings:
Warning 1292 Truncated incorrect binlog_cache_size value: '0'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4096
SET @@global.binlog_cache_size = 42949672950;
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
42949668864
'Bug: Errors are not coming on assigning invalid values to variable'
SET @@global.binlog_cache_size = ON;
ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
SET @@global.binlog_cache_size = 'test';
ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
'#-------------------FN_DYNVARS_006_05----------------------------#'
SET @@session.binlog_cache_size = 0;
ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
'#----------------------FN_DYNVARS_006_06------------------------#'
SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size';
@@global.binlog_cache_size = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_006_07----------------------#'
SET @@global.binlog_cache_size = TRUE;
Warnings:
Warning 1292 Truncated incorrect binlog_cache_size value: '1'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4096
SET @@global.binlog_cache_size = FALSE;
Warnings:
Warning 1292 Truncated incorrect binlog_cache_size value: '0'
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
4096
'Bug: Errors are not coming on assigning TRUE/FALSE to variable'
'#---------------------FN_DYNVARS_006_08----------------------#'
SET @@global.binlog_cache_size = 1;
Warnings:
Warning 1292 Truncated incorrect binlog_cache_size value: '1'
SELECT @@binlog_cache_size = @@global.binlog_cache_size;
@@binlog_cache_size = @@global.binlog_cache_size
1
'#---------------------FN_DYNVARS_006_09----------------------#'
SET binlog_cache_size = 1;
ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
SET global.binlog_cache_size = 1;
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 'binlog_cache_size = 1' at line 1
SELECT global.binlog_cache_size;
ERROR 42S02: Unknown table 'global' in field list
SELECT binlog_cache_size = @@session.binlog_cache_size;
ERROR 42S22: Unknown column 'binlog_cache_size' in 'field list'
SET @@global.binlog_cache_size = @start_value;
SELECT @@global.binlog_cache_size;
@@global.binlog_cache_size
32768

View file

@ -0,0 +1,75 @@
'#---------------------BS_STVARS_002_01----------------------#'
SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
1
1 Expected
SELECT COUNT(@@SESSION.binlog_format);
COUNT(@@SESSION.binlog_format)
1
1 Expected
'#---------------------BS_STVARS_002_02----------------------#'
SET @@GLOBAL.binlog_format=1;
Expected error 'Read only variable'
Bug: Writeable static variable
SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
1
1 Expected
SET @@SESSION.binlog_format=1;
Expected error 'Read only variable'
Bug: Writeable static variable
SELECT COUNT(@@SESSION.binlog_format);
COUNT(@@SESSION.binlog_format)
1
1 Expected
'#---------------------BS_STVARS_002_03----------------------#'
SELECT @@GLOBAL.binlog_format = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='binlog_format';
@@GLOBAL.binlog_format = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='binlog_format';
COUNT(VARIABLE_VALUE)
1
1 Expected
'#---------------------BS_STVARS_002_04----------------------#'
SELECT @@SESSION.binlog_format = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='binlog_format';
@@SESSION.binlog_format = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@SESSION.binlog_format);
COUNT(@@SESSION.binlog_format)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='binlog_format';
COUNT(VARIABLE_VALUE)
1
1 Expected
'#---------------------BS_STVARS_002_05----------------------#'
SELECT COUNT(@@binlog_format);
COUNT(@@binlog_format)
1
1 Expected
SELECT COUNT(@@local.binlog_format);
COUNT(@@local.binlog_format)
1
1 Expected
SELECT COUNT(@@SESSION.binlog_format);
COUNT(@@SESSION.binlog_format)
1
1 Expected
SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
1
1 Expected

View file

@ -0,0 +1,154 @@
SET @start_global_value = @@global.bulk_insert_buffer_size;
SELECT @start_global_value;
@start_global_value
8388608
SET @start_session_value = @@session.bulk_insert_buffer_size;
SELECT @start_session_value;
@start_session_value
8388608
'#--------------------FN_DYNVARS_007_01-------------------------#'
SET @@global.bulk_insert_buffer_size = 100;
SET @@global.bulk_insert_buffer_size = DEFAULT;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
8388608
SET @@session.bulk_insert_buffer_size = 200;
SET @@session.bulk_insert_buffer_size = DEFAULT;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
8388608
'#--------------------FN_DYNVARS_007_02-------------------------#'
SET @@global.bulk_insert_buffer_size = @start_global_value;
SELECT @@global.bulk_insert_buffer_size = 8388608;
@@global.bulk_insert_buffer_size = 8388608
1
SET @@session.bulk_insert_buffer_size = @start_session_value;
SELECT @@session.bulk_insert_buffer_size = 8388608;
@@session.bulk_insert_buffer_size = 8388608
1
'#--------------------FN_DYNVARS_007_03-------------------------#'
SET @@global.bulk_insert_buffer_size = 0;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
0
SET @@global.bulk_insert_buffer_size = 1;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
1
SET @@global.bulk_insert_buffer_size = 4294967295;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
4294967295
SET @@global.bulk_insert_buffer_size = 429496;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
429496
'#--------------------FN_DYNVARS_007_04-------------------------#'
SET @@session.bulk_insert_buffer_size = 0;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
0
SET @@session.bulk_insert_buffer_size = 1;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
1
SET @@session.bulk_insert_buffer_size = 4294967295;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
4294967295
SET @@session.bulk_insert_buffer_size = 429496;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
429496
'#------------------FN_DYNVARS_007_05-----------------------#'
SET @@global.bulk_insert_buffer_size = 42949672950;
Warnings:
Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '42949672950'
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
4294967295
SET @@global.bulk_insert_buffer_size = -1024;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
0
SET @@global.bulk_insert_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
SET @@global.bulk_insert_buffer_size = ON;
ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
SET @@global.bulk_insert_buffer_size = 429496.10;
ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
SET @@session.bulk_insert_buffer_size = 42949672950;
Warnings:
Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '42949672950'
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
4294967295
SET @@session.bulk_insert_buffer_size = -2;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
0
'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@session.bulk_insert_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
SET @@session.bulk_insert_buffer_size = 429496.10;
ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
'#------------------FN_DYNVARS_007_06-----------------------#'
SELECT @@global.bulk_insert_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='bulk_insert_buffer_size';
@@global.bulk_insert_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_007_07-----------------------#'
SELECT @@session.bulk_insert_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='bulk_insert_buffer_size';
@@session.bulk_insert_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_007_08-----------------------#'
SET @@global.bulk_insert_buffer_size = TRUE;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
1
SET @@global.bulk_insert_buffer_size = FALSE;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
0
SET @@session.bulk_insert_buffer_size = TRUE;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
1
SET @@session.bulk_insert_buffer_size = FALSE;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
0
'#---------------------FN_DYNVARS_007_09----------------------#'
SET @@bulk_insert_buffer_size = 100;
SELECT @@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size;
@@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size
1
SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
@@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size
1
'#---------------------FN_DYNVARS_007_10----------------------#'
SET bulk_insert_buffer_size = 1;
SELECT @@bulk_insert_buffer_size;
@@bulk_insert_buffer_size
1
SET local.bulk_insert_buffer_size = 1;
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 'bulk_insert_buffer_size = 1' at line 1
SELECT local.bulk_insert_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
SET session.bulk_insert_buffer_size = 1;
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 'bulk_insert_buffer_size = 1' at line 1
SELECT session.bulk_insert_buffer_size;
ERROR 42S02: Unknown table 'session' in field list
SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
ERROR 42S22: Unknown column 'bulk_insert_buffer_size' in 'field list'
SET @@global.bulk_insert_buffer_size = @start_global_value;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
8388608
SET @@session.bulk_insert_buffer_size = @start_session_value;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
8388608

View file

@ -0,0 +1,150 @@
SET @start_global_value = @@global.bulk_insert_buffer_size;
SELECT @start_global_value;
@start_global_value
8388608
SET @start_session_value = @@session.bulk_insert_buffer_size;
SELECT @start_session_value;
@start_session_value
8388608
'#--------------------FN_DYNVARS_007_01-------------------------#'
SET @@global.bulk_insert_buffer_size = 100;
SET @@global.bulk_insert_buffer_size = DEFAULT;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
8388608
SET @@session.bulk_insert_buffer_size = 200;
SET @@session.bulk_insert_buffer_size = DEFAULT;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
8388608
'#--------------------FN_DYNVARS_007_02-------------------------#'
SET @@global.bulk_insert_buffer_size = @start_global_value;
SELECT @@global.bulk_insert_buffer_size = 8388608;
@@global.bulk_insert_buffer_size = 8388608
1
SET @@session.bulk_insert_buffer_size = @start_session_value;
SELECT @@session.bulk_insert_buffer_size = 8388608;
@@session.bulk_insert_buffer_size = 8388608
1
'#--------------------FN_DYNVARS_007_03-------------------------#'
SET @@global.bulk_insert_buffer_size = 0;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
0
SET @@global.bulk_insert_buffer_size = 1;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
1
SET @@global.bulk_insert_buffer_size = 4294967295;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
4294967295
SET @@global.bulk_insert_buffer_size = 429496;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
429496
'#--------------------FN_DYNVARS_007_04-------------------------#'
SET @@session.bulk_insert_buffer_size = 0;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
0
SET @@session.bulk_insert_buffer_size = 1;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
1
SET @@session.bulk_insert_buffer_size = 4294967295;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
4294967295
SET @@session.bulk_insert_buffer_size = 429496;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
429496
'#------------------FN_DYNVARS_007_05-----------------------#'
SET @@global.bulk_insert_buffer_size = 42949672950;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
42949672950
SET @@global.bulk_insert_buffer_size = -1024;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
0
SET @@global.bulk_insert_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
SET @@global.bulk_insert_buffer_size = ON;
ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
SET @@global.bulk_insert_buffer_size = 429496.10;
ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
SET @@session.bulk_insert_buffer_size = 42949672950;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
42949672950
SET @@session.bulk_insert_buffer_size = -2;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
0
'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@session.bulk_insert_buffer_size = test;
ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
SET @@session.bulk_insert_buffer_size = 429496.10;
ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
'#------------------FN_DYNVARS_007_06-----------------------#'
SELECT @@global.bulk_insert_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='bulk_insert_buffer_size';
@@global.bulk_insert_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_007_07-----------------------#'
SELECT @@session.bulk_insert_buffer_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='bulk_insert_buffer_size';
@@session.bulk_insert_buffer_size = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_007_08-----------------------#'
SET @@global.bulk_insert_buffer_size = TRUE;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
1
SET @@global.bulk_insert_buffer_size = FALSE;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
0
SET @@session.bulk_insert_buffer_size = TRUE;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
1
SET @@session.bulk_insert_buffer_size = FALSE;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
0
'#---------------------FN_DYNVARS_007_09----------------------#'
SET @@bulk_insert_buffer_size = 100;
SELECT @@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size;
@@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size
1
SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
@@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size
1
'#---------------------FN_DYNVARS_007_10----------------------#'
SET bulk_insert_buffer_size = 1;
SELECT @@bulk_insert_buffer_size;
@@bulk_insert_buffer_size
1
SET local.bulk_insert_buffer_size = 1;
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 'bulk_insert_buffer_size = 1' at line 1
SELECT local.bulk_insert_buffer_size;
ERROR 42S02: Unknown table 'local' in field list
SET session.bulk_insert_buffer_size = 1;
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 'bulk_insert_buffer_size = 1' at line 1
SELECT session.bulk_insert_buffer_size;
ERROR 42S02: Unknown table 'session' in field list
SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
ERROR 42S22: Unknown column 'bulk_insert_buffer_size' in 'field list'
SET @@global.bulk_insert_buffer_size = @start_global_value;
SELECT @@global.bulk_insert_buffer_size;
@@global.bulk_insert_buffer_size
8388608
SET @@session.bulk_insert_buffer_size = @start_session_value;
SELECT @@session.bulk_insert_buffer_size;
@@session.bulk_insert_buffer_size
8388608

View file

@ -0,0 +1,509 @@
SET @global_start_value = @@global.character_set_client;
SELECT @global_start_value;
@global_start_value
latin1
SET @session_start_value = @@character_set_client;
SELECT @session_start_value;
@session_start_value
latin1
SET @session_start_value = @@local.character_set_client;
SELECT @session_start_value;
@session_start_value
latin1
SET @session_start_value = @@session.character_set_client;
SELECT @session_start_value;
@session_start_value
latin1
'#--------------------FN_DYNVARS_010_01------------------#'
SELECT character_set_client;
ERROR 42S22: Unknown column 'character_set_client' in 'field list'
SET character_set_client=utf8;
SELECT @@session.character_set_client;
@@session.character_set_client
utf8
SET global.character_set_client=utf8;
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 'character_set_client=utf8' at line 1
SET session character_set_client=utf8;
SELECT session character_set_client;
ERROR 42S22: Unknown column 'session' in 'field list'
SET global character_set_client=utf8;
SELECT global character_set_client;
ERROR 42S22: Unknown column 'global' in 'field list'
'#--------------------FN_DYNVARS_010_02-------------------------#'
SET @@character_set_client = latin5;
SET @@character_set_client = DEFAULT;
SELECT @@character_set_client AS DEFAULT_VALUE;
DEFAULT_VALUE
utf8
SET @@global.character_set_client = latin5;
SET @@global.character_set_client = DEFAULT;
SELECT @@global.character_set_client;
@@global.character_set_client
latin1
'#--------------------FN_DYNVARS_010_03-------------------------#'
SET @@session.character_set_client = utf8;
SELECT @@session.character_set_client;
@@session.character_set_client
utf8
SET @@global.character_set_client = latin2;
SELECT @@global.character_set_client;
@@global.character_set_client
latin2
SELECT @@session.character_set_client AS res_is_utf8;
res_is_utf8
utf8
SET @@session.character_set_client = latin5;
SELECT @@session.character_set_client;
@@session.character_set_client
latin5
SELECT @@global.character_set_client AS res_is_latin2;
res_is_latin2
latin2
SELECT @@global.character_set_client=@@session.character_set_client
AS res_is_false;
res_is_false
0
'#--------------------FN_DYNVARS_010_04-------------------------#'
SELECT @@character_set_client = @@session.character_set_client AS res;
res
1
SELECT @@character_set_client = @@local.character_set_client AS res;
res
1
'#--------------------FN_DYNVARS_010_05-------------------------#'
SET @@character_set_client = utf8 + latin2;
ERROR 42S22: Unknown column 'utf8' in 'field list'
'#--------------------FN_DYNVARS_010_06-------------------------#'
SET @@character_set_client = big5;
SELECT @@character_set_client;
@@character_set_client
big5
SET @@character_set_client = dec8;
SELECT @@character_set_client;
@@character_set_client
dec8
SET @@character_set_client = cp850;
SELECT @@character_set_client;
@@character_set_client
cp850
SET @@character_set_client = hp8;
SELECT @@character_set_client;
@@character_set_client
hp8
SET @@character_set_client = koi8r;
SELECT @@character_set_client;
@@character_set_client
koi8r
SET @@character_set_client = latin1;
SELECT @@character_set_client;
@@character_set_client
latin1
SET @@character_set_client = latin2;
SELECT @@character_set_client;
@@character_set_client
latin2
SET @@character_set_client = swe7;
SELECT @@character_set_client;
ÉÉcharacter_set_client
swe7
SET @@character_set_client = ascii;
SELECT @@character_set_client;
@@character_set_client
ascii
SET @@character_set_client = ujis;
SELECT @@character_set_client;
@@character_set_client
ujis
SET @@character_set_client = sjis;
SELECT @@character_set_client;
@@character_set_client
sjis
SET @@character_set_client = hebrew;
SELECT @@character_set_client;
@@character_set_client
hebrew
SET @@character_set_client = tis620;
SELECT @@character_set_client;
@@character_set_client
tis620
SET @@character_set_client = euckr;
SELECT @@character_set_client;
@@character_set_client
euckr
SET @@character_set_client = koi8u;
SELECT @@character_set_client;
@@character_set_client
koi8u
SET @@character_set_client = gb2312;
SELECT @@character_set_client;
@@character_set_client
gb2312
SET @@character_set_client = greek;
SELECT @@character_set_client;
@@character_set_client
greek
SET @@character_set_client = cp1250;
SELECT @@character_set_client;
@@character_set_client
cp1250
SET @@character_set_client = gbk;
SELECT @@character_set_client;
@@character_set_client
gbk
SET @@character_set_client = latin5;
SELECT @@character_set_client;
@@character_set_client
latin5
SET @@character_set_client = armscii8;
SELECT @@character_set_client;
@@character_set_client
armscii8
SET @@character_set_client = utf8;
SELECT @@character_set_client;
@@character_set_client
utf8
'Bug: Assignment of ucs2 to session character-set does not raise error';
'but selecting variable after setting it does.';
'Even catching this does not allow any further character-set to be set.';
'Offending querry seems to be:';
'SET @@character_set_client = ucs2;'
SET @@character_set_client = cp866;
SELECT @@character_set_client;
@@character_set_client
cp866
SET @@character_set_client = keybcs2;
SELECT @@character_set_client;
@@character_set_client
keybcs2
SET @@character_set_client = macce;
SELECT @@character_set_client;
@@character_set_client
macce
SET @@character_set_client = macroman;
SELECT @@character_set_client;
@@character_set_client
macroman
SET @@character_set_client = cp852;
SELECT @@character_set_client;
@@character_set_client
cp852
SET @@character_set_client = latin7;
SELECT @@character_set_client;
@@character_set_client
latin7
SET @@character_set_client = cp1251;
SELECT @@character_set_client;
@@character_set_client
cp1251
SET @@character_set_client = cp1256;
SELECT @@character_set_client;
@@character_set_client
cp1256
SET @@character_set_client = cp1257;
SELECT @@character_set_client;
@@character_set_client
cp1257
SET @@character_set_client = binary;
SELECT @@character_set_client;
@@character_set_client
binary
SET @@character_set_client = geostd8;
SELECT @@character_set_client;
@@character_set_client
geostd8
SET @@character_set_client = cp932;
SELECT @@character_set_client;
@@character_set_client
cp932
SET @@character_set_client = eucjpms;
SELECT @@character_set_client;
@@character_set_client
eucjpms
'#--------------------FN_DYNVARS_010_07-------------------------#'
SET @@global.character_set_client = big5;
SELECT @@global.character_set_client;
@@global.character_set_client
big5
SET @@global.character_set_client = dec8;
SELECT @@global.character_set_client;
@@global.character_set_client
dec8
SET @@global.character_set_client = cp850;
SELECT @@global.character_set_client;
@@global.character_set_client
cp850
SET @@global.character_set_client = hp8;
SELECT @@global.character_set_client;
@@global.character_set_client
hp8
SET @@global.character_set_client = koi8r;
SELECT @@global.character_set_client;
@@global.character_set_client
koi8r
SET @@global.character_set_client = latin1;
SELECT @@global.character_set_client;
@@global.character_set_client
latin1
SET @@global.character_set_client = latin2;
SELECT @@global.character_set_client;
@@global.character_set_client
latin2
SET @@global.character_set_client = swe7;
SELECT @@global.character_set_client;
@@global.character_set_client
swe7
SET @@global.character_set_client = ascii;
SELECT @@global.character_set_client;
@@global.character_set_client
ascii
SET @@global.character_set_client = ujis;
SELECT @@global.character_set_client;
@@global.character_set_client
ujis
SET @@global.character_set_client = sjis;
SELECT @@global.character_set_client;
@@global.character_set_client
sjis
SET @@global.character_set_client = hebrew;
SELECT @@global.character_set_client;
@@global.character_set_client
hebrew
SET @@global.character_set_client = tis620;
SELECT @@global.character_set_client;
@@global.character_set_client
tis620
SET @@global.character_set_client = euckr;
SELECT @@global.character_set_client;
@@global.character_set_client
euckr
SET @@global.character_set_client = koi8u;
SELECT @@global.character_set_client;
@@global.character_set_client
koi8u
SET @@global.character_set_client = gb2312;
SELECT @@global.character_set_client;
@@global.character_set_client
gb2312
SET @@global.character_set_client = greek;
SELECT @@global.character_set_client;
@@global.character_set_client
greek
SET @@global.character_set_client = cp1250;
SELECT @@global.character_set_client;
@@global.character_set_client
cp1250
SET @@global.character_set_client = gbk;
SELECT @@global.character_set_client;
@@global.character_set_client
gbk
SET @@global.character_set_client = latin5;
SELECT @@global.character_set_client;
@@global.character_set_client
latin5
SET @@global.character_set_client = armscii8;
SELECT @@global.character_set_client;
@@global.character_set_client
armscii8
SET @@global.character_set_client = utf8;
SELECT @@global.character_set_client;
@@global.character_set_client
utf8
SET @@global.character_set_client = ucs2;
SELECT @@global.character_set_client;
@@global.character_set_client
utf8
SET @@global.character_set_client = cp866;
SELECT @@global.character_set_client;
@@global.character_set_client
cp866
SET @@global.character_set_client = keybcs2;
SELECT @@global.character_set_client;
@@global.character_set_client
keybcs2
SET @@global.character_set_client = macce;
SELECT @@global.character_set_client;
@@global.character_set_client
macce
SET @@global.character_set_client = macroman;
SELECT @@global.character_set_client;
@@global.character_set_client
macroman
SET @@global.character_set_client = cp852;
SELECT @@global.character_set_client;
@@global.character_set_client
cp852
SET @@global.character_set_client = latin7;
SELECT @@global.character_set_client;
@@global.character_set_client
latin7
SET @@global.character_set_client = cp1251;
SELECT @@global.character_set_client;
@@global.character_set_client
cp1251
SET @@global.character_set_client = cp1256;
SELECT @@global.character_set_client;
@@global.character_set_client
cp1256
SET @@global.character_set_client = cp1257;
SELECT @@global.character_set_client;
@@global.character_set_client
cp1257
SET @@global.character_set_client = binary;
SELECT @@global.character_set_client;
@@global.character_set_client
binary
SET @@global.character_set_client = geostd8;
SELECT @@global.character_set_client;
@@global.character_set_client
geostd8
SET @@global.character_set_client = cp932;
SELECT @@global.character_set_client;
@@global.character_set_client
cp932
SET @@global.character_set_client = eucjpms;
SELECT @@global.character_set_client;
@@global.character_set_client
eucjpms
'#--------------------FN_DYNVARS_010_08-------------------------#'
SET @@character_set_client = UTF8;
SELECT @@character_set_client;
@@character_set_client
utf8
SET @@character_set_client = utf8;
SELECT @@character_set_client;
@@character_set_client
utf8
SET @@global.character_set_client = uTf8;
SELECT @@global.character_set_client;
@@global.character_set_client
utf8
'#--------------------FN_DYNVARS_010_09-------------------------#'
SET @@character_set_client = 1;
SELECT @@character_set_client;
@@character_set_client
big5
SET @@character_set_client = 2;
SELECT @@character_set_client;
@@character_set_client
latin2
SET @@character_set_client = 3;
SELECT @@character_set_client;
@@character_set_client
dec8
SET @@character_set_client = 36;
SELECT @@character_set_client;
@@character_set_client
cp866
SET @@character_set_client = 99;
SELECT @@character_set_client;
@@character_set_client
cp1250
SET @@character_set_client = 100;
ERROR 42000: Unknown character set: '100'
SET @@global.character_set_client = 1;
SELECT @@global.character_set_client;
@@global.character_set_client
big5
SET @@global.character_set_client = 2;
SELECT @@global.character_set_client;
@@global.character_set_client
latin2
SET @@global.character_set_client = 3;
SELECT @@global.character_set_client;
@@global.character_set_client
dec8
SET @@global.character_set_client = 36;
SELECT @@global.character_set_client;
@@global.character_set_client
cp866
SET @@global.character_set_client = 99;
SELECT @@global.character_set_client;
@@global.character_set_client
cp1250
SET @@global.character_set_client = 100;
ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
36
'Bug # 34843: character sets are mapped in such a way that 100 and following';
'numbers gives error, and before 100 the 36 mapped wraps arround';
'several times.';
'#--------------------FN_DYNVARS_010_10-------------------------#'
SET @@character_set_client = abc;
ERROR 42000: Unknown character set: 'abc'
SET @@character_set_client = 1utf8;
ERROR 42000: Unknown character set: '1utf8'
SET @@character_set_client = 0;
ERROR 42000: Unknown character set: '0'
SET @@character_set_client = 1.1;
ERROR 42000: Incorrect argument type to variable 'character_set_client'
SET @@character_set_client = -1;
ERROR 42000: Unknown character set: '-1'
SET @@character_set_client = '';
ERROR 42000: Unknown character set: ''
SET @@character_set_client = 'utf';
ERROR 42000: Unknown character set: 'utf'
SET @@character_set_client = true;
SELECT @@character_set_client AS res_with_true;
res_with_true
big5
SET @@character_set_client = ON;
ERROR 42000: Unknown character set: 'ON'
'#--------------------FN_DYNVARS_010_11-------------------------#'
SET @@global.character_set_client = abc;
ERROR 42000: Unknown character set: 'abc'
SET @@global.character_set_client = 1utf8;
ERROR 42000: Unknown character set: '1utf8'
SET @@global.character_set_client = 0;
ERROR 42000: Unknown character set: '0'
SET @@global.character_set_client = 1.1;
ERROR 42000: Incorrect argument type to variable 'character_set_client'
SET @@global.character_set_client = -1;
ERROR 42000: Unknown character set: '-1'
SET @@global.character_set_client = '';
ERROR 42000: Unknown character set: ''
SET @@global.character_set_client = 'utf';
ERROR 42000: Unknown character set: 'utf'
SET @@global.character_set_client = true;
SET @@global.character_set_client = ON;
ERROR 42000: Unknown character set: 'ON'
'#--------------------FN_DYNVARS_010_12-------------------------#'
SELECT @@global.character_set_client =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='character_set_client') AS res;
res
1
SET @@global.character_set_client = 1;
SELECT @@global.character_set_client;
@@global.character_set_client
big5
SELECT @@global.character_set_client =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='character_set_client') AS res;
res
1
'#--------------------FN_DYNVARS_010_13-------------------------#'
SELECT @@character_set_client =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_client') AS res;
res
1
SELECT @@local.character_set_client =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_client') AS res;
res
1
SELECT @@session.character_set_client =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_client') AS res;
res
1
SET @@global.character_set_client = @global_start_value;
SELECT @@global.character_set_client;
@@global.character_set_client
latin1
SET @@session.character_set_client = @session_start_value;
SELECT @@session.character_set_client;
@@session.character_set_client
latin1

View file

@ -0,0 +1,38 @@
'#--------------------FN_DYNVARS_010_01-------------------------#'
SET @global_character_set_client = @@global.character_set_client;
SET @session_character_set_client = @@session.character_set_client;
SET @@global.character_set_client = utf8;
'connect (con1,localhost,root,,,,)'
'connection con1'
SELECT @@global.character_set_client;
@@global.character_set_client
utf8
SELECT @@session.character_set_client;
@@session.character_set_client
latin1
'Bug# 35372: session character_set_client is not effected by global character_set_client'
'#--------------------FN_DYNVARS_010_02-------------------------#'
'connection default'
SHOW VARIABLES like 'character_set_client';
Variable_name Value
character_set_client latin1
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a CHAR(3) character set utf8);
'---verifying character_set_client with a utf8 character----'
'For latin1 characterset';
SET @@session.character_set_client = latin1;
INSERT INTO t1 values('è');
SELECT a,CHAR_LENGTH(a) FROM t1;
a CHAR_LENGTH(a)
è 2
DELETE FROM t1;
'For utf8 characterset';
SET @@session.character_set_client = utf8;
INSERT INTO t1 values('è');
SELECT a,CHAR_LENGTH(a) FROM t1;
a CHAR_LENGTH(a)
 1
DELETE FROM t1;
DROP TABLE IF EXISTS t1;
SET @@global.character_set_client = @global_character_set_client;
SET @@session.character_set_client = @session_character_set_client;

View file

@ -0,0 +1,508 @@
SET @global_start_value = @@global.character_set_connection;
SELECT @global_start_value;
@global_start_value
latin1
SET @session_start_value = @@character_set_connection;
SELECT @session_start_value;
@session_start_value
latin1
SET @session_start_value = @@local.character_set_connection;
SELECT @session_start_value;
@session_start_value
latin1
SET @session_start_value = @@session.character_set_connection;
SELECT @session_start_value;
@session_start_value
latin1
'#--------------------FN_DYNVARS_011_01------------------#'
SELECT character_set_connection;
ERROR 42S22: Unknown column 'character_set_connection' in 'field list'
SET character_set_connection=utf8;
SELECT @@session.character_set_connection;
@@session.character_set_connection
utf8
SET global.character_set_connection=utf8;
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 'character_set_connection=utf8' at line 1
SET session character_set_connection=utf8;
SELECT session character_set_connection;
ERROR 42S22: Unknown column 'session' in 'field list'
SET global character_set_connection=utf8;
SELECT global character_set_connection;
ERROR 42S22: Unknown column 'global' in 'field list'
'#--------------------FN_DYNVARS_011_02-------------------------#'
SET @@character_set_connection = latin5;
SET @@character_set_connection = DEFAULT;
SELECT @@character_set_connection AS DEFAULT_VALUE;
DEFAULT_VALUE
utf8
SET @@global.character_set_connection = latin5;
SET @@global.character_set_connection = DEFAULT;
SELECT @@global.character_set_connection;
@@global.character_set_connection
latin1
'#--------------------FN_DYNVARS_011_03-------------------------#'
SET @@session.character_set_connection = utf8;
SELECT @@session.character_set_connection;
@@session.character_set_connection
utf8
SET @@global.character_set_connection = latin2;
SELECT @@global.character_set_connection;
@@global.character_set_connection
latin2
SELECT @@session.character_set_connection AS res_is_utf8;
res_is_utf8
utf8
SET @@session.character_set_connection = latin5;
SELECT @@session.character_set_connection;
@@session.character_set_connection
latin5
SELECT @@global.character_set_connection AS res_is_latin2;
res_is_latin2
latin2
SELECT @@global.character_set_connection=@@session.character_set_connection
AS res_is_false;
res_is_false
0
'#--------------------FN_DYNVARS_011_04-------------------------#'
SELECT @@character_set_connection = @@session.character_set_connection AS res;
res
1
SELECT @@character_set_connection = @@local.character_set_connection AS res;
res
1
'#--------------------FN_DYNVARS_011_05-------------------------#'
SET @@character_set_connection = utf8 + latin2;
ERROR 42S22: Unknown column 'utf8' in 'field list'
'#--------------------FN_DYNVARS_011_06-------------------------#'
SET @@session.character_set_connection = big5;
SELECT @@session.character_set_connection;
@@session.character_set_connection
big5
SET @@session.character_set_connection = dec8;
SELECT @@session.character_set_connection;
@@session.character_set_connection
dec8
SET @@session.character_set_connection = cp850;
SELECT @@session.character_set_connection;
@@session.character_set_connection
cp850
SET @@session.character_set_connection = hp8;
SELECT @@session.character_set_connection;
@@session.character_set_connection
hp8
SET @@session.character_set_connection = koi8r;
SELECT @@session.character_set_connection;
@@session.character_set_connection
koi8r
SET @@session.character_set_connection = latin1;
SELECT @@session.character_set_connection;
@@session.character_set_connection
latin1
SET @@session.character_set_connection = latin2;
SELECT @@session.character_set_connection;
@@session.character_set_connection
latin2
SET @@session.character_set_connection = swe7;
SELECT @@session.character_set_connection;
@@session.character_set_connection
swe7
SET @@session.character_set_connection = ascii;
SELECT @@session.character_set_connection;
@@session.character_set_connection
ascii
SET @@session.character_set_connection = ujis;
SELECT @@session.character_set_connection;
@@session.character_set_connection
ujis
SET @@session.character_set_connection = sjis;
SELECT @@session.character_set_connection;
@@session.character_set_connection
sjis
SET @@session.character_set_connection = hebrew;
SELECT @@session.character_set_connection;
@@session.character_set_connection
hebrew
SET @@session.character_set_connection = tis620;
SELECT @@session.character_set_connection;
@@session.character_set_connection
tis620
SET @@session.character_set_connection = euckr;
SELECT @@session.character_set_connection;
@@session.character_set_connection
euckr
SET @@session.character_set_connection = koi8u;
SELECT @@session.character_set_connection;
@@session.character_set_connection
koi8u
SET @@session.character_set_connection = gb2312;
SELECT @@session.character_set_connection;
@@session.character_set_connection
gb2312
SET @@session.character_set_connection = greek;
SELECT @@session.character_set_connection;
@@session.character_set_connection
greek
SET @@session.character_set_connection = cp1250;
SELECT @@session.character_set_connection;
@@session.character_set_connection
cp1250
SET @@session.character_set_connection = gbk;
SELECT @@session.character_set_connection;
@@session.character_set_connection
gbk
SET @@session.character_set_connection = latin5;
SELECT @@session.character_set_connection;
@@session.character_set_connection
latin5
SET @@session.character_set_connection = armscii8;
SELECT @@session.character_set_connection;
@@session.character_set_connection
armscii8
SET @@session.character_set_connection = utf8;
SELECT @@session.character_set_connection;
@@session.character_set_connection
utf8
SET @@session.character_set_connection = ucs2;
SELECT @@session.character_set_connection;
@@session.character_set_connection
ucs2
SET @@session.character_set_connection = cp866;
SELECT @@session.character_set_connection;
@@session.character_set_connection
cp866
SET @@session.character_set_connection = keybcs2;
SELECT @@session.character_set_connection;
@@session.character_set_connection
keybcs2
SET @@session.character_set_connection = macce;
SELECT @@session.character_set_connection;
@@session.character_set_connection
macce
SET @@session.character_set_connection = macroman;
SELECT @@session.character_set_connection;
@@session.character_set_connection
macroman
SET @@session.character_set_connection = cp852;
SELECT @@session.character_set_connection;
@@session.character_set_connection
cp852
SET @@session.character_set_connection = latin7;
SELECT @@session.character_set_connection;
@@session.character_set_connection
latin7
SET @@session.character_set_connection = cp1251;
SELECT @@session.character_set_connection;
@@session.character_set_connection
cp1251
SET @@session.character_set_connection = cp1256;
SELECT @@session.character_set_connection;
@@session.character_set_connection
cp1256
SET @@session.character_set_connection = cp1257;
SELECT @@session.character_set_connection;
@@session.character_set_connection
cp1257
SET @@session.character_set_connection = binary;
SELECT @@session.character_set_connection;
@@session.character_set_connection
binary
SET @@session.character_set_connection = geostd8;
SELECT @@session.character_set_connection;
@@session.character_set_connection
geostd8
SET @@session.character_set_connection = cp932;
SELECT @@session.character_set_connection;
@@session.character_set_connection
cp932
SET @@session.character_set_connection = eucjpms;
SELECT @@session.character_set_connection;
@@session.character_set_connection
eucjpms
'#--------------------FN_DYNVARS_011_07-------------------------#'
SET @@global.character_set_connection = big5;
SELECT @@global.character_set_connection;
@@global.character_set_connection
big5
SET @@global.character_set_connection = dec8;
SELECT @@global.character_set_connection;
@@global.character_set_connection
dec8
SET @@global.character_set_connection = cp850;
SELECT @@global.character_set_connection;
@@global.character_set_connection
cp850
SET @@global.character_set_connection = hp8;
SELECT @@global.character_set_connection;
@@global.character_set_connection
hp8
SET @@global.character_set_connection = koi8r;
SELECT @@global.character_set_connection;
@@global.character_set_connection
koi8r
SET @@global.character_set_connection = latin1;
SELECT @@global.character_set_connection;
@@global.character_set_connection
latin1
SET @@global.character_set_connection = latin2;
SELECT @@global.character_set_connection;
@@global.character_set_connection
latin2
SET @@global.character_set_connection = swe7;
SELECT @@global.character_set_connection;
@@global.character_set_connection
swe7
SET @@global.character_set_connection = ascii;
SELECT @@global.character_set_connection;
@@global.character_set_connection
ascii
SET @@global.character_set_connection = ujis;
SELECT @@global.character_set_connection;
@@global.character_set_connection
ujis
SET @@global.character_set_connection = sjis;
SELECT @@global.character_set_connection;
@@global.character_set_connection
sjis
SET @@global.character_set_connection = hebrew;
SELECT @@global.character_set_connection;
@@global.character_set_connection
hebrew
SET @@global.character_set_connection = tis620;
SELECT @@global.character_set_connection;
@@global.character_set_connection
tis620
SET @@global.character_set_connection = euckr;
SELECT @@global.character_set_connection;
@@global.character_set_connection
euckr
SET @@global.character_set_connection = koi8u;
SELECT @@global.character_set_connection;
@@global.character_set_connection
koi8u
SET @@global.character_set_connection = gb2312;
SELECT @@global.character_set_connection;
@@global.character_set_connection
gb2312
SET @@global.character_set_connection = greek;
SELECT @@global.character_set_connection;
@@global.character_set_connection
greek
SET @@global.character_set_connection = cp1250;
SELECT @@global.character_set_connection;
@@global.character_set_connection
cp1250
SET @@global.character_set_connection = gbk;
SELECT @@global.character_set_connection;
@@global.character_set_connection
gbk
SET @@global.character_set_connection = latin5;
SELECT @@global.character_set_connection;
@@global.character_set_connection
latin5
SET @@global.character_set_connection = armscii8;
SELECT @@global.character_set_connection;
@@global.character_set_connection
armscii8
SET @@global.character_set_connection = utf8;
SELECT @@global.character_set_connection;
@@global.character_set_connection
utf8
SET @@global.character_set_connection = ucs2;
SELECT @@global.character_set_connection;
@@global.character_set_connection
ucs2
SET @@global.character_set_connection = cp866;
SELECT @@global.character_set_connection;
@@global.character_set_connection
cp866
SET @@global.character_set_connection = keybcs2;
SELECT @@global.character_set_connection;
@@global.character_set_connection
keybcs2
SET @@global.character_set_connection = macce;
SELECT @@global.character_set_connection;
@@global.character_set_connection
macce
SET @@global.character_set_connection = macroman;
SELECT @@global.character_set_connection;
@@global.character_set_connection
macroman
SET @@global.character_set_connection = cp852;
SELECT @@global.character_set_connection;
@@global.character_set_connection
cp852
SET @@global.character_set_connection = latin7;
SELECT @@global.character_set_connection;
@@global.character_set_connection
latin7
SET @@global.character_set_connection = cp1251;
SELECT @@global.character_set_connection;
@@global.character_set_connection
cp1251
SET @@global.character_set_connection = cp1256;
SELECT @@global.character_set_connection;
@@global.character_set_connection
cp1256
SET @@global.character_set_connection = cp1257;
SELECT @@global.character_set_connection;
@@global.character_set_connection
cp1257
SET @@global.character_set_connection = binary;
SELECT @@global.character_set_connection;
@@global.character_set_connection
binary
SET @@global.character_set_connection = geostd8;
SELECT @@global.character_set_connection;
@@global.character_set_connection
geostd8
SET @@global.character_set_connection = cp932;
SELECT @@global.character_set_connection;
@@global.character_set_connection
cp932
SET @@global.character_set_connection = eucjpms;
SELECT @@global.character_set_connection;
@@global.character_set_connection
eucjpms
'#--------------------FN_DYNVARS_011_08-------------------------#'
SET @@character_set_connection = UTF8;
SELECT @@character_set_connection;
@@character_set_connection
utf8
SET @@character_set_connection = utf8;
SELECT @@character_set_connection;
@@character_set_connection
utf8
SET @@global.character_set_connection = uTf8;
SELECT @@global.character_set_connection;
@@global.character_set_connection
utf8
'#--------------------FN_DYNVARS_011_09-------------------------#'
SET @@character_set_connection = 1;
SELECT @@character_set_connection;
@@character_set_connection
big5
SET @@character_set_connection = 2;
SELECT @@character_set_connection;
@@character_set_connection
latin2
SET @@character_set_connection = 3;
SELECT @@character_set_connection;
@@character_set_connection
dec8
SET @@character_set_connection = 36;
SELECT @@character_set_connection;
@@character_set_connection
cp866
SET @@character_set_connection = 99;
SELECT @@character_set_connection;
@@character_set_connection
cp1250
SET @@character_set_connection = 100;
ERROR 42000: Unknown character set: '100'
SET @@global.character_set_connection = 1;
SELECT @@global.character_set_connection;
@@global.character_set_connection
big5
SET @@global.character_set_connection = 2;
SELECT @@global.character_set_connection;
@@global.character_set_connection
latin2
SET @@global.character_set_connection = 3;
SELECT @@global.character_set_connection;
@@global.character_set_connection
dec8
SET @@global.character_set_connection = 36;
SELECT @@global.character_set_connection;
@@global.character_set_connection
cp866
SET @@global.character_set_connection = 99;
SELECT @@global.character_set_connection;
@@global.character_set_connection
cp1250
SET @@global.character_set_connection = 100;
ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
36
'Bug # 34843: character sets are mapped in such a way that 100 and following ';
'numbers gives error, and before 100 the 36 mapped wraps arround';
'several times.';
'#--------------------FN_DYNVARS_011_10-------------------------#'
SET @@character_set_connection = abc;
ERROR 42000: Unknown character set: 'abc'
SET @@character_set_connection = 1utf8;
ERROR 42000: Unknown character set: '1utf8'
SET @@character_set_connection = 0;
ERROR 42000: Unknown character set: '0'
SET @@character_set_connection = 1.1;
ERROR 42000: Incorrect argument type to variable 'character_set_connection'
SET @@character_set_connection = -1;
ERROR 42000: Unknown character set: '-1'
SET @@character_set_connection = 'utf8 ';
ERROR 42000: Unknown character set: 'utf8 '
SET @@character_set_connection = 'lätin2';
ERROR 42000: Unknown character set: 'lätin2'
SET @@character_set_connection = true;
SELECT @@character_set_connection AS res_with_true;
res_with_true
big5
SET @@character_set_connection = ON;
ERROR 42000: Unknown character set: 'ON'
'#--------------------FN_DYNVARS_011_11-------------------------#'
SET @@global.character_set_connection = abc;
ERROR 42000: Unknown character set: 'abc'
SET @@global.character_set_connection = 1utf8;
ERROR 42000: Unknown character set: '1utf8'
SET @@global.character_set_connection = 0;
ERROR 42000: Unknown character set: '0'
SET @@global.character_set_connection = 1.1;
ERROR 42000: Incorrect argument type to variable 'character_set_connection'
SET @@global.character_set_connection = -1;
ERROR 42000: Unknown character set: '-1'
SET @@global.character_set_connection = '';
ERROR 42000: Unknown character set: ''
SET @@global.character_set_connection = 'utf';
ERROR 42000: Unknown character set: 'utf'
SET @@global.character_set_connection = true;
SET @@global.character_set_connection = ON;
ERROR 42000: Unknown character set: 'ON'
'#--------------------FN_DYNVARS_011_12-------------------------#'
SELECT @@global.character_set_connection =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='character_set_connection') AS res;
res
1
SET @@global.character_set_connection = 1;
SELECT @@global.character_set_connection;
@@global.character_set_connection
big5
SELECT @@global.character_set_connection =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='character_set_connection') AS res;
res
1
'#--------------------FN_DYNVARS_011_13-------------------------#'
SELECT @@character_set_connection =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_connection') AS res;
res
1
SELECT @@local.character_set_connection =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_connection') AS res;
res
1
SELECT @@session.character_set_connection =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_connection') AS res;
res
1
SET @@global.character_set_connection = @global_start_value;
SELECT @@global.character_set_connection;
@@global.character_set_connection
latin1
SET @@session.character_set_connection = @session_start_value;
SELECT @@session.character_set_connection;
@@session.character_set_connection
latin1

View file

@ -0,0 +1,55 @@
'#--------------------FN_DYNVARS_011_01-------------------------#'
SET @global_character_set_connection = @@global.character_set_connection;
SET @session_character_set_connection = @@session.character_set_connection;
SET @session_character_set_client = @@session.character_set_client;
SET @session_character_set_results = @@session.character_set_results;
SET @@global.character_set_connection = utf8;
'connect (con1,localhost,root,,,,)'
'connection con1'
SELECT @@global.character_set_connection;
@@global.character_set_connection
utf8
SELECT @@session.character_set_connection;
@@session.character_set_connection
utf8
'#--------------------FN_DYNVARS_011_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(b CHAR(40) character set utf8);
'--verify that character_set_connection converts character_set_client--'
SET @@session.character_set_client = utf8;
SET @@session.character_set_results = utf8;
SET @@session.character_set_connection = latin1;
SELECT 'ЁЂЃЄ' AS utf_text;
utf_text
????
SET @@session.character_set_connection = utf8;
SELECT 'ЁЂЃЄ' AS utf_text;
utf_text
ЁЂЃЄ
'---now inserting utf8 string with different character_set_connection--'
SET @@session.character_set_connection = ascii;
INSERT INTO t1 VALUES('ЁЂЃЄ');
SELECT * FROM t1;
b
????
TRUNCATE TABLE t1;
'--now client & results charset in latin1 & connection charset in ascii-'
SET @@session.character_set_connection = ascii;
SET @@session.character_set_client = latin1;
SET @@session.character_set_results = latin1;
INSERT INTO t1 VALUES('ЁЂЃЄ');
SELECT * FROM t1;
b
????????
TRUNCATE TABLE t1;
SET NAMES utf8;
INSERT INTO t1 VALUES('ЁЂЃЄ');
SELECT * FROM t1;
b
ЁЂЃЄ
TRUNCATE TABLE t1;
SET @@global.character_set_connection = @global_character_set_connection;
SET @@session.character_set_connection = @session_character_set_connection;
SET @@session.character_set_client = @session_character_set_client;
SET @@session.character_set_results = @session_character_set_results;

View file

@ -0,0 +1,507 @@
SET @global_start_value = @@global.character_set_database;
SELECT @global_start_value;
@global_start_value
latin1
SET @session_start_value = @@character_set_database;
SELECT @session_start_value;
@session_start_value
latin1
SET @session_start_value = @@local.character_set_database;
SELECT @session_start_value;
@session_start_value
latin1
SET @session_start_value = @@session.character_set_database;
SELECT @session_start_value;
@session_start_value
latin1
'#--------------------FN_DYNVARS_012_01------------------#'
SELECT character_set_database;
ERROR 42S22: Unknown column 'character_set_database' in 'field list'
SET character_set_database=utf8;
SELECT @@session.character_set_database;
@@session.character_set_database
utf8
SET global.character_set_database=utf8;
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 'character_set_database=utf8' at line 1
SET session character_set_database=utf8;
SELECT session character_set_database;
ERROR 42S22: Unknown column 'session' in 'field list'
SET global character_set_database=utf8;
SELECT global character_set_database;
ERROR 42S22: Unknown column 'global' in 'field list'
'#--------------------FN_DYNVARS_012_02-------------------------#'
SET @@character_set_database = latin5;
SET @@character_set_database = DEFAULT;
SELECT @@character_set_database AS DEFAULT_VALUE;
DEFAULT_VALUE
latin1
SET @@global.character_set_database = latin5;
SET @@global.character_set_database = DEFAULT;
SELECT @@global.character_set_database;
@@global.character_set_database
latin1
'#--------------------FN_DYNVARS_012_03-------------------------#'
SET @@session.character_set_database = utf8;
SELECT @@session.character_set_database;
@@session.character_set_database
utf8
SET @@global.character_set_database = latin2;
SELECT @@global.character_set_database;
@@global.character_set_database
latin2
SELECT @@session.character_set_database AS res_is_utf8;
res_is_utf8
utf8
SET @@session.character_set_database = latin5;
SELECT @@session.character_set_database;
@@session.character_set_database
latin5
SELECT @@global.character_set_database AS res_is_latin2;
res_is_latin2
latin2
SELECT @@global.character_set_database=@@session.character_set_database
AS res_is_false;
res_is_false
0
'#--------------------FN_DYNVARS_012_04-------------------------#'
SELECT @@character_set_database = @@session.character_set_database AS res;
res
1
SELECT @@character_set_database = @@local.character_set_database AS res;
res
1
'#--------------------FN_DYNVARS_012_05-------------------------#'
SET @@character_set_database = utf8 + latin2;
ERROR 42S22: Unknown column 'utf8' in 'field list'
'#--------------------FN_DYNVARS_012_06-------------------------#'
SET @@session.character_set_database = big5;
SELECT @@session.character_set_database;
@@session.character_set_database
big5
SET @@session.character_set_database = dec8;
SELECT @@session.character_set_database;
@@session.character_set_database
dec8
SET @@session.character_set_database = cp850;
SELECT @@session.character_set_database;
@@session.character_set_database
cp850
SET @@session.character_set_database = hp8;
SELECT @@session.character_set_database;
@@session.character_set_database
hp8
SET @@session.character_set_database = koi8r;
SELECT @@session.character_set_database;
@@session.character_set_database
koi8r
SET @@session.character_set_database = latin1;
SELECT @@session.character_set_database;
@@session.character_set_database
latin1
SET @@session.character_set_database = latin2;
SELECT @@session.character_set_database;
@@session.character_set_database
latin2
SET @@session.character_set_database = swe7;
SELECT @@session.character_set_database;
@@session.character_set_database
swe7
SET @@session.character_set_database = ascii;
SELECT @@session.character_set_database;
@@session.character_set_database
ascii
SET @@session.character_set_database = ujis;
SELECT @@session.character_set_database;
@@session.character_set_database
ujis
SET @@session.character_set_database = sjis;
SELECT @@session.character_set_database;
@@session.character_set_database
sjis
SET @@session.character_set_database = hebrew;
SELECT @@session.character_set_database;
@@session.character_set_database
hebrew
SET @@session.character_set_database = tis620;
SELECT @@session.character_set_database;
@@session.character_set_database
tis620
SET @@session.character_set_database = euckr;
SELECT @@session.character_set_database;
@@session.character_set_database
euckr
SET @@session.character_set_database = koi8u;
SELECT @@session.character_set_database;
@@session.character_set_database
koi8u
SET @@session.character_set_database = gb2312;
SELECT @@session.character_set_database;
@@session.character_set_database
gb2312
SET @@session.character_set_database = greek;
SELECT @@session.character_set_database;
@@session.character_set_database
greek
SET @@session.character_set_database = cp1250;
SELECT @@session.character_set_database;
@@session.character_set_database
cp1250
SET @@session.character_set_database = gbk;
SELECT @@session.character_set_database;
@@session.character_set_database
gbk
SET @@session.character_set_database = latin5;
SELECT @@session.character_set_database;
@@session.character_set_database
latin5
SET @@session.character_set_database = armscii8;
SELECT @@session.character_set_database;
@@session.character_set_database
armscii8
SET @@session.character_set_database = utf8;
SELECT @@session.character_set_database;
@@session.character_set_database
utf8
SET @@session.character_set_database = ucs2;
SELECT @@session.character_set_database;
@@session.character_set_database
ucs2
SET @@session.character_set_database = cp866;
SELECT @@session.character_set_database;
@@session.character_set_database
cp866
SET @@session.character_set_database = keybcs2;
SELECT @@session.character_set_database;
@@session.character_set_database
keybcs2
SET @@session.character_set_database = macce;
SELECT @@session.character_set_database;
@@session.character_set_database
macce
SET @@session.character_set_database = macroman;
SELECT @@session.character_set_database;
@@session.character_set_database
macroman
SET @@session.character_set_database = cp852;
SELECT @@session.character_set_database;
@@session.character_set_database
cp852
SET @@session.character_set_database = latin7;
SELECT @@session.character_set_database;
@@session.character_set_database
latin7
SET @@session.character_set_database = cp1251;
SELECT @@session.character_set_database;
@@session.character_set_database
cp1251
SET @@session.character_set_database = cp1256;
SELECT @@session.character_set_database;
@@session.character_set_database
cp1256
SET @@session.character_set_database = cp1257;
SELECT @@session.character_set_database;
@@session.character_set_database
cp1257
SET @@session.character_set_database = binary;
SELECT @@session.character_set_database;
@@session.character_set_database
binary
SET @@session.character_set_database = geostd8;
SELECT @@session.character_set_database;
@@session.character_set_database
geostd8
SET @@session.character_set_database = cp932;
SELECT @@session.character_set_database;
@@session.character_set_database
cp932
SET @@session.character_set_database = eucjpms;
SELECT @@session.character_set_database;
@@session.character_set_database
eucjpms
'#--------------------FN_DYNVARS_012_07-------------------------#'
SET @@global.character_set_database = big5;
SELECT @@global.character_set_database;
@@global.character_set_database
big5
SET @@global.character_set_database = dec8;
SELECT @@global.character_set_database;
@@global.character_set_database
dec8
SET @@global.character_set_database = cp850;
SELECT @@global.character_set_database;
@@global.character_set_database
cp850
SET @@global.character_set_database = hp8;
SELECT @@global.character_set_database;
@@global.character_set_database
hp8
SET @@global.character_set_database = koi8r;
SELECT @@global.character_set_database;
@@global.character_set_database
koi8r
SET @@global.character_set_database = latin1;
SELECT @@global.character_set_database;
@@global.character_set_database
latin1
SET @@global.character_set_database = latin2;
SELECT @@global.character_set_database;
@@global.character_set_database
latin2
SET @@global.character_set_database = swe7;
SELECT @@global.character_set_database;
@@global.character_set_database
swe7
SET @@global.character_set_database = ascii;
SELECT @@global.character_set_database;
@@global.character_set_database
ascii
SET @@global.character_set_database = ujis;
SELECT @@global.character_set_database;
@@global.character_set_database
ujis
SET @@global.character_set_database = sjis;
SELECT @@global.character_set_database;
@@global.character_set_database
sjis
SET @@global.character_set_database = hebrew;
SELECT @@global.character_set_database;
@@global.character_set_database
hebrew
SET @@global.character_set_database = tis620;
SELECT @@global.character_set_database;
@@global.character_set_database
tis620
SET @@global.character_set_database = euckr;
SELECT @@global.character_set_database;
@@global.character_set_database
euckr
SET @@global.character_set_database = koi8u;
SELECT @@global.character_set_database;
@@global.character_set_database
koi8u
SET @@global.character_set_database = gb2312;
SELECT @@global.character_set_database;
@@global.character_set_database
gb2312
SET @@global.character_set_database = greek;
SELECT @@global.character_set_database;
@@global.character_set_database
greek
SET @@global.character_set_database = cp1250;
SELECT @@global.character_set_database;
@@global.character_set_database
cp1250
SET @@global.character_set_database = gbk;
SELECT @@global.character_set_database;
@@global.character_set_database
gbk
SET @@global.character_set_database = latin5;
SELECT @@global.character_set_database;
@@global.character_set_database
latin5
SET @@global.character_set_database = armscii8;
SELECT @@global.character_set_database;
@@global.character_set_database
armscii8
SET @@global.character_set_database = utf8;
SELECT @@global.character_set_database;
@@global.character_set_database
utf8
SET @@global.character_set_database = ucs2;
SELECT @@global.character_set_database;
@@global.character_set_database
ucs2
SET @@global.character_set_database = cp866;
SELECT @@global.character_set_database;
@@global.character_set_database
cp866
SET @@global.character_set_database = keybcs2;
SELECT @@global.character_set_database;
@@global.character_set_database
keybcs2
SET @@global.character_set_database = macce;
SELECT @@global.character_set_database;
@@global.character_set_database
macce
SET @@global.character_set_database = macroman;
SELECT @@global.character_set_database;
@@global.character_set_database
macroman
SET @@global.character_set_database = cp852;
SELECT @@global.character_set_database;
@@global.character_set_database
cp852
SET @@global.character_set_database = latin7;
SELECT @@global.character_set_database;
@@global.character_set_database
latin7
SET @@global.character_set_database = cp1251;
SELECT @@global.character_set_database;
@@global.character_set_database
cp1251
SET @@global.character_set_database = cp1256;
SELECT @@global.character_set_database;
@@global.character_set_database
cp1256
SET @@global.character_set_database = cp1257;
SELECT @@global.character_set_database;
@@global.character_set_database
cp1257
SET @@global.character_set_database = binary;
SELECT @@global.character_set_database;
@@global.character_set_database
binary
SET @@global.character_set_database = geostd8;
SELECT @@global.character_set_database;
@@global.character_set_database
geostd8
SET @@global.character_set_database = cp932;
SELECT @@global.character_set_database;
@@global.character_set_database
cp932
SET @@global.character_set_database = eucjpms;
SELECT @@global.character_set_database;
@@global.character_set_database
eucjpms
'#--------------------FN_DYNVARS_012_08-------------------------#'
SET @@character_set_database = UTF8;
SELECT @@character_set_database;
@@character_set_database
utf8
SET @@character_set_database = utf8;
SELECT @@character_set_database;
@@character_set_database
utf8
SET @@global.character_set_database = uTf8;
SELECT @@global.character_set_database;
@@global.character_set_database
utf8
'#--------------------FN_DYNVARS_012_09-------------------------#'
SET @@character_set_database = 1;
SELECT @@character_set_database;
@@character_set_database
big5
SET @@character_set_database = 2;
SELECT @@character_set_database;
@@character_set_database
latin2
SET @@character_set_database = 3;
SELECT @@character_set_database;
@@character_set_database
dec8
SET @@character_set_database = 36;
SELECT @@character_set_database;
@@character_set_database
cp866
SET @@character_set_database = 99;
SELECT @@character_set_database;
@@character_set_database
cp1250
SET @@character_set_database = 100;
ERROR 42000: Unknown character set: '100'
SET @@global.character_set_database = 1;
SELECT @@global.character_set_database;
@@global.character_set_database
big5
SET @@global.character_set_database = 2;
SELECT @@global.character_set_database;
@@global.character_set_database
latin2
SET @@global.character_set_database = 3;
SELECT @@global.character_set_database;
@@global.character_set_database
dec8
SET @@global.character_set_database = 36;
SELECT @@global.character_set_database;
@@global.character_set_database
cp866
SET @@global.character_set_database = 99;
SELECT @@global.character_set_database;
@@global.character_set_database
cp1250
SET @@global.character_set_database = 100;
ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
36
'Bug # 34843: character sets are mapped in such a way that 100 and following';
'numbers gives error, and before 100 the 36 mapped wraps arround several times.';
'#--------------------FN_DYNVARS_012_10-------------------------#'
SET @@character_set_database = "grek";
ERROR 42000: Unknown character set: 'grek'
SET @@character_set_database = utf 8;
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 '8' at line 1
SET @@character_set_database = 0;
ERROR 42000: Unknown character set: '0'
SET @@character_set_database = 1.1;
ERROR 42000: Incorrect argument type to variable 'character_set_database'
SET @@character_set_database = -1;
ERROR 42000: Unknown character set: '-1'
SET @@character_set_database = '';
ERROR 42000: Unknown character set: ''
SET @@character_set_database = 'latin 2';
ERROR 42000: Unknown character set: 'latin 2'
SET @@character_set_database = true;
SELECT @@character_set_database AS res_with_true;
res_with_true
big5
SET @@character_set_database = ON;
ERROR 42000: Unknown character set: 'ON'
'#--------------------FN_DYNVARS_012_11-------------------------#'
SET @@global.character_set_database = abc;
ERROR 42000: Unknown character set: 'abc'
SET @@global.character_set_database = 1utf8;
ERROR 42000: Unknown character set: '1utf8'
SET @@global.character_set_database = 0;
ERROR 42000: Unknown character set: '0'
SET @@global.character_set_database = 1.1;
ERROR 42000: Incorrect argument type to variable 'character_set_database'
SET @@global.character_set_database = -1;
ERROR 42000: Unknown character set: '-1'
SET @@global.character_set_database = '';
ERROR 42000: Unknown character set: ''
SET @@global.character_set_database = 'utf';
ERROR 42000: Unknown character set: 'utf'
SET @@global.character_set_database = true;
SET @@global.character_set_database = ON;
ERROR 42000: Unknown character set: 'ON'
'#--------------------FN_DYNVARS_012_12-------------------------#'
SELECT @@global.character_set_database =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='character_set_database') AS res;
res
1
SET @@global.character_set_database = 1;
SELECT @@global.character_set_database;
@@global.character_set_database
big5
SELECT @@global.character_set_database =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='character_set_database') AS res;
res
1
'#--------------------FN_DYNVARS_012_13-------------------------#'
SELECT @@character_set_database =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_database') AS res;
res
1
SELECT @@local.character_set_database =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_database') AS res;
res
1
SELECT @@session.character_set_database =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_database') AS res;
res
1
SET @@global.character_set_database = @global_start_value;
SELECT @@global.character_set_database;
@@global.character_set_database
latin1
SET @@session.character_set_database = @session_start_value;
SELECT @@session.character_set_database;
@@session.character_set_database
latin1

View file

@ -0,0 +1,76 @@
'#--------------------FN_DYNVARS_008_01-------------------------#'
SET @global_character_set_database = @@global.character_set_database;
SET @session_character_set_database = @@session.character_set_database;
SET @session_character_set_server = @@session.character_set_server;
SET @@global.character_set_database = utf8;
'connect (con1,localhost,root,,,,)'
'connection con1'
SELECT @@global.character_set_database;
@@global.character_set_database
utf8
SELECT @@session.character_set_database;
@@session.character_set_database
latin1
'Bug#35356: session character_set_database differ from global character_set_database'
'#--------------------FN_DYNVARS_008_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1;
'--check if setting session character_set_database effects new databases'
SET @@session.character_set_server = utf8;
SELECT @@session.character_set_database;
@@session.character_set_database
latin1
SET @@session.character_set_database = latin5;
SELECT @@session.character_set_database;
@@session.character_set_database
latin5
CREATE DATABASE db1;
USE db1;
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8 */
CREATE TABLE t1(a INT, b VARCHAR(40));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` varchar(40) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
DROP TABLE t1;
DROP DATABASE db1;
'Bug#35357: character_set_database does not effects CREATE DATABASE without characater set'
'--ascii character set specified--'
CREATE DATABASE db1 CHARACTER SET ascii;
USE db1;
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET ascii */
CREATE TABLE t1(a INT, b VARCHAR(40));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` varchar(40) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=ascii
DROP TABLE t1;
DROP DATABASE db1;
'------Check if load data uses character_set_database----------'
USE test;
CREATE TABLE t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
'Verify with latin';
SET @@session.character_set_database = latin1;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/charset_utf8.txt' INTO TABLE t1;
SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1;
count(*)
2433
TRUNCATE TABLE t1;
'Verify with utf8';
SET @@session.character_set_database = utf8;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/charset_utf8.txt' INTO TABLE t1;
SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1;
count(*)
1
DROP TABLE IF EXISTS t1;
SET @@global.character_set_database = @global_character_set_database;
SET @@session.character_set_database = @session_character_set_database;
SET @@session.character_set_server = @session_character_set_server;

View file

@ -0,0 +1,485 @@
SET @global_start_value = @@global.character_set_filesystem;
SELECT @global_start_value;
@global_start_value
binary
SET @session_start_value = @@character_set_filesystem;
SELECT @session_start_value;
@session_start_value
binary
SET @session_start_value = @@local.character_set_filesystem;
SELECT @session_start_value;
@session_start_value
binary
SET @session_start_value = @@session.character_set_filesystem;
SELECT @session_start_value;
@session_start_value
binary
'#--------------------FN_DYNVARS_008_01------------------#'
SELECT character_set_filesystem;
ERROR 42S22: Unknown column 'character_set_filesystem' in 'field list'
SET character_set_filesystem=utf8;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
utf8
SET global.character_set_filesystem=utf8;
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 'character_set_filesystem=utf8' at line 1
SET session character_set_filesystem=utf8;
SELECT session character_set_filesystem;
ERROR 42S22: Unknown column 'session' in 'field list'
SET global character_set_filesystem=utf8;
SELECT global character_set_filesystem;
ERROR 42S22: Unknown column 'global' in 'field list'
'#--------------------FN_DYNVARS_008_02-------------------------#'
SET @@character_set_filesystem = latin5;
SET @@character_set_filesystem = DEFAULT;
SELECT @@character_set_filesystem AS DEFAULT_VALUE;
DEFAULT_VALUE
utf8
SET @@global.character_set_filesystem = latin5;
SET @@global.character_set_filesystem = DEFAULT;
SELECT @@global.character_set_filesystem AS DEFAULT_VALUE;
DEFAULT_VALUE
binary
'#--------------------FN_DYNVARS_008_03-------------------------#'
SET @@session.character_set_filesystem = utf8;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
utf8
SET @@global.character_set_filesystem = latin2;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
latin2
SELECT @@session.character_set_filesystem AS res_is_utf8;
res_is_utf8
utf8
SET @@session.character_set_filesystem = latin5;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
latin5
SELECT @@global.character_set_filesystem AS res_is_latin2;
res_is_latin2
latin2
SELECT @@global.character_set_filesystem=
@@session.character_set_filesystem AS res_is_false;
res_is_false
0
'#--------------------FN_DYNVARS_008_04-------------------------#'
SELECT @@character_set_filesystem = @@session.character_set_filesystem AS res;
res
1
SELECT @@character_set_filesystem = @@local.character_set_filesystem AS res;
res
1
'#--------------------FN_DYNVARS_008_05-------------------------#'
SET @@character_set_filesystem = utf8 + latin2;
ERROR 42S22: Unknown column 'utf8' in 'field list'
'#--------------------FN_DYNVARS_008_06-------------------------#'
SET @@session.character_set_filesystem = big5;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
big5
SET @@session.character_set_filesystem = dec8;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
dec8
SET @@session.character_set_filesystem = cp850;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
cp850
SET @@session.character_set_filesystem = hp8;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
hp8
SET @@session.character_set_filesystem = koi8r;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
koi8r
SET @@session.character_set_filesystem = latin1;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
latin1
SET @@session.character_set_filesystem = latin2;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
latin2
SET @@session.character_set_filesystem = swe7;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
swe7
SET @@session.character_set_filesystem = ascii;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
ascii
SET @@session.character_set_filesystem = ujis;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
ujis
SET @@session.character_set_filesystem = sjis;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
sjis
SET @@session.character_set_filesystem = hebrew;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
hebrew
SET @@session.character_set_filesystem = tis620;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
tis620
SET @@session.character_set_filesystem = euckr;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
euckr
SET @@session.character_set_filesystem = koi8u;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
koi8u
SET @@session.character_set_filesystem = gb2312;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
gb2312
SET @@session.character_set_filesystem = greek;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
greek
SET @@session.character_set_filesystem = cp1250;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
cp1250
SET @@session.character_set_filesystem = gbk;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
gbk
SET @@session.character_set_filesystem = latin5;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
latin5
SET @@session.character_set_filesystem = armscii8;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
armscii8
SET @@session.character_set_filesystem = utf8;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
utf8
SET @@session.character_set_filesystem = ucs2;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
ucs2
SET @@session.character_set_filesystem = cp866;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
cp866
SET @@session.character_set_filesystem = keybcs2;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
keybcs2
SET @@session.character_set_filesystem = macce;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
macce
SET @@session.character_set_filesystem = macroman;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
macroman
SET @@session.character_set_filesystem = cp852;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
cp852
SET @@session.character_set_filesystem = latin7;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
latin7
SET @@session.character_set_filesystem = cp1251;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
cp1251
SET @@session.character_set_filesystem = cp1256;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
cp1256
SET @@session.character_set_filesystem = cp1257;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
cp1257
SET @@session.character_set_filesystem = binary;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
binary
SET @@session.character_set_filesystem = geostd8;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
geostd8
SET @@session.character_set_filesystem = cp932;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
cp932
SET @@session.character_set_filesystem = eucjpms;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
eucjpms
'#--------------------FN_DYNVARS_008_07-------------------------#'
SET @@global.character_set_filesystem = big5;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
big5
SET @@global.character_set_filesystem = dec8;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
dec8
SET @@global.character_set_filesystem = cp850;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
cp850
SET @@global.character_set_filesystem = hp8;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
hp8
SET @@global.character_set_filesystem = koi8r;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
koi8r
SET @@global.character_set_filesystem = latin1;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
latin1
SET @@global.character_set_filesystem = latin2;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
latin2
SET @@global.character_set_filesystem = swe7;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
swe7
SET @@global.character_set_filesystem = ascii;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
ascii
SET @@global.character_set_filesystem = ujis;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
ujis
SET @@global.character_set_filesystem = sjis;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
sjis
SET @@global.character_set_filesystem = hebrew;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
hebrew
SET @@global.character_set_filesystem = tis620;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
tis620
SET @@global.character_set_filesystem = euckr;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
euckr
SET @@global.character_set_filesystem = koi8u;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
koi8u
SET @@global.character_set_filesystem = gb2312;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
gb2312
SET @@global.character_set_filesystem = greek;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
greek
SET @@global.character_set_filesystem = cp1250;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
cp1250
SET @@global.character_set_filesystem = gbk;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
gbk
SET @@global.character_set_filesystem = latin5;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
latin5
SET @@global.character_set_filesystem = armscii8;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
armscii8
SET @@global.character_set_filesystem = utf8;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
utf8
SET @@global.character_set_filesystem = ucs2;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
ucs2
SET @@global.character_set_filesystem = cp866;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
cp866
SET @@global.character_set_filesystem = keybcs2;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
keybcs2
SET @@global.character_set_filesystem = macce;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
macce
SET @@global.character_set_filesystem = macroman;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
macroman
SET @@global.character_set_filesystem = cp852;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
cp852
SET @@global.character_set_filesystem = latin7;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
latin7
SET @@global.character_set_filesystem = cp1251;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
cp1251
SET @@global.character_set_filesystem = cp1256;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
cp1256
SET @@global.character_set_filesystem = cp1257;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
cp1257
SET @@global.character_set_filesystem = binary;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
binary
SET @@global.character_set_filesystem = geostd8;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
geostd8
SET @@global.character_set_filesystem = cp932;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
cp932
SET @@global.character_set_filesystem = eucjpms;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
eucjpms
'#--------------------FN_DYNVARS_008_08-------------------------#'
SET @@character_set_filesystem = UTF8;
SELECT @@character_set_filesystem;
@@character_set_filesystem
utf8
SET @@character_set_filesystem = utf8;
SELECT @@character_set_filesystem;
@@character_set_filesystem
utf8
SET @@character_set_filesystem = uTf8;
SELECT @@character_set_filesystem;
@@character_set_filesystem
utf8
'#--------------------FN_DYNVARS_008_09-------------------------#'
SET @@character_set_filesystem = 1;
SELECT @@character_set_filesystem;
@@character_set_filesystem
big5
SET @@character_set_filesystem = 2;
SELECT @@character_set_filesystem;
@@character_set_filesystem
latin2
SET @@character_set_filesystem = 3;
SELECT @@character_set_filesystem;
@@character_set_filesystem
dec8
SET @@character_set_filesystem = 36;
SELECT @@character_set_filesystem;
@@character_set_filesystem
cp866
SET @@character_set_filesystem = 99;
SELECT @@character_set_filesystem;
@@character_set_filesystem
cp1250
SET @@character_set_filesystem = 100;
ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
36
'Bug # 34843: character sets are mapped in such a way that 100 and following '
'numbers give error, and before 100 the 36 mapped wraps arround several times.'
'#--------------------FN_DYNVARS_008_10-------------------------#'
SET @@character_set_filesystem = abc;
ERROR 42000: Unknown character set: 'abc'
SET @@character_set_filesystem = 1utf8;
ERROR 42000: Unknown character set: '1utf8'
SET @@character_set_filesystem = 0;
ERROR 42000: Unknown character set: '0'
SET @@character_set_filesystem = 1.1;
ERROR 42000: Incorrect argument type to variable 'character_set_filesystem'
SET @@character_set_filesystem = -1;
ERROR 42000: Unknown character set: '-1'
SET @@character_set_filesystem = '';
ERROR 42000: Unknown character set: ''
SET @@character_set_filesystem = 'utf';
ERROR 42000: Unknown character set: 'utf'
SET @@character_set_filesystem = true;
SELECT @@character_set_filesystem AS res_with_true;
res_with_true
big5
SET @@character_set_filesystem = ON;
ERROR 42000: Unknown character set: 'ON'
'#--------------------FN_DYNVARS_008_11-------------------------#'
SET @@global.character_set_filesystem = abc;
ERROR 42000: Unknown character set: 'abc'
SET @@global.character_set_filesystem = 1utf8;
ERROR 42000: Unknown character set: '1utf8'
SET @@global.character_set_filesystem = 0;
ERROR 42000: Unknown character set: '0'
SET @@global.character_set_filesystem = 1.1;
ERROR 42000: Incorrect argument type to variable 'character_set_filesystem'
SET @@global.character_set_filesystem = -1;
ERROR 42000: Unknown character set: '-1'
SET @@global.character_set_filesystem = '';
ERROR 42000: Unknown character set: ''
SET @@global.character_set_filesystem = 'utf';
ERROR 42000: Unknown character set: 'utf'
SET @@global.character_set_filesystem = true;
SET @@global.character_set_filesystem = ON;
ERROR 42000: Unknown character set: 'ON'
'#--------------------FN_DYNVARS_008_12-------------------------#'
SELECT @@global.character_set_filesystem =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='character_set_filesystem') AS res;
res
1
SET @@global.character_set_filesystem = 1;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
big5
SELECT @@global.character_set_filesystem =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='character_set_filesystem') AS res;
res
1
'#--------------------FN_DYNVARS_008_13-------------------------#'
SELECT @@character_set_filesystem =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_filesystem') AS res;
res
1
SELECT @@local.character_set_filesystem =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_filesystem') AS res;
res
1
SELECT @@session.character_set_filesystem =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_filesystem') AS res;
res
1
SET @@global.character_set_filesystem = @global_start_value;
SELECT @@global.character_set_filesystem;
@@global.character_set_filesystem
binary
SET @@session.character_set_filesystem = @session_start_value;
SELECT @@session.character_set_filesystem;
@@session.character_set_filesystem
binary

Binary file not shown.

View file

@ -0,0 +1,64 @@
'#--------------------FN_DYNVARS_012_01-------------------------#'
SET @global_character_set_results = @@global.character_set_results;
SET @session_character_set_results = @@session.character_set_results;
SET @@global.character_set_results = utf8;
'connect (con1,localhost,root,,,,)'
'connection con1'
SELECT @@global.character_set_results;
@@global.character_set_results
utf8
SELECT @@session.character_set_results;
@@session.character_set_results
utf8
'#--------------------FN_DYNVARS_012_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(b CHAR(40) character set utf8);
SET NAMES utf8;
'----check string literals against different character_set_results---'
check if results are converted to character_set_results
SET @@session.character_set_results = greek;
SELECT 'Ð<>ÐЃЄ' AS utf_text;
utf_text
????
check effect of character_set_results when introducers are used
SET @@session.character_set_results = latin1;
SELECT _latin1'Müller' AS latin1_text;
latin1_text
Müller
SET @@session.character_set_results = ascii;
SELECT _latin1'Müller' AS latin1_text;
latin1_text
M?ller
check when we dont want any conversion
SET @@session.character_set_results = NULL;
SELECT 'Ð<>ÐЃЄ' AS utf_text;
utf_text
Ð<EFBFBD>ÐЃЄ
'---check results from table against different character_set_results--'
INSERT INTO t1 VALUES(_utf8'Ð<>ÐЃЄ');
INSERT INTO t1 VALUES('ФХЦЧШ');
SET @@session.character_set_results = NULL;
SELECT b, CHAR_LENGTH(b) FROM t1;
b CHAR_LENGTH(b)
Ð<EFBFBD>ÐЃЄ 4
ФХЦЧШ 5
SET @@session.character_set_results = utf8;
SELECT b, CHAR_LENGTH(b) FROM t1;
b CHAR_LENGTH(b)
Ð<EFBFBD>ÐЃЄ 4
ФХЦЧШ 5
SET @@session.character_set_results = koi8r;
SELECT b, CHAR_LENGTH(b) FROM t1;
b CHAR_LENGTH(b)
³??? 4
æèãþû 5
SET @@session.character_set_results = cp1250;
SELECT b, CHAR_LENGTH(b) FROM t1;
b CHAR_LENGTH(b)
???? 4
????? 5
DROP TABLE t1;
'connection default;'
SET @@global.character_set_results = @global_character_set_results;
SET @@session.character_set_results = @session_character_set_results;

Some files were not shown because too many files have changed in this diff Show more