Commit 893d7e5f authored by ram@mysql.r18.ru's avatar ram@mysql.r18.ru

Merge rkalimullin@work.mysql.com:/home/bk/mysql-4.1

into mysql.r18.ru:/usr/home/ram/work/mysql-4.1.bdb
parents dc6048c8 90bf0744
...@@ -25,15 +25,15 @@ SUBDIRS = . include @docs_dirs@ \ ...@@ -25,15 +25,15 @@ SUBDIRS = . include @docs_dirs@ \
@readline_topdir@ @readline_dir@ \ @readline_topdir@ @readline_dir@ \
@thread_dirs@ pstack @sql_client_dirs@ \ @thread_dirs@ pstack @sql_client_dirs@ \
@sql_server_dirs@ scripts man tests \ @sql_server_dirs@ scripts man tests \
BUILD netware os2 @libmysqld_dirs@ \ BUILD @netware_dir@ os2 @libmysqld_dirs@ \
@bench_dirs@ support-files @fs_dirs@ @tools_dirs@ \ @bench_dirs@ support-files @fs_dirs@ @tools_dirs@
@platform_dir@
# Relink after clean # Relink after clean
linked_sources = linked_client_sources linked_server_sources \ linked_sources = linked_client_sources linked_server_sources \
linked_libmysql_sources linked_libmysql_r_sources \ linked_libmysql_sources linked_libmysql_r_sources \
linked_libmysqld_sources linked_libmysqldex_sources \ linked_libmysqld_sources linked_libmysqldex_sources \
linked_include_sources linked_include_sources @linked_netware_sources@
CLEANFILES = $(linked_sources) CLEANFILES = $(linked_sources)
...@@ -64,6 +64,10 @@ linked_libmysqldex_sources: ...@@ -64,6 +64,10 @@ linked_libmysqldex_sources:
cd libmysqld/examples; $(MAKE) link_sources cd libmysqld/examples; $(MAKE) link_sources
echo timestamp > linked_libmysqldex_sources echo timestamp > linked_libmysqldex_sources
linked_netware_sources:
cd @netware_dir@; $(MAKE) link_sources
echo timestamp > linked_netware_sources
#avoid recursive make calls in sql directory #avoid recursive make calls in sql directory
linked_server_sources: linked_server_sources:
cd sql; rm -f mini_client_errors.c;@LN_CP_F@ ../libmysql/errmsg.c mini_client_errors.c cd sql; rm -f mini_client_errors.c;@LN_CP_F@ ../libmysql/errmsg.c mini_client_errors.c
...@@ -74,7 +78,7 @@ init-db: all ...@@ -74,7 +78,7 @@ init-db: all
$(top_builddir)/scripts/mysql_install_db $(top_builddir)/scripts/mysql_install_db
bin-dist: all bin-dist: all
$(top_builddir)/scripts/make_binary_distribution $(top_builddir)/scripts/make_binary_distribution @MAKE_BINARY_DISTRIBUTION_OPTIONS@
# Remove BK's "SCCS" subdirectories from source distribution # Remove BK's "SCCS" subdirectories from source distribution
dist-hook: dist-hook:
...@@ -88,3 +92,4 @@ tags: ...@@ -88,3 +92,4 @@ tags:
test: test:
cd mysql-test ; ./mysql-test-run cd mysql-test ; ./mysql-test-run
...@@ -1885,6 +1885,9 @@ print_table_data_xml(MYSQL_RES *result) ...@@ -1885,6 +1885,9 @@ print_table_data_xml(MYSQL_RES *result)
{ {
MYSQL_ROW cur; MYSQL_ROW cur;
MYSQL_FIELD *fields; MYSQL_FIELD *fields;
#ifdef __NETWARE__
uint lines= 0;
#endif
mysql_field_seek(result,0); mysql_field_seek(result,0);
......
...@@ -984,9 +984,12 @@ static void dumpTable(uint numFields, char *table) ...@@ -984,9 +984,12 @@ static void dumpTable(uint numFields, char *table)
{ {
char query[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3]; char query[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3];
MYSQL_RES *res; MYSQL_RES *res;
MYSQL_FIELD *field; MYSQL_FIELD *field;
MYSQL_ROW row; MYSQL_ROW row;
ulong rownr, row_break, total_length, init_length; ulong rownr, row_break, total_length, init_length;
#if defined(__NETWARE__) && defined(THREAD)
uint lines= 0;
#endif
if (verbose) if (verbose)
fprintf(stderr, "-- Sending SELECT query...\n"); fprintf(stderr, "-- Sending SELECT query...\n");
...@@ -1216,6 +1219,11 @@ static void dumpTable(uint numFields, char *table) ...@@ -1216,6 +1219,11 @@ static void dumpTable(uint numFields, char *table)
} }
else if (!opt_xml) else if (!opt_xml)
fputs(");\n", md_result_file); fputs(");\n", md_result_file);
#if defined(__NETWARE__) && defined(THREAD)
/* on a long result the screen could hog the cpu */
if ((lines++ & 1023) == 0)
pthread_yield();
#endif
} }
/* XML - close table tag and supress regular output */ /* XML - close table tag and supress regular output */
......
...@@ -35,10 +35,10 @@ rm -f $AVAILABLE_LANGUAGES_ERRORS_RULES ...@@ -35,10 +35,10 @@ rm -f $AVAILABLE_LANGUAGES_ERRORS_RULES
for i in $AVAILABLE_LANGUAGES for i in $AVAILABLE_LANGUAGES
do do
AVAILABLE_LANGUAGES_ERRORS="$AVAILABLE_LANGUAGES_ERRORS $i/errmsg.sys" AVAILABLE_LANGUAGES_ERRORS="$AVAILABLE_LANGUAGES_ERRORS $i/errmsg.sys"
case $SYSTEM_TYPE in case $host_os in
*netware* | *modesto*) netware* | modesto*)
echo "$i/errmsg.sys: $i/errmsg.txt echo "$i/errmsg.sys: $i/errmsg.txt
\$(top_builddir)/extra/comp_err.cyg \$^ $i/errmsg.sys" \ \$(top_builddir)/extra/comp_err.linux \$^ $i/errmsg.sys" \
>> $AVAILABLE_LANGUAGES_ERRORS_RULES >> $AVAILABLE_LANGUAGES_ERRORS_RULES
;; ;;
*) *)
...@@ -1067,7 +1067,10 @@ dnl Is this the right match for DEC OSF on alpha? ...@@ -1067,7 +1067,10 @@ dnl Is this the right match for DEC OSF on alpha?
*netware*) *netware*)
# No need for curses library so set it to null # No need for curses library so set it to null
with_named_curses="" with_named_curses=""
PLATFORM_NETWARE=yes
# No thread library - in LibC
with_named_thread=""
# #
# Edit Makefile.in files. # Edit Makefile.in files.
# #
...@@ -1089,36 +1092,36 @@ dnl Is this the right match for DEC OSF on alpha? ...@@ -1089,36 +1092,36 @@ dnl Is this the right match for DEC OSF on alpha?
fi fi
case $file in case $file in
sql/Makefile.in) sql/Makefile.in)
# Use gen_lex_hash.cyg instead of gen_lex_hash # Use gen_lex_hash.linux instead of gen_lex_hash
# Add library dependencies to mysqld_DEPENDENCIES # Add library dependencies to mysqld_DEPENDENCIES
lib_DEPENDENCIES="\$(bdb_libs_with_path) \$(innodb_libs) \$(pstack_libs) \$(innodb_system_libs) \$(openssl_libs)" lib_DEPENDENCIES="\$(bdb_libs_with_path) \$(innodb_libs) \$(pstack_libs) \$(innodb_system_libs) \$(openssl_libs)"
cat > $filesed << EOF cat > $filesed << EOF
s,\(^.*\$(MAKE) gen_lex_hash\),#\1, s,\(^.*\$(MAKE) gen_lex_hash\),#\1,
s,\(\./gen_lex_hash\),\1.cyg, s,\(\./gen_lex_hash\),\1.linux,
s%\(mysqld_DEPENDENCIES = \) %\1$lib_DEPENDENCIES % s%\(mysqld_DEPENDENCIES = \) %\1$lib_DEPENDENCIES %
EOF EOF
;; ;;
sql/share/Makefile.in) sql/share/Makefile.in)
cat > $filesed << EOF cat > $filesed << EOF
s,\(extra/comp_err\),\1.cyg, s,\(extra/comp_err\),\1.linux,
EOF EOF
;; ;;
libmysql/Makefile.in) libmysql/Makefile.in)
cat > $filesed << EOF cat > $filesed << EOF
s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.cyg\2, s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2,
s,\(: conf_to_src\),\1.cyg, s,\(: conf_to_src\),\1.linux,
EOF EOF
;; ;;
libmysql_r/Makefile.in) libmysql_r/Makefile.in)
cat > $filesed << EOF cat > $filesed << EOF
s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.cyg\2, s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2,
s,\(: conf_to_src\),\1.cyg, s,\(: conf_to_src\),\1.linux,
EOF EOF
;; ;;
strings/Makefile.in) strings/Makefile.in)
cat > $filesed << EOF cat > $filesed << EOF
s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.cyg\2, s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2,
s,\(: conf_to_src\),\1.cyg, s,\(: conf_to_src\),\1.linux,
EOF EOF
;; ;;
client/Makefile.in) client/Makefile.in)
...@@ -1167,7 +1170,6 @@ EOF ...@@ -1167,7 +1170,6 @@ EOF
;; ;;
esac esac
AM_CONDITIONAL(PLATFORM_NETWARE, test "$PLATFORM_NETWARE" = "yes")
#---START: Used in for client configure #---START: Used in for client configure
# Check if we threads are in libc or if we should use # Check if we threads are in libc or if we should use
...@@ -2270,13 +2272,6 @@ AC_ARG_WITH(extra-charsets, ...@@ -2270,13 +2272,6 @@ AC_ARG_WITH(extra-charsets,
[extra_charsets="$withval"], [extra_charsets="$withval"],
[extra_charsets="none"]) [extra_charsets="none"])
AC_ARG_WITH(platform-dir,
[ --with-platform-dir=DIR
Add specified directory to list of SUBDIRS to build.],
[ with_platform_dir=$withval ],
[ with_platform_dir=no ]
)
AC_MSG_CHECKING("character sets") AC_MSG_CHECKING("character sets")
if test "$extra_charsets" = none; then if test "$extra_charsets" = none; then
...@@ -2458,12 +2453,15 @@ AC_SUBST(CLIENT_LIBS) ...@@ -2458,12 +2453,15 @@ AC_SUBST(CLIENT_LIBS)
AC_SUBST(sql_client_dirs) AC_SUBST(sql_client_dirs)
AC_SUBST(linked_client_targets) AC_SUBST(linked_client_targets)
platform_dir= # If configuring for NetWare, set up to link sources from and build the netware directory
if test "$with_platform_dir" != "no" netware_dir=
then linked_netware_sources=
platform_dir="$with_platform_dir" if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then
netware_dir="netware"
linked_netware_sources="linked_netware_sources"
fi fi
AC_SUBST(platform_dir) AC_SUBST(netware_dir)
AC_SUBST(linked_netware_sources)
if test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no" if test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no"
then then
...@@ -2630,6 +2628,17 @@ AC_SUBST(GXX) ...@@ -2630,6 +2628,17 @@ AC_SUBST(GXX)
#Remove TOOLS_LIBS, because this is included in LIBRARIES #Remove TOOLS_LIBS, because this is included in LIBRARIES
#AC_SUBST(TOOLS_LIBS) #AC_SUBST(TOOLS_LIBS)
# Set configuration options for make_binary_distribution
case $SYSTEM_TYPE in
*netware*)
MAKE_BINARY_DISTRIBUTION_OPTIONS=--no-strip
;;
*)
MAKE_BINARY_DISTRIBUTION_OPTIONS=
;;
esac
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
# Output results # Output results
if test "$compile_readline" = "yes" if test "$compile_readline" = "yes"
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
/* Wait until a program dies */ /* Wait until a program dies */
#ifndef __NETWARE__
#include <my_global.h> #include <my_global.h>
#include <m_string.h> #include <m_string.h>
#include <my_getopt.h> #include <my_getopt.h>
...@@ -101,3 +103,15 @@ void usage(void) ...@@ -101,3 +103,15 @@ void usage(void)
my_print_help(my_long_options); my_print_help(my_long_options);
exit(-1); exit(-1);
} }
#else
#include <stdio.h>
main()
{
fprintf(stderr,"This tool has not been ported to NetWare\n");
return 0;
}
#endif /* __NETWARE__ */
...@@ -431,7 +431,7 @@ struct tm *localtime_r(const time_t *clock, struct tm *res); ...@@ -431,7 +431,7 @@ struct tm *localtime_r(const time_t *clock, struct tm *res);
#define pthread_kill(A,B) pthread_dummy(0) #define pthread_kill(A,B) pthread_dummy(0)
#undef pthread_detach_this_thread #undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); } #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
#else /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */ #elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */
#define HAVE_PTHREAD_KILL #define HAVE_PTHREAD_KILL
#endif #endif
......
...@@ -595,7 +595,7 @@ my_bool ...@@ -595,7 +595,7 @@ my_bool
simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg, simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
unsigned long length, my_bool skip_check); unsigned long length, my_bool skip_check);
unsigned long net_safe_read(MYSQL* mysql); unsigned long net_safe_read(MYSQL* mysql);
void STDCALL mysql_once_init(void); void mysql_once_init(void);
#ifdef __NETWARE__ #ifdef __NETWARE__
#pragma pack(pop) /* restore alignment */ #pragma pack(pop) /* restore alignment */
......
...@@ -774,7 +774,8 @@ char* getlogin(void); ...@@ -774,7 +774,8 @@ char* getlogin(void);
/* default to "root" on NetWare */ /* default to "root" on NetWare */
static void read_user_name(char *name) static void read_user_name(char *name)
{ {
(void)strmake(name,"root", USERNAME_LENGTH); char *str=getenv("USER");
strmake(name, str ? str : "UNKNOWN_USER", USERNAME_LENGTH);
} }
#elif !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__) && !defined(OS2) #elif !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__) && !defined(OS2)
...@@ -1221,7 +1222,7 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, ...@@ -1221,7 +1222,7 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
field->flags|= NUM_FLAG; field->flags|= NUM_FLAG;
if (default_value && row->data[6]) if (default_value && row->data[6])
{ {
field->def=strdup_root(alloc,(char*) row->data[8]); field->def=strdup_root(alloc,(char*) row->data[6]);
field->def_length= lengths[6]; field->def_length= lengths[6];
} }
} }
...@@ -1773,7 +1774,7 @@ mysql_init(MYSQL *mysql) ...@@ -1773,7 +1774,7 @@ mysql_init(MYSQL *mysql)
outside program. outside program.
*/ */
void STDCALL mysql_once_init(void) void mysql_once_init(void)
{ {
if (!mysql_client_init) if (!mysql_client_init)
{ {
...@@ -4370,7 +4371,6 @@ int STDCALL mysql_execute(MYSQL_STMT *stmt) ...@@ -4370,7 +4371,6 @@ int STDCALL mysql_execute(MYSQL_STMT *stmt)
set_stmt_error(stmt, CR_NO_PREPARE_STMT); set_stmt_error(stmt, CR_NO_PREPARE_STMT);
DBUG_RETURN(1); DBUG_RETURN(1);
} }
stmt->mysql->fields= stmt->fields;
if (stmt->param_count) if (stmt->param_count)
{ {
NET *net= &stmt->mysql->net; NET *net= &stmt->mysql->net;
......
...@@ -66,7 +66,7 @@ TYPELIB sql_protocol_typelib = {array_elements(sql_protocol_names_lib)-1,"", ...@@ -66,7 +66,7 @@ TYPELIB sql_protocol_typelib = {array_elements(sql_protocol_names_lib)-1,"",
#define closesocket(A) close(A) #define closesocket(A) close(A)
#endif #endif
void STDCALL mysql_once_init(void); static void mysql_once_init(void);
static void end_server(MYSQL *mysql); static void end_server(MYSQL *mysql);
static void append_wild(char *to,char *end,const char *wild); static void append_wild(char *to,char *end,const char *wild);
static ulong mysql_sub_escape_string(CHARSET_INFO *charset_info, char *to, static ulong mysql_sub_escape_string(CHARSET_INFO *charset_info, char *to,
......
...@@ -335,6 +335,7 @@ while test $# -gt 0; do ...@@ -335,6 +335,7 @@ while test $# -gt 0; do
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc" EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc"
SLEEP_TIME_AFTER_RESTART=10 SLEEP_TIME_AFTER_RESTART=10
SLEEP_TIME_FOR_DELETE=60 SLEEP_TIME_FOR_DELETE=60
USE_RUNNING_SERVER=""
;; ;;
--valgrind-options=*) --valgrind-options=*)
TMP=`$ECHO "$1" | $SED -e "s;--valgrind-options=;;"` TMP=`$ECHO "$1" | $SED -e "s;--valgrind-options=;;"`
......
...@@ -1057,3 +1057,13 @@ create table t2 (b varchar(10) not null unique) type=innodb; ...@@ -1057,3 +1057,13 @@ create table t2 (b varchar(10) not null unique) type=innodb;
select t1.a from t1,t2 where t1.a=t2.b; select t1.a from t1,t2 where t1.a=t2.b;
a a
drop table t1,t2; drop table t1,t2;
CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB;
CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE ) TYPE=INNODB;
insert into t1 set id=1;
insert into t2 set id=1, t1_id=1;
delete t1,t2 from t1,t2 where t1.id=t2.t1_id;
select * from t1;
id
select * from t2;
id t1_id
drop table t1,t2;
...@@ -7,7 +7,7 @@ start slave; ...@@ -7,7 +7,7 @@ start slave;
create table t1 (word char(20) not null); create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1; load data infile '../../std_data/words.dat' into table t1;
load data local infile 'MYSQL_TEST_DIR/std_data/words.dat' into table t1; load data local infile 'MYSQL_TEST_DIR/std_data/words.dat' into table t1;
select * from t1; select * from t1 limit 10;
word word
Aarhus Aarhus
Aaron Aaron
...@@ -19,16 +19,6 @@ abandoned ...@@ -19,16 +19,6 @@ abandoned
abandoning abandoning
abandonment abandonment
abandons abandons
Aarhus
Aaron
Ababa
aback
abaft
abandon
abandoned
abandoning
abandonment
abandons
stop slave; stop slave;
set password for root@"localhost" = password('foo'); set password for root@"localhost" = password('foo');
start slave; start slave;
...@@ -41,7 +31,7 @@ n ...@@ -41,7 +31,7 @@ n
2 2
select sum(length(word)) from t1; select sum(length(word)) from t1;
sum(length(word)) sum(length(word))
141 1021
drop table t1,t3; drop table t1,t3;
reset master; reset master;
stop slave; stop slave;
......
...@@ -18,7 +18,7 @@ Table Op Msg_type Msg_text ...@@ -18,7 +18,7 @@ Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
select count(*) from t2; select count(*) from t2;
count(*) count(*)
10 70
select count(*) from t3; select count(*) from t3;
count(*) count(*)
0 0
......
...@@ -484,3 +484,10 @@ select foobar, boggle from t1 where foobar = 'fish' and boggle = 10; ...@@ -484,3 +484,10 @@ select foobar, boggle from t1 where foobar = 'fish' and boggle = 10;
foobar boggle foobar boggle
fish 10 fish 10
drop table t1; drop table t1;
create table t1 (id integer auto_increment unique,imagem LONGBLOB not null);
insert into t1 (id) values (1);
update t1 set imagem=load_file('../../std_data/words.dat') where id=1;
select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1;
if(imagem is null, "ERROR", "OK") length(imagem)
OK 581
drop table t1;
...@@ -8,3 +8,63 @@ abandoned ...@@ -8,3 +8,63 @@ abandoned
abandoning abandoning
abandonment abandonment
abandons abandons
Aarhus
Aaron
Ababa
aback
abaft
abandon
abandoned
abandoning
abandonment
abandons
abase
abased
abasement
abasements
abases
abash
abashed
abashes
abashing
abasing
abate
abated
abatement
abatements
abater
abates
abating
Abba
abbe
abbey
abbeys
abbot
abbots
Abbott
abbreviate
abbreviated
abbreviates
abbreviating
abbreviation
abbreviations
Abby
abdomen
abdomens
abdominal
abduct
abducted
abduction
abductions
abductor
abductors
abducts
Abe
abed
Abel
Abelian
Abelson
Aberdeen
Abernathy
aberrant
aberration
...@@ -698,3 +698,16 @@ create table t1 (a varchar(10) not null) type=myisam; ...@@ -698,3 +698,16 @@ create table t1 (a varchar(10) not null) type=myisam;
create table t2 (b varchar(10) not null unique) type=innodb; create table t2 (b varchar(10) not null unique) type=innodb;
select t1.a from t1,t2 where t1.a=t2.b; select t1.a from t1,t2 where t1.a=t2.b;
drop table t1,t2; drop table t1,t2;
#
# Test of multi-table-delete with foreign key constraints
#
CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB;
CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE ) TYPE=INNODB;
insert into t1 set id=1;
insert into t2 set id=1, t1_id=1;
delete t1,t2 from t1,t2 where t1.id=t2.t1_id;
select * from t1;
select * from t2;
drop table t1,t2;
...@@ -4,7 +4,7 @@ create table t1 (word char(20) not null); ...@@ -4,7 +4,7 @@ create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1; load data infile '../../std_data/words.dat' into table t1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1; eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
select * from t1; select * from t1 limit 10;
# #
# Test slave with wrong password # Test slave with wrong password
......
# This test can't be run with running server (--extern) as this uses
# load_file() on a file in the tree.
#
# #
# Basic cleanup # Basic cleanup
# #
...@@ -283,3 +287,13 @@ insert into t1 values ('fish', 10),('bear', 20); ...@@ -283,3 +287,13 @@ insert into t1 values ('fish', 10),('bear', 20);
select foobar, boggle from t1 where foobar = 'fish'; select foobar, boggle from t1 where foobar = 'fish';
select foobar, boggle from t1 where foobar = 'fish' and boggle = 10; select foobar, boggle from t1 where foobar = 'fish' and boggle = 10;
drop table t1; drop table t1;
#
# Bug when blob is updated
#
create table t1 (id integer auto_increment unique,imagem LONGBLOB not null);
insert into t1 (id) values (1);
update t1 set imagem=load_file('../../std_data/words.dat') where id=1;
select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1;
drop table t1;
...@@ -349,7 +349,7 @@ static my_bool win32_init_tcp_ip() ...@@ -349,7 +349,7 @@ static my_bool win32_init_tcp_ip()
static void netware_init() static void netware_init()
{ {
char cwd[PATH_MAX], *name char cwd[PATH_MAX], *name;
/* init only if we are not a client library */ /* init only if we are not a client library */
if (my_progname) if (my_progname)
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <mysys_priv.h> #include <mysys_priv.h>
#ifdef __NETWARE__ #ifdef __NETWARE__
#include <string.h>
#include <library.h> #include <library.h>
/* /*
...@@ -61,8 +62,8 @@ long PMMeteredUsageRequest ...@@ -61,8 +62,8 @@ long PMMeteredUsageRequest
long *NLSMeterErrCode long *NLSMeterErrCode
); );
ypedef long(*PMUR)(char*, long, char*, char, char*, long, long*, long*, typedef long(*PMUR)(const char*, long, const char*, char,
long*); const char*, long, long*, long*, long*);
/* infoType */ /* infoType */
/* indicates that the info in the userInfo param is an NDS user */ /* indicates that the info in the userInfo param is an NDS user */
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
if PLATFORM_NETWARE
INCLUDES = -I$(srcdir)/../include -I../include -I.. INCLUDES = -I$(srcdir)/../include -I../include -I..
bin_PROGRAMS = mysqld_safe mysql_install_db mysql_test_run libmysql bin_PROGRAMS = mysqld_safe mysql_install_db mysql_test_run libmysql
mysqld_safe_SOURCES= mysqld_safe.c my_manage.c mysqld_safe_SOURCES= mysqld_safe.c my_manage.c
...@@ -22,7 +21,27 @@ mysql_install_db_SOURCES= mysql_install_db.c my_manage.c ...@@ -22,7 +21,27 @@ mysql_install_db_SOURCES= mysql_install_db.c my_manage.c
mysql_test_run_SOURCES= mysql_test_run.c my_manage.c mysql_test_run_SOURCES= mysql_test_run.c my_manage.c
libmysql_SOURCES= libmysqlmain.c libmysql_SOURCES= libmysqlmain.c
libmysql_LDADD = ../libmysql/.libs/libmysqlclient.a libmysql_LDADD = ../libmysql/.libs/libmysqlclient.a
endif
netware_build_files = client/mysql.def client/mysqladmin.def \
client/mysqlbinlog.def client/mysqlcheck.def \
client/mysqldump.def client/mysqlimport.def \
client/mysqlshow.def client/mysqltest.def \
extra/mysql_install.def extra/my_print_defaults.def \
extra/perror.def extra/replace.def \
extra/resolveip.def isam/isamchk.def \
isam/isamlog.def isam/pack_isam.def \
libmysqld/libmysqld.def myisam/myisamchk.def \
myisam/myisamlog.def myisam/myisampack.def \
sql/mysqld.def sql/mysqld.xdc
link_sources:
set -x; \
for f in $(netware_build_files); do \
rm -f $(srcdir)/../$$f; \
org=`echo $$f | sed -e 's/.*\/\(.*\)/\1/g'`; \
@LN_CP_F@ $(srcdir)/$$org $(srcdir)/../$$f; \
done;
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%
CREATE DATABASE mysql;
CREATE DATABASE test;
USE mysql; USE mysql;
CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges'; CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges';
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# ISAM Check # ISAM Check
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL ISAM Table Check Tool" DESCRIPTION "MySQL ISAM Table Check Tool"
VERSION 4, 0 VERSION 4, 0
STACKSIZE 65536 STACKSIZE 65536
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
# ISAM Log # ISAM Log
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "ISAM Log" DESCRIPTION "MySQL ISAM Table Log Tool"
VERSION 4, 0 VERSION 4, 0
DEBUG DEBUG
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
EXPORT @libmysql.imp EXPORT @libmysql.imp
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Client Library" DESCRIPTION "MySQL Client Library"
VERSION 4, 0 VERSION 4, 0
AUTOUNLOAD AUTOUNLOAD
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# My Print Defaults # My Print Defaults
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Print Defaults Tool" DESCRIPTION "MySQL Print Defaults Tool"
VERSION 4, 0 VERSION 4, 0
#DEBUG #DEBUG
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# MyISAM Check # MyISAM Check
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL MyISAM Table Check Tool" DESCRIPTION "MySQL MyISAM Table Check Tool"
VERSION 4, 0 VERSION 4, 0
STACKSIZE 65536 STACKSIZE 65536
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# MyISAM Log # MyISAM Log
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL MyISAM Table Log Tool" DESCRIPTION "MySQL MyISAM Table Log Tool"
VERSION 4, 0 VERSION 4, 0
#DEBUG #DEBUG
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# MyISAM Pack # MyISAM Pack
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL MyISAM Table Pack Tool" DESCRIPTION "MySQL MyISAM Table Pack Tool"
VERSION 4, 0 VERSION 4, 0
#DEBUG #DEBUG
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
SCREENNAME "MySQL Monitor" SCREENNAME "MySQL Monitor"
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Monitor" DESCRIPTION "MySQL Monitor"
VERSION 4, 0 VERSION 4, 0
MULTIPLE MULTIPLE
......
...@@ -312,20 +312,6 @@ void create_paths() ...@@ -312,20 +312,6 @@ void create_paths()
{ {
mkdir(datadir, 0); mkdir(datadir, 0);
} }
// mysql directory
snprintf(temp, PATH_MAX, "%s/mysql", datadir);
if (stat(temp, &info))
{
mkdir(temp, 0);
}
// test directory
snprintf(temp, PATH_MAX, "%s/test", datadir);
if (stat(temp, &info))
{
mkdir(temp, 0);
}
} }
/****************************************************************************** /******************************************************************************
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
SCREENNAME "MySQL Install" SCREENNAME "MySQL Install"
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Initial Database Installer" DESCRIPTION "MySQL Initial Database Installer"
VERSION 4, 0 VERSION 4, 0
#DEBUG #DEBUG
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
MODULE libc.nlm MODULE libc.nlm
STACKSIZE 65536 STACKSIZE 65536
SCREENNAME "MySQL Test Run" SCREENNAME "MySQL Test Run"
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Test Run" DESCRIPTION "MySQL Test Run"
VERSION 4, 0 VERSION 4, 0
#DEBUG #DEBUG
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
SCREENNAME "MySQL Admin" SCREENNAME "MySQL Admin"
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Admin Tool" DESCRIPTION "MySQL Admin Tool"
VERSION 4, 0 VERSION 4, 0
#DEBUG #DEBUG
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# MySQL Binary Log # MySQL Binary Log
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Binary Log Dump Tool" DESCRIPTION "MySQL Binary Log Dump Tool"
VERSION 4, 0 VERSION 4, 0
#DEBUG #DEBUG
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# MySQL Client # MySQL Client
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Check Tool" DESCRIPTION "MySQL Check Tool"
VERSION 4, 0 VERSION 4, 0
#DEBUG #DEBUG
......
...@@ -190,7 +190,7 @@ void finish_defaults() ...@@ -190,7 +190,7 @@ void finish_defaults()
if (!err_log[0]) snprintf(err_log, PATH_MAX, "%s/%s.err", datadir, hostname); if (!err_log[0]) snprintf(err_log, PATH_MAX, "%s/%s.err", datadir, hostname);
// safe-log // safe-log
if (!safe_log[0]) snprintf(safe_log, PATH_MAX, "%s/%s.log", datadir, hostname); if (!safe_log[0]) snprintf(safe_log, PATH_MAX, "%s/%s.safe", datadir, hostname);
// mysqld // mysqld
if (!mysqld[0]) snprintf(mysqld, PATH_MAX, "%s/bin/mysqld-max", basedir); if (!mysqld[0]) snprintf(mysqld, PATH_MAX, "%s/bin/mysqld-max", basedir);
...@@ -364,7 +364,7 @@ void get_options(int argc, char *argv[]) ...@@ -364,7 +364,7 @@ void get_options(int argc, char *argv[])
// default file arguments // default file arguments
init_args(al); init_args(al);
add_arg(al, "dummy"); add_arg(al, "ignore");
read_defaults(al); read_defaults(al);
parse_args(al->argc, al->argv); parse_args(al->argc, al->argv);
free_args(al); free_args(al);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# MySQL Admin # MySQL Admin
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Dump Tool" DESCRIPTION "MySQL Dump Tool"
VERSION 4, 0 VERSION 4, 0
#DEBUG #DEBUG
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# MySQL Client # MySQL Client
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Import Tool" DESCRIPTION "MySQL Import Tool"
VERSION 4, 0 VERSION 4, 0
#DEBUG #DEBUG
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
SCREENNAME "MySQL Show" SCREENNAME "MySQL Show"
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Show Tool" DESCRIPTION "MySQL Show Tool"
VERSION 4, 0 VERSION 4, 0
#DEBUG #DEBUG
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# MySQL Admin # MySQL Admin
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Test Case Tool" DESCRIPTION "MySQL Test Case Tool"
VERSION 4, 0 VERSION 4, 0
#DEBUG #DEBUG
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
# Pack ISAM # Pack ISAM
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "Pack ISAM" DESCRIPTION "MySQL ISAM Table Pack Tool"
VERSION 4, 0 VERSION 4, 0
DEBUG DEBUG
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# PERROR # PERROR
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Error Code Description Tool" DESCRIPTION "MySQL Error Code Description Tool"
VERSION 4, 0 VERSION 4, 0
#DEBUG #DEBUG
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Replace # Replace
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Text Replacement Tool" DESCRIPTION "MySQL Text Replacement Tool"
VERSION 4, 0 VERSION 4, 0
#DEBUG #DEBUG
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Resolve IP # Resolve IP
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
MODULE libc.nlm MODULE libc.nlm
COPYRIGHT "(c) 2002 Novell, Inc. Portions (c) 2002 MySQL AB. All Rights Reserved." COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL IP/Hostname Resolve Tool" DESCRIPTION "MySQL IP/Hostname Resolve Tool"
VERSION 4, 0 VERSION 4, 0
#DEBUG #DEBUG
......
CREATE DATABASE mysql;
CREATE DATABASE test;
USE mysql; USE mysql;
CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges'; CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges';
......
...@@ -10,6 +10,7 @@ version=@VERSION@ ...@@ -10,6 +10,7 @@ version=@VERSION@
export machine system version export machine system version
SOURCE=`pwd` SOURCE=`pwd`
CP="cp -p" CP="cp -p"
MV="mv"
STRIP=1 STRIP=1
DEBUG=0 DEBUG=0
...@@ -58,7 +59,7 @@ case $system in ...@@ -58,7 +59,7 @@ case $system in
MYSQL_SHARE=$BASE/share MYSQL_SHARE=$BASE/share
EXTRA_BIN_FILES="netware/mysqld_safe.nlm netware/mysql_install_db.nlm \ EXTRA_BIN_FILES="netware/mysqld_safe.nlm netware/mysql_install_db.nlm \
netware/init_db.sql netware/test_db.sql netware/mysql_explain_log.nlm \ netware/init_db.sql netware/test_db.sql netware/mysql_explain_log.nlm \
netware/mysqlhotcopy.nlm netware/libmysql.nlm" netware/mysqlhotcopy.nlm netware/libmysql.nlm netware/init_secure_db.sql"
;; ;;
esac esac
...@@ -122,7 +123,7 @@ do ...@@ -122,7 +123,7 @@ do
done done
if [ $BASE_SYSTEM = "netware" ] ; then if [ $BASE_SYSTEM = "netware" ] ; then
$CP -r netware/scripts/* $BASE/scripts $CP -r netware/*.pl $BASE/scripts
fi fi
for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* libmysqld/libmysqld.a netware/libmysql.imp for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* libmysqld/libmysqld.a netware/libmysql.imp
...@@ -148,12 +149,15 @@ if [ $BASE_SYSTEM != "netware" ] ; then ...@@ -148,12 +149,15 @@ if [ $BASE_SYSTEM != "netware" ] ; then
rm -f $BASE/include/config-netware.h rm -f $BASE/include/config-netware.h
fi fi
if [ -d tests ] ; then if [ $BASE_SYSTEM != "netware" ] ; then
$CP tests/*.res tests/*.tst tests/*.pl $BASE/tests if [ -d tests ] ; then
fi $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests
if [ -d man ] ; then fi
$CP man/*.1 $BASE/man/man1 if [ -d man ] ; then
$CP man/*.1 $BASE/man/man1
fi
fi fi
$CP support-files/* $BASE/support-files $CP support-files/* $BASE/support-files
if [ $BASE_SYSTEM = "netware" ] ; then if [ $BASE_SYSTEM = "netware" ] ; then
......
...@@ -272,6 +272,7 @@ echo "Starting $MYSQLD daemon with databases from $DATADIR" ...@@ -272,6 +272,7 @@ echo "Starting $MYSQLD daemon with databases from $DATADIR"
echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log
while true while true
do do
rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety
if test -z "$args" if test -z "$args"
then then
$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1
...@@ -310,7 +311,6 @@ do ...@@ -310,7 +311,6 @@ do
I=`expr $I + 1` I=`expr $I + 1`
done done
fi fi
rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety
echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log
done done
......
...@@ -682,17 +682,18 @@ public: ...@@ -682,17 +682,18 @@ public:
void update_used_tables() void update_used_tables()
{ {
if (!args[0]->maybe_null) if (!args[0]->maybe_null)
used_tables_cache=0; /* is always false */
else
{ {
args[0]->update_used_tables(); used_tables_cache= 0; /* is always false */
used_tables_cache=args[0]->used_tables(); cached_value= (longlong) 0;
} }
if (!used_tables_cache) else
{ {
/* Remember if the value is always NULL or never NULL */ args[0]->update_used_tables();
args[0]->val(); if (!(used_tables_cache=args[0]->used_tables()))
cached_value= args[0]->null_value ? (longlong) 1 : (longlong) 0; {
/* Remember if the value is always NULL or never NULL */
cached_value= (longlong) args[0]->is_null();
}
} }
} }
optimize_type select_optimize() const { return OPTIMIZE_NULL; } optimize_type select_optimize() const { return OPTIMIZE_NULL; }
......
...@@ -554,7 +554,7 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show); ...@@ -554,7 +554,7 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show);
/* sql_handler.cc */ /* sql_handler.cc */
int mysql_ha_open(THD *thd, TABLE_LIST *tables); int mysql_ha_open(THD *thd, TABLE_LIST *tables);
int mysql_ha_close(THD *thd, TABLE_LIST *tables, bool dont_send_ok=0); int mysql_ha_close(THD *thd, TABLE_LIST *tables, bool dont_send_ok=0);
int mysql_ha_closeall(THD *thd, TABLE_LIST *tables, bool dont_send_ok=0); int mysql_ha_closeall(THD *thd, TABLE_LIST *tables);
int mysql_ha_read(THD *, TABLE_LIST *,enum enum_ha_read_modes,char *, int mysql_ha_read(THD *, TABLE_LIST *,enum enum_ha_read_modes,char *,
List<Item> *,enum ha_rkey_function,Item *,ha_rows,ha_rows); List<Item> *,enum ha_rkey_function,Item *,ha_rows,ha_rows);
......
...@@ -782,7 +782,7 @@ void kill_mysql(void) ...@@ -782,7 +782,7 @@ void kill_mysql(void)
#if defined(OS2) || defined(__NETWARE__) #if defined(OS2) || defined(__NETWARE__)
extern "C" void kill_server(int sig_ptr) extern "C" void kill_server(int sig_ptr)
#define RETURN_FROM_KILL_SERVER DBUG_RETURN #define RETURN_FROM_KILL_SERVER DBUG_VOID_RETURN
#elif !defined(__WIN__) #elif !defined(__WIN__)
static void *kill_server(void *sig_ptr) static void *kill_server(void *sig_ptr)
#define RETURN_FROM_KILL_SERVER DBUG_RETURN(0) #define RETURN_FROM_KILL_SERVER DBUG_RETURN(0)
...@@ -799,9 +799,6 @@ static void __cdecl kill_server(int sig_ptr) ...@@ -799,9 +799,6 @@ static void __cdecl kill_server(int sig_ptr)
RETURN_FROM_KILL_SERVER; RETURN_FROM_KILL_SERVER;
kill_in_progress=TRUE; kill_in_progress=TRUE;
abort_loop=1; // This should be set abort_loop=1; // This should be set
#ifdef __NETWARE__
ActivateScreen(getscreenhandle()); // Show the screen going down
#endif
signal(sig,SIG_IGN); signal(sig,SIG_IGN);
if (sig == MYSQL_KILL_SIGNAL || sig == 0) if (sig == MYSQL_KILL_SIGNAL || sig == 0)
sql_print_error(ER(ER_NORMAL_SHUTDOWN),my_progname); sql_print_error(ER(ER_NORMAL_SHUTDOWN),my_progname);
...@@ -1427,7 +1424,6 @@ static void check_data_home(const char *path) ...@@ -1427,7 +1424,6 @@ static void check_data_home(const char *path)
// down server event callback // down server event callback
void mysql_down_server_cb(void *, void *) void mysql_down_server_cb(void *, void *)
{ {
setscreenmode(SCR_AUTOCLOSE_ON_EXIT); // auto close the screen
kill_server(0); kill_server(0);
} }
...@@ -1483,26 +1479,6 @@ static void start_signal_handler(void) ...@@ -1483,26 +1479,6 @@ static void start_signal_handler(void)
static void check_data_home(const char *path) static void check_data_home(const char *path)
{ {
struct volume_info vol;
char buff[PATH_MAX], *pos;
bzero((char*) &vol, sizeof(vol)); // clear struct
// find volume name
if ((pos= strchr(path, ':')))
{
uint length= (uint) (pos-path);
strmake(buff, path, min(length, sizeof(buff)-1));
}
else
strmov(buff, "SYS"); // assume SYS volume
netware_vol_info_from_name(&vol, buff); // retrieve information
if ((vol.flags & VOL_NSS_PRESENT) == 0)
{
sql_print_error("Error: %s is not on an NSS volume!", path);
unireg_abort(-1);
}
} }
#elif defined(__EMX__) #elif defined(__EMX__)
...@@ -2019,11 +1995,6 @@ static int init_common_variables(const char *conf_file_name, int argc, ...@@ -2019,11 +1995,6 @@ static int init_common_variables(const char *conf_file_name, int argc,
max_system_variables.pseudo_thread_id= (ulong)~0; max_system_variables.pseudo_thread_id= (ulong)~0;
start_time=time((time_t*) 0); start_time=time((time_t*) 0);
#ifdef __NETWARE__
printf("MySQL Server %s, for %s (%s)\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE);
fflush(stdout);
#endif /* __NETWARE__ */
#ifdef OS2 #ifdef OS2
{ {
// fix timezone for daylight saving // fix timezone for daylight saving
...@@ -2849,7 +2820,11 @@ inline void kill_broken_server() ...@@ -2849,7 +2820,11 @@ inline void kill_broken_server()
(!opt_disable_networking && ip_sock == INVALID_SOCKET)) (!opt_disable_networking && ip_sock == INVALID_SOCKET))
{ {
select_thread_in_use = 0; select_thread_in_use = 0;
#ifdef __NETWARE__
kill_server(MYSQL_KILL_SIGNAL); /* never returns */
#else
kill_server((void*)MYSQL_KILL_SIGNAL); /* never returns */ kill_server((void*)MYSQL_KILL_SIGNAL); /* never returns */
#endif /* __NETWARE__ */
} }
} }
#define MAYBE_BROKEN_SYSCALL kill_broken_server(); #define MAYBE_BROKEN_SYSCALL kill_broken_server();
...@@ -3487,7 +3462,6 @@ enum options ...@@ -3487,7 +3462,6 @@ enum options
OPT_BDB_LOG_BUFFER_SIZE, OPT_BDB_LOG_BUFFER_SIZE,
OPT_BDB_MAX_LOCK, OPT_BDB_MAX_LOCK,
OPT_ERROR_LOG_FILE, OPT_ERROR_LOG_FILE,
OPT_AUTOCLOSE,
OPT_ENABLE_SHARED_MEMORY, OPT_ENABLE_SHARED_MEMORY,
OPT_SHARED_MEMORY_BASE_NAME, OPT_SHARED_MEMORY_BASE_NAME,
OPT_OLD_PASSWORDS OPT_OLD_PASSWORDS
...@@ -3500,9 +3474,6 @@ struct my_option my_long_options[] = ...@@ -3500,9 +3474,6 @@ struct my_option my_long_options[] =
{ {
{"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax", 0, 0, 0, {"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef __NETWARE__
{"autoclose", OPT_AUTOCLOSE, "Auto close screen. (NetWare only)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif /* __NETWARE__ */
{"basedir", 'b', {"basedir", 'b',
"Path to installation directory. All paths are usually resolved relative to this.", "Path to installation directory. All paths are usually resolved relative to this.",
(gptr*) &mysql_home_ptr, (gptr*) &mysql_home_ptr, 0, GET_STR, REQUIRED_ARG, (gptr*) &mysql_home_ptr, (gptr*) &mysql_home_ptr, 0, GET_STR, REQUIRED_ARG,
...@@ -4890,11 +4861,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -4890,11 +4861,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
if (opt_console) if (opt_console)
opt_error_log= 0; // Force logs to stdout opt_error_log= 0; // Force logs to stdout
break; break;
#ifdef __NETWARE__
case (int) OPT_AUTOCLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
case (int) OPT_FLUSH: case (int) OPT_FLUSH:
#ifdef HAVE_ISAM #ifdef HAVE_ISAM
nisam_flush=1; nisam_flush=1;
......
...@@ -45,7 +45,8 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table, ...@@ -45,7 +45,8 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
info->ref_length=table->file->ref_length; info->ref_length=table->file->ref_length;
info->select=select; info->select=select;
info->print_error=print_error; info->print_error=print_error;
table->status=0; /* And it's allways found */ info->ignore_not_found_rows= 0;
table->status=0; /* And it's always found */
if (select && my_b_inited(&select->file)) if (select && my_b_inited(&select->file))
tempfile= &select->file; tempfile= &select->file;
...@@ -184,7 +185,8 @@ tryNext: ...@@ -184,7 +185,8 @@ tryNext:
{ {
if (tmp == HA_ERR_END_OF_FILE) if (tmp == HA_ERR_END_OF_FILE)
tmp= -1; tmp= -1;
else if (tmp == HA_ERR_RECORD_DELETED) else if (tmp == HA_ERR_RECORD_DELETED ||
(tmp == HA_ERR_KEY_NOT_FOUND && info->ignore_not_found_rows))
goto tryNext; goto tryNext;
else else
{ {
...@@ -212,7 +214,8 @@ tryNext: ...@@ -212,7 +214,8 @@ tryNext:
{ {
if (tmp == HA_ERR_END_OF_FILE) if (tmp == HA_ERR_END_OF_FILE)
tmp= -1; tmp= -1;
else if (tmp == HA_ERR_RECORD_DELETED) else if (tmp == HA_ERR_RECORD_DELETED ||
(tmp == HA_ERR_KEY_NOT_FOUND && info->ignore_not_found_rows))
goto tryNext; goto tryNext;
else else
{ {
......
...@@ -306,13 +306,14 @@ protected: ...@@ -306,13 +306,14 @@ protected:
public: public:
uint max_tree_elements, max_treemem; uint max_tree_elements, max_treemem;
analyse(select_result *res) :Procedure(res, PROC_NO_SORT), rows(0), analyse(select_result *res) :Procedure(res, PROC_NO_SORT), f_info(0),
output_str_length(0) {} rows(0), output_str_length(0) {}
~analyse() ~analyse()
{ {
for (field_info **f=f_info; f != f_end; f++) if (f_info)
delete (*f); for (field_info **f=f_info; f != f_end; f++)
delete (*f);
} }
virtual void add() {} virtual void add() {}
virtual bool change_columns(List<Item> &fields); virtual bool change_columns(List<Item> &fields);
......
...@@ -411,6 +411,7 @@ void multi_delete::send_error(uint errcode,const char *err) ...@@ -411,6 +411,7 @@ void multi_delete::send_error(uint errcode,const char *err)
int multi_delete::do_deletes(bool from_send_error) int multi_delete::do_deletes(bool from_send_error)
{ {
int local_error= 0, counter= 0; int local_error= 0, counter= 0;
DBUG_ENTER("do_deletes");
if (from_send_error) if (from_send_error)
{ {
...@@ -436,7 +437,12 @@ int multi_delete::do_deletes(bool from_send_error) ...@@ -436,7 +437,12 @@ int multi_delete::do_deletes(bool from_send_error)
} }
READ_RECORD info; READ_RECORD info;
init_read_record(&info,thd,table,NULL,0,0); init_read_record(&info,thd,table,NULL,0,1);
/*
Ignore any rows not found in reference tables as they may already have
been deleted by foreign key handling
*/
info.ignore_not_found_rows= 1;
while (!(local_error=info.read_record(&info)) && !thd->killed) while (!(local_error=info.read_record(&info)) && !thd->killed)
{ {
if ((local_error=table->file->delete_row(table->record[0]))) if ((local_error=table->file->delete_row(table->record[0])))
...@@ -450,7 +456,7 @@ int multi_delete::do_deletes(bool from_send_error) ...@@ -450,7 +456,7 @@ int multi_delete::do_deletes(bool from_send_error)
if (local_error == -1) // End of file if (local_error == -1) // End of file
local_error = 0; local_error = 0;
} }
return local_error; DBUG_RETURN(local_error);
} }
......
...@@ -71,7 +71,7 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, ...@@ -71,7 +71,7 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
select_union *derived_result; select_union *derived_result;
TABLE_LIST *tables= (TABLE_LIST *)sl->table_list.first; TABLE_LIST *tables= (TABLE_LIST *)sl->table_list.first;
TMP_TABLE_PARAM tmp_table_param; TMP_TABLE_PARAM tmp_table_param;
bool is_union= sl->next_select() && sl->next_select()->linkage == UNION_TYPE; bool is_union= sl->next_select();
bool is_subsel= sl->first_inner_unit() ? 1: 0; bool is_subsel= sl->first_inner_unit() ? 1: 0;
SELECT_LEX_NODE *save_current_select= lex->current_select; SELECT_LEX_NODE *save_current_select= lex->current_select;
DBUG_ENTER("mysql_derived"); DBUG_ENTER("mysql_derived");
......
...@@ -86,18 +86,11 @@ int mysql_ha_close(THD *thd, TABLE_LIST *tables, bool dont_send_ok) ...@@ -86,18 +86,11 @@ int mysql_ha_close(THD *thd, TABLE_LIST *tables, bool dont_send_ok)
return 0; return 0;
} }
int mysql_ha_closeall(THD *thd, TABLE_LIST *tables, bool dont_send_ok) int mysql_ha_closeall(THD *thd, TABLE_LIST *tables)
{ {
TABLE **ptr=find_table_ptr_by_name(thd, tables->db, tables->real_name, 0); TABLE **ptr=find_table_ptr_by_name(thd, tables->db, tables->real_name, 0);
DBUG_ASSERT(dont_send_ok);
if (*ptr) if (*ptr)
{
// if (!dont_send_ok) VOID(pthread_mutex_lock(&LOCK_open));
close_thread_table(thd, ptr); close_thread_table(thd, ptr);
// if (!dont_send_ok) VOID(pthread_mutex_unlock(&LOCK_open));
}
// if (!dont_send_ok) send_ok(&thd->net);
return 0; return 0;
} }
......
...@@ -1098,10 +1098,11 @@ void st_select_lex_node::fast_exclude() ...@@ -1098,10 +1098,11 @@ void st_select_lex_node::fast_exclude()
{ {
if ((*link_prev= link_next)) if ((*link_prev= link_next))
link_next->link_prev= link_prev; link_next->link_prev= link_prev;
// Remove slave structure
for (; slave; slave= slave->next)
slave->fast_exclude();
} }
// Remove slave structure
for (; slave; slave= slave->next)
slave->fast_exclude();
} }
/* /*
......
...@@ -191,7 +191,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, ...@@ -191,7 +191,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
for (table=tables ; table ; table=table->next) for (table=tables ; table ; table=table->next)
{ {
char *db=table->db ? table->db : thd->db; char *db=table->db ? table->db : thd->db;
mysql_ha_closeall(thd, table, 1); mysql_ha_closeall(thd, table);
if (!close_temporary_table(thd, db, table->real_name)) if (!close_temporary_table(thd, db, table->real_name))
{ {
tmp_table_deleted=1; tmp_table_deleted=1;
......
...@@ -106,7 +106,7 @@ typedef struct st_read_record { /* Parameter to read_record */ ...@@ -106,7 +106,7 @@ typedef struct st_read_record { /* Parameter to read_record */
byte *record; byte *record;
byte *cache,*cache_pos,*cache_end,*read_positions; byte *cache,*cache_pos,*cache_end,*read_positions;
IO_CACHE *io_cache; IO_CACHE *io_cache;
bool print_error; bool print_error, ignore_not_found_rows;
} READ_RECORD; } READ_RECORD;
enum timestamp_type { TIMESTAMP_NONE, TIMESTAMP_DATE, TIMESTAMP_FULL, enum timestamp_type { TIMESTAMP_NONE, TIMESTAMP_DATE, TIMESTAMP_FULL,
......
...@@ -510,7 +510,8 @@ static void verify_col_data(const char *table, const char *col, ...@@ -510,7 +510,8 @@ static void verify_col_data(const char *table, const char *col,
static void verify_prepare_field(MYSQL_RES *result, static void verify_prepare_field(MYSQL_RES *result,
unsigned int no,const char *name, const char *org_name, unsigned int no,const char *name, const char *org_name,
enum enum_field_types type, const char *table, enum enum_field_types type, const char *table,
const char *org_table, const char *db) const char *org_table, const char *db,
unsigned long length)
{ {
MYSQL_FIELD *field; MYSQL_FIELD *field;
...@@ -526,6 +527,9 @@ static void verify_prepare_field(MYSQL_RES *result, ...@@ -526,6 +527,9 @@ static void verify_prepare_field(MYSQL_RES *result,
fprintf(stdout,"\n table :`%s`\t(expected: `%s`)", field->table, table); fprintf(stdout,"\n table :`%s`\t(expected: `%s`)", field->table, table);
fprintf(stdout,"\n org_table:`%s`\t(expected: `%s`)", field->org_table, org_table); fprintf(stdout,"\n org_table:`%s`\t(expected: `%s`)", field->org_table, org_table);
fprintf(stdout,"\n database :`%s`\t(expected: `%s`)", field->db, db); fprintf(stdout,"\n database :`%s`\t(expected: `%s`)", field->db, db);
fprintf(stdout,"\n length :`%ld`\t(expected: `%ld`)", field->length, length);
fprintf(stdout,"\n maxlength:`%ld`", field->max_length);
fprintf(stdout,"\n charsetnr:`%d`", field->charsetnr);
fprintf(stdout,"\n"); fprintf(stdout,"\n");
myassert(strcmp(field->name,name) == 0); myassert(strcmp(field->name,name) == 0);
myassert(strcmp(field->org_name,org_name) == 0); myassert(strcmp(field->org_name,org_name) == 0);
...@@ -533,6 +537,7 @@ static void verify_prepare_field(MYSQL_RES *result, ...@@ -533,6 +537,7 @@ static void verify_prepare_field(MYSQL_RES *result,
myassert(strcmp(field->table,table) == 0); myassert(strcmp(field->table,table) == 0);
myassert(strcmp(field->org_table,org_table) == 0); myassert(strcmp(field->org_table,org_table) == 0);
myassert(strcmp(field->db,db) == 0); myassert(strcmp(field->db,db) == 0);
myassert(field->length == length);
} }
/* /*
...@@ -969,15 +974,15 @@ static void test_prepare_field_result() ...@@ -969,15 +974,15 @@ static void test_prepare_field_result()
fprintf(stdout,"\n\n field attributes:\n"); fprintf(stdout,"\n\n field attributes:\n");
verify_prepare_field(result,0,"int_c","int_c",MYSQL_TYPE_LONG, verify_prepare_field(result,0,"int_c","int_c",MYSQL_TYPE_LONG,
"t1","test_prepare_field_result",current_db); "t1","test_prepare_field_result",current_db,11);
verify_prepare_field(result,1,"var_c","var_c",MYSQL_TYPE_VAR_STRING, verify_prepare_field(result,1,"var_c","var_c",MYSQL_TYPE_VAR_STRING,
"t1","test_prepare_field_result",current_db); "t1","test_prepare_field_result",current_db,50);
verify_prepare_field(result,2,"date","date_c",MYSQL_TYPE_DATE, verify_prepare_field(result,2,"date","date_c",MYSQL_TYPE_DATE,
"t1","test_prepare_field_result",current_db); "t1","test_prepare_field_result",current_db,10);
verify_prepare_field(result,3,"ts_c","ts_c",MYSQL_TYPE_TIMESTAMP, verify_prepare_field(result,3,"ts_c","ts_c",MYSQL_TYPE_TIMESTAMP,
"t1","test_prepare_field_result",current_db); "t1","test_prepare_field_result",current_db,19);
verify_prepare_field(result,4,"char_c","char_c",MYSQL_TYPE_STRING, verify_prepare_field(result,4,"char_c","char_c",MYSQL_TYPE_STRING,
"t1","test_prepare_field_result",current_db); "t1","test_prepare_field_result",current_db,3);
verify_field_count(result, 5); verify_field_count(result, 5);
mysql_free_result(result); mysql_free_result(result);
...@@ -4813,8 +4818,6 @@ static void test_subselect() ...@@ -4813,8 +4818,6 @@ static void test_subselect()
#if TO_BE_FIXED_IN_SERVER #if TO_BE_FIXED_IN_SERVER
MYSQL_STMT *stmt; MYSQL_STMT *stmt;
int rc; int rc;
int id;
ulong length;
MYSQL_BIND bind[1]; MYSQL_BIND bind[1];
myheader("test_subselect"); myheader("test_subselect");
...@@ -4849,9 +4852,33 @@ static void test_subselect() ...@@ -4849,9 +4852,33 @@ static void test_subselect()
/* fetch */ /* fetch */
bind[0].buffer_type= FIELD_TYPE_LONG; bind[0].buffer_type= FIELD_TYPE_LONG;
bind[0].buffer= (char *) &id; bind[0].buffer= (char *) &id;
bind[0].length= &length; bind[0].length= 0;
bind[0].is_null= 0; bind[0].is_null= 0;
length= 0;
stmt = mysql_prepare(mysql, "INSERT INTO test_sub2(id) SELECT * FROM test_sub1 WHERE id=?", 100);
mystmt_init(stmt);
rc = mysql_bind_param(stmt,bind);
mystmt(stmt, rc);
rc = mysql_bind_result(stmt,bind);
mystmt(stmt, rc);
id = 2;
rc = mysql_execute(stmt);
mystmt(stmt, rc);
verify_st_affected_rows(stmt, 1);
id = 9;
rc = mysql_execute(stmt);
mystmt(stmt, rc);
verify_st_affected_rows(stmt, 0);
mysql_stmt_close(stmt);
myassert(3 == my_stmt_result("SELECT * FROM test_sub2",50));
strmov((char *)query , "SELECT ROW(1,7) IN (select id, id1 from test_sub2 WHERE id1=?)"); strmov((char *)query , "SELECT ROW(1,7) IN (select id, id1 from test_sub2 WHERE id1=?)");
myassert(1 == my_stmt_result("SELECT ROW(1,7) IN (select id, id1 from test_sub2 WHERE id1=8)",100)); myassert(1 == my_stmt_result("SELECT ROW(1,7) IN (select id, id1 from test_sub2 WHERE id1=8)",100));
...@@ -4873,7 +4900,7 @@ static void test_subselect() ...@@ -4873,7 +4900,7 @@ static void test_subselect()
rc = mysql_fetch(stmt); rc = mysql_fetch(stmt);
mystmt(stmt,rc); mystmt(stmt,rc);
fprintf(stdout,"\n row 1: %d (%lu)",id, length); fprintf(stdout,"\n row 1: %d",id);
myassert(id == 1); myassert(id == 1);
rc = mysql_fetch(stmt); rc = mysql_fetch(stmt);
...@@ -4886,7 +4913,7 @@ static void test_subselect() ...@@ -4886,7 +4913,7 @@ static void test_subselect()
rc = mysql_fetch(stmt); rc = mysql_fetch(stmt);
mystmt(stmt,rc); mystmt(stmt,rc);
fprintf(stdout,"\n row 1: %d (%lu)",id, length); fprintf(stdout,"\n row 1: %d",id);
myassert(id == 0); myassert(id == 0);
rc = mysql_fetch(stmt); rc = mysql_fetch(stmt);
...@@ -5720,6 +5747,161 @@ static void test_stiny_bug() ...@@ -5720,6 +5747,161 @@ static void test_stiny_bug()
mysql_stmt_close(stmt); mysql_stmt_close(stmt);
} }
/********************************************************
* to test misc field information, bug: #74 *
*********************************************************/
static void test_field_misc()
{
MYSQL_STMT *stmt;
MYSQL_RES *result;
MYSQL_BIND bind[1];
char table_type[NAME_LEN];
ulong type_length;
int rc;
myheader("test_field_misc");
rc = mysql_query(mysql,"SELECT @@autocommit");
myquery(rc);
result = mysql_store_result(mysql);
mytest(result);
myassert(1 == my_process_result_set(result));
verify_prepare_field(result,0,
"@@autocommit","", /* field and its org name */
MYSQL_TYPE_LONGLONG, /* field type */
"", "", /* table and its org name */
"",1); /* db name, length(its bool flag)*/
mysql_free_result(result);
stmt = mysql_prepare(mysql,"SELECT @@autocommit",20);
mystmt_init(stmt);
rc = mysql_execute(stmt);
mystmt(stmt,rc);
result = mysql_prepare_result(stmt);
mytest(result);
myassert(1 == my_process_stmt_result(stmt));
verify_prepare_field(result,0,
"@@autocommit","", /* field and its org name */
MYSQL_TYPE_LONGLONG, /* field type */
"", "", /* table and its org name */
"",1); /* db name, length(its bool flag)*/
mysql_free_result(result);
mysql_stmt_close(stmt);
stmt = mysql_prepare(mysql, "SELECT @@table_type", 30);
mystmt_init(stmt);
rc = mysql_execute(stmt);
mystmt(stmt,rc);
bind[0].buffer_type= MYSQL_TYPE_STRING;
bind[0].buffer= table_type;
bind[0].length= &type_length;
bind[0].is_null= 0;
bind[0].buffer_length= NAME_LEN;
rc = mysql_bind_result(stmt, bind);
mystmt(stmt,rc);
rc = mysql_fetch(stmt);
mystmt(stmt,rc);
fprintf(stdout,"\n default table type: %s(%ld)", table_type, type_length);
rc = mysql_fetch(stmt);
myassert(rc == MYSQL_NO_DATA);
mysql_stmt_close(stmt);
stmt = mysql_prepare(mysql, "SELECT @@table_type", 30);
mystmt_init(stmt);
result = mysql_prepare_result(stmt);
mytest(result);
rc = mysql_execute(stmt);
mystmt(stmt,rc);
myassert(1 == my_process_stmt_result(stmt));
verify_prepare_field(result,0,
"@@table_type","", /* field and its org name */
MYSQL_TYPE_STRING, /* field type */
"", "", /* table and its org name */
"",type_length); /* db name, length */
mysql_free_result(result);
mysql_stmt_close(stmt);
stmt = mysql_prepare(mysql, "SELECT @@max_error_count", 30);
mystmt_init(stmt);
result = mysql_prepare_result(stmt);
mytest(result);
rc = mysql_execute(stmt);
mystmt(stmt,rc);
myassert(1 == my_process_stmt_result(stmt));
verify_prepare_field(result,0,
"@@max_error_count","", /* field and its org name */
MYSQL_TYPE_LONGLONG, /* field type */
"", "", /* table and its org name */
"",10); /* db name, length */
mysql_free_result(result);
mysql_stmt_close(stmt);
stmt = mysql_prepare(mysql, "SELECT @@max_allowed_packet", 30);
mystmt_init(stmt);
result = mysql_prepare_result(stmt);
mytest(result);
rc = mysql_execute(stmt);
mystmt(stmt,rc);
myassert(1 == my_process_stmt_result(stmt));
verify_prepare_field(result,0,
"@@max_allowed_packet","", /* field and its org name */
MYSQL_TYPE_LONGLONG, /* field type */
"", "", /* table and its org name */
"",10); /* db name, length */
mysql_free_result(result);
mysql_stmt_close(stmt);
stmt = mysql_prepare(mysql, "SELECT @@sql_warnings", 30);
mystmt_init(stmt);
result = mysql_prepare_result(stmt);
mytest(result);
rc = mysql_execute(stmt);
mystmt(stmt,rc);
myassert(1 == my_process_stmt_result(stmt));
verify_prepare_field(result,0,
"@@sql_warnings","", /* field and its org name */
MYSQL_TYPE_LONGLONG, /* field type */
"", "", /* table and its org name */
"",1); /* db name, length */
mysql_free_result(result);
mysql_stmt_close(stmt);
}
/* /*
Read and parse arguments and MySQL options from my.cnf Read and parse arguments and MySQL options from my.cnf
*/ */
...@@ -5937,6 +6119,7 @@ int main(int argc, char **argv) ...@@ -5937,6 +6119,7 @@ int main(int argc, char **argv)
test_ushort_bug(); /* test a simple conv bug from php */ test_ushort_bug(); /* test a simple conv bug from php */
test_sshort_bug(); /* test a simple conv bug from php */ test_sshort_bug(); /* test a simple conv bug from php */
test_stiny_bug(); /* test a simple conv bug from php */ test_stiny_bug(); /* test a simple conv bug from php */
test_field_misc(); /* check the field info for misc case, bug: #74 */
end_time= time((time_t *)0); end_time= time((time_t *)0);
total_time+= difftime(end_time, start_time); total_time+= difftime(end_time, start_time);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment