Commit 28a2c6a9 authored by pem@mysql.com's avatar pem@mysql.com

Merging 4.1->5.0.

parents 8e1584d7 c4871b24
......@@ -385,6 +385,10 @@ libmysqld/repl_failsafe.cc
libmysqld/set_var.cc
libmysqld/simple-test
libmysqld/slave.cc
libmysqld/sp.cc
libmysqld/sp_cache.cc
libmysqld/sp_head.cc
libmysqld/sp_pcontext.cc
libmysqld/spatial.cc
libmysqld/sql_acl.cc
libmysqld/sql_analyse.cc
......
......@@ -5,6 +5,7 @@ Administrator@fred.
Miguel@light.local
Sinisa@sinisa.nasamreza.org
WAX@sergbook.mysql.com
acurtis@pcgem.rdg.cyberkinetica.com
administrador@light.hegel.local
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
akishkin@work.mysql.com
......@@ -96,10 +97,12 @@ paul@ice.local
paul@ice.snake.net
paul@teton.kitebird.com
pem@mysql.com
pem@per-erik-martins-dator.local
peter@linux.local
peter@mysql.com
peterg@mysql.com
pgulutzan@linux.local
pmartin@build.mysql2.com
ram@deer.(none)
ram@gw.mysql.r18.ru
ram@gw.udmsearch.izhnet.ru
......
......@@ -6,6 +6,7 @@ FROM=$USER@mysql.com
INTERNALS=internals@lists.mysql.com
DOCS=docs-commit@mysql.com
LIMIT=10000
REPOV=5.0
if [ "$REAL_EMAIL" = "" ]
then
......@@ -27,15 +28,15 @@ CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet`
echo "Commit successful, notifying developers at $TO"
(
cat <<EOF
List-ID: <bk.mysql-4.1>
List-ID: <bk.mysql-$REPOV>
From: $FROM
To: $TO
Subject: bk commit - 4.1 tree ($CHANGESET)
Subject: bk commit - $REPOV tree ($CHANGESET)
EOF
bk changes -v -r+
bk cset -r+ -d
) | head -n $LIMIT | /usr/sbin/sendmail -t
) | /usr/sbin/sendmail -t
#++
# internals@ mail
......@@ -43,13 +44,13 @@ EOF
echo "Notifying internals list at $INTERNALS"
(
cat <<EOF
List-ID: <bk.mysql-4.1>
List-ID: <bk.mysql-$REPOV>
From: $FROM
To: $INTERNALS
Subject: bk commit into 4.1 tree ($CHANGESET)
Subject: bk commit into $REPOV tree ($CHANGESET)
Below is the list of changes that have just been committed into a local
4.1 repository of $USER. When $USER does a push these changes will
$REPOV repository of $USER. When $USER does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
......@@ -70,15 +71,15 @@ EOF
echo "Notifying docs list at $DOCS"
(
cat <<EOF
List-ID: <bk.mysql-4.1>
List-ID: <bk.mysql-$REPOV>
From: $FROM
To: $DOCS
Subject: bk commit - 4.1 tree (Manual) ($CHANGESET)
Subject: bk commit - $REPOV tree (Manual) ($CHANGESET)
EOF
bk changes -v -r+
bk cset -r+ -d
) | head -n $LIMIT | /usr/sbin/sendmail -t
) | /usr/sbin/sendmail -t
fi
else
......
This diff is collapsed.
Stored Procedures implemented 2003-09-16:
Summary of Not Yet Implemented:
- SQL queries (like SELECT, INSERT, UPDATE etc) in FUNCTION bodies
- External languages
- Access control
- Routine characteristics (mostly used for external languages)
- SQL-99 COMMIT (related to BEGIN/END)
- FOR-loops
- CASCADE/RESTRICT for ALTER and DROP
- ALTER/DROP METHOD (as it implies User Defined Types)
- SIGNAL and RESIGNAL, and UNDO handlers
Summary of what's implemented:
- SQL PROCEDUREs/FUNCTIONs (CREATE/DROP)
- CALL
- DECLARE of local variables
- BEGIN/END, SET, CASE, IF, LOOP, WHILE, REPEAT, ITERATE, LEAVE
- SELECT INTO local variables
- "Non-query" FUNCTIONs only
- Prepared SP caching
- CONDITIONs and HANDLERs
- Simple read-only CURSORs.
List of what's implemented:
- CREATE PROCEDURE|FUNCTION name ( args ) body
No routine characteristics yet.
- ALTER PROCEDURE|FUNCTION name ...
Is parsed, but a no-op (as there are no characteristics implemented yet).
CASCADE/RESTRICT is not implemented (and CASCADE probably will not be).
- DROP PROCEDURE|FUNCTION [IF EXISTS] name
CASCADE/RESTRICT is not implemented (and CASCADE probably will not be).
- CALL name (args)
OUT and INOUT parameters are only supported for local variables, and
therefore only useful when calling such procedures from within another
procedure.
Note: For the time being, when a procedure with OUT/INOUT parameter is
called, the out values are silently discarded. In the future, this
will either generate an error message, or it might even work to
call all procedures from the top-level.
- Function/Procedure body:
- BEGIN/END
Is parsed, but not the real thing with (optional) transaction
control, it only serves as block syntax for multiple statements (and
local variable binding).
Note: Multiple statements requires a client that can send bodies
containing ";". This is handled in the CLI clients mysql and
mysqltest with the "delimiter" command. Changing the end-of-query
delimiter ";" to for instance "|" allows ";" to be used in the
routine body.
- SET of local variables
Implemented as part of the pre-existing SET syntax. This allows an
extended syntax of "SET a=x, b=y, ..." where different variable types
(SP local and global) can be mixed. This also allows combinations
of local variables and some options that only make sense for
global/system variables; in that case the options are accepted but
ignored.
- The flow control constructs: CASE, IF, LOOP, WHILE, ITERATE and LEAVE
are fully implemented.
- SELECT ... INTO local variables (as well as global session variables)
is implemented. (Note: This is not SQL-99 feature, but common in other
databases.)
- A FUNCTION can have flow control contructs, but must not contain
an SQL query, like SELECT, INSERT, UPDATE, etc. The reason is that it's
hard to allow this is that a FUNCTION is executed as part of another
query (unlike a PROCEDURE, which is called as a statement). The table
locking scheme used makes it difficult to allow "subqueries" during
FUNCTION invokation.
- SPs are cached, but with a separate cache for each thread (THD).
There are still quite a few non-reentrant constructs in the lexical
context which makes sharing prepared SPs impossible. And, even when
this is resolved, it's not necessarily the case that it will be faster
than a cache per thread. A global cache requires locks, which might
become a buttleneck. (It would save memory though.)
- CONDITIONs and HANDLERs are implemented, but not the SIGNAL and
RESIGNAL statements. (It's unclear if these can be implemented.)
The semantics of CONDITIONs is expanded to allow catching MySQL error
codes as well. UNDO handlers are not implemented (since we don't have
SQL-99 style transaction control yet).
- Simple read-only CURSORs are implemented, but not yet any of the
optional arguments to DECLARE (SCROLL, SENSITIVE, etc) or FETCH
(NEXT, PRIOR, etc). Cursors are ASENSITIVE, READ-ONLY, non-SCROLLing.
(The additional syntax will be added for completeness, but for the
most part unsupported with the current underlying cursor mechanism.)
Closed questions:
- What is the expected result when creating a procedure with a name that
already exists? An error or overwrite?
Answer: Error
- Do PROCEDUREs and FUNCTIONs share namespace or not? I think not, but the
we need to flag the type in the mysql.proc table and the name alone is
not a unique key any more, or, we have separate tables.
(Unfortunately, mysql.func is already taken. Use "sfunc" and maybe even
rename "proc" into "sproc" while we still can, for consistency?)
Answer: Same tables, with an additional key-field for the type.
Open questions/issues:
- SQL-99 variables and parameters are typed. For the present we don't do
any type checking, since this is the way MySQL works. I still don't know
if we should keep it this way, or implement type checking. Possibly we
should have optional, uset-settable, type checking.
......@@ -2815,6 +2815,7 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
{
va_list args;
NETWARE_YIELD
va_start(args, fmt);
(void) vfprintf(file, fmt, args);
#ifdef OS2
......@@ -2828,6 +2829,7 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
void tee_fputs(const char *s, FILE *file)
{
NETWARE_YIELD
fputs(s, file);
#ifdef OS2
fflush( file);
......@@ -2839,6 +2841,7 @@ void tee_fputs(const char *s, FILE *file)
void tee_puts(const char *s, FILE *file)
{
NETWARE_YIELD
fputs(s, file);
fputs("\n", file);
#ifdef OS2
......
......@@ -91,6 +91,7 @@
#define SLAVE_POLL_INTERVAL 300000 /* 0.3 of a sec */
#define DEFAULT_DELIMITER ';'
enum {OPT_MANAGER_USER=256,OPT_MANAGER_HOST,OPT_MANAGER_PASSWD,
OPT_MANAGER_PORT,OPT_MANAGER_WAIT_TIMEOUT, OPT_SKIP_SAFEMALLOC,
......@@ -137,6 +138,8 @@ static const char *embedded_server_groups[] = {
NullS
};
static char delimiter= DEFAULT_DELIMITER;
DYNAMIC_ARRAY q_lines;
#include "sslopt-vars.h"
......@@ -215,6 +218,7 @@ Q_REQUIRE_VERSION,
Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS,
Q_ENABLE_INFO, Q_DISABLE_INFO,
Q_EXEC,
Q_DELIMITER,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
Q_COMMENT_WITH_COMMAND
......@@ -286,6 +290,7 @@ const char *command_names[]=
"enable_info",
"disable_info",
"exec",
"delimiter",
0
};
......@@ -1627,6 +1632,17 @@ int do_while(struct st_query* q)
return 0;
}
int do_delimiter(char *p)
{
while (*p && my_isspace(charset_info,*p))
p++;
if (!*p)
die("Missing delimiter character\n");
delimiter=*p;
return 0;
}
int read_line(char* buf, int size)
{
......@@ -1656,7 +1672,7 @@ int read_line(char* buf, int size)
switch(state) {
case R_NORMAL:
/* Only accept '{' in the beginning of a line */
if (c == ';')
if (c == delimiter)
{
*p = 0;
return 0;
......@@ -1696,7 +1712,7 @@ int read_line(char* buf, int size)
*buf = 0;
return 0;
}
else if (c == ';' || c == '{')
else if (c == delimiter || c == '{')
{
*p = 0;
return 0;
......@@ -1716,7 +1732,7 @@ int read_line(char* buf, int size)
state = R_ESC_SLASH_Q1;
break;
case R_ESC_Q_Q1:
if (c == ';')
if (c == delimiter)
{
*p = 0;
return 0;
......@@ -1737,7 +1753,7 @@ int read_line(char* buf, int size)
state = R_ESC_SLASH_Q2;
break;
case R_ESC_Q_Q2:
if (c == ';')
if (c == delimiter)
{
*p = 0;
return 0;
......@@ -2609,6 +2625,9 @@ int main(int argc, char **argv)
do_sync_with_master2("");
break;
}
case Q_DELIMITER:
do_delimiter(q->first_argument);
break;
case Q_COMMENT: /* Ignore row */
case Q_COMMENT_WITH_COMMAND:
break;
......
......@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
AM_INIT_AUTOMAKE(mysql, 4.1.1-alpha)
AM_INIT_AUTOMAKE(mysql, 5.0.0-alpha)
AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10
......@@ -36,7 +36,7 @@ for i in $AVAILABLE_LANGUAGES
do
AVAILABLE_LANGUAGES_ERRORS="$AVAILABLE_LANGUAGES_ERRORS $i/errmsg.sys"
case $host_os in
netware* | modesto*)
netware*)
echo "$i/errmsg.sys: $i/errmsg.txt
\$(top_builddir)/extra/comp_err.linux -C\$(srcdir)/charsets/ \$^ $i/errmsg.sys" \
>> $AVAILABLE_LANGUAGES_ERRORS_RULES
......@@ -458,7 +458,7 @@ else
*cygwin*)
FIND_PROC="$PS -e | grep mysqld | grep \" \$\$PID \" > /dev/null"
;;
*netware* | *modesto*)
*netware*)
FIND_PROC=
;;
*)
......@@ -1551,7 +1551,7 @@ AC_SUBST(LIBDL)
# System characteristics
case $SYSTEM_TYPE in
*netware* | *modesto*) ;;
*netware*) ;;
*)
AC_SYS_RESTARTABLE_SYSCALLS
;;
......@@ -1581,10 +1581,12 @@ else
fi
if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then
DEBUG_CFLAGS="$DEBUG_CFLAGS -DDEBUG -sym internal,codeview4"
DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -DDEBUG -sym internal,codeview4"
OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -DNDEBUG"
OPTIMIZE_CXXFLAGS="$OPTIMIZE_CXXFLAGS -DNDEBUG"
DEBUG_CFLAGS="-g -DDEBUG -sym internal,codeview4"
DEBUG_CXXFLAGS="-g -DDEBUG -sym internal,codeview4"
DEBUG_OPTIMIZE_CC="-DDEBUG"
DEBUG_OPTIMIZE_CXX="-DDEBUG"
OPTIMIZE_CFLAGS="-O3 -DNDEBUG"
OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG"
fi
AC_ARG_WITH(debug,
......
......@@ -14,7 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Defines for netware compatible with MySQL */
/* Header for NetWare compatible with MySQL */
#ifndef _config_netware_h
#define _config_netware_h
/* required headers */
#include <unistd.h>
......@@ -32,6 +35,10 @@
#include <pthread.h>
#include <termios.h>
#ifdef __cplusplus
extern "C" {
#endif
/* required adjustments */
#undef HAVE_READDIR_R
#undef HAVE_RWLOCK_INIT
......@@ -80,6 +87,15 @@
/* do not use the extended time in LibC sys\stat.h */
#define _POSIX_SOURCE
/* Some macros for portability */
/* kernal call on NetWare that will only yield if our time slice is up */
void kYieldIfTimeSliceUp(void);
/* some macros for portability */
#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=(SEC); (ABSTIME).tv_nsec=0; }
#ifdef __cplusplus
}
#endif
#endif /* _config_netware_h */
......@@ -73,6 +73,13 @@
#endif
#endif /* _WIN32... */
/* extra protection against CPU Hogs on NetWare */
#ifdef __NETWARE__
#define NETWARE_YIELD { kYieldIfTimeSliceUp(); }
#else
#define NETWARE_YIELD { }
#endif
/*
The macros below are borrowed from include/linux/compiler.h in the
Linux kernel. Use them to indicate the likelyhood of the truthfulness
......
......@@ -130,6 +130,8 @@ enum enum_server_command
#define NET_WRITE_TIMEOUT 60 /* Timeout on write */
#define NET_WAIT_TIMEOUT 8*60*60 /* Wait for new query */
#define ONLY_KILL_QUERY 1
struct st_vio; /* Only C */
typedef struct st_vio Vio;
......@@ -291,6 +293,8 @@ typedef struct st_udf_args
char **args; /* Pointer to argument */
unsigned long *lengths; /* Length of string arguments */
char *maybe_null; /* Set to 1 for all maybe_null args */
char **attributes; /* Pointer to attribute name */
unsigned long *attribute_lengths; /* Length of attribute arguments */
} UDF_ARGS;
/* This holds information about the result */
......
......@@ -300,4 +300,36 @@
#define ER_WARN_QC_RESIZE 1281
#define ER_BAD_FT_COLUMN 1282
#define ER_UNKNOWN_KEY_CACHE 1283
#define ER_ERROR_MESSAGES 284
#define ER_SP_NO_RECURSIVE_CREATE 1284
#define ER_SP_ALREADY_EXISTS 1285
#define ER_SP_DOES_NOT_EXIST 1286
#define ER_SP_DROP_FAILED 1287
#define ER_SP_STORE_FAILED 1288
#define ER_SP_LILABEL_MISMATCH 1289
#define ER_SP_LABEL_REDEFINE 1290
#define ER_SP_LABEL_MISMATCH 1291
#define ER_SP_UNINIT_VAR 1292
#define ER_SP_BADSELECT 1293
#define ER_SP_BADRETURN 1294
#define ER_SP_BADQUERY 1295
#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1296
#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1297
#define ER_QUERY_INTERRUPTED 1298
#define ER_SP_WRONG_NO_OF_ARGS 1299
#define ER_SP_COND_MISMATCH 1300
#define ER_SP_NORETURN 1301
#define ER_SP_NORETURNEND 1302
#define ER_SP_BAD_CURSOR_QUERY 1303
#define ER_SP_BAD_CURSOR_SELECT 1304
#define ER_SP_CURSOR_MISMATCH 1305
#define ER_SP_CURSOR_ALREADY_OPEN 1306
#define ER_SP_CURSOR_NOT_OPEN 1307
#define ER_SP_UNDECLARED_VAR 1308
#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1309
#define ER_SP_FETCH_NO_DATA 1310
#define ER_SP_DUP_PARAM 1311
#define ER_SP_DUP_VAR 1312
#define ER_SP_DUP_COND 1313
#define ER_SP_DUP_CURS 1314
#define ER_SP_CANT_ALTER 1315
#define ER_ERROR_MESSAGES 316
......@@ -3167,6 +3167,7 @@ MYSQL_DATA * STDCALL cli_read_binary_rows(MYSQL_STMT *stmt)
if (pkt_len > 1)
{
mysql->warning_count= uint2korr(cp+1);
mysql->server_status= uint2korr(cp+3);
DBUG_PRINT("info",("warning_count: %ld", mysql->warning_count));
}
DBUG_PRINT("exit",("Got %d rows",result->rows));
......
......@@ -57,7 +57,8 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \
sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \
unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \
spatial.cc gstream.cc sql_help.cc
spatial.cc gstream.cc sql_help.cc protocol_cursor.cc \
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc
libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources)
libmysqld_a_SOURCES=
......
......@@ -754,7 +754,7 @@ bool Protocol::convert_str(const char *from, uint length)
bool setup_params_data(st_prep_stmt *stmt)
{
THD *thd= stmt->thd;
List<Item> &params= thd->lex.param_list;
List<Item> &params= thd->lex->param_list;
List_iterator<Item> param_iterator(params);
Item_param *param;
ulong param_no= 0;
......@@ -787,7 +787,7 @@ bool setup_params_data(st_prep_stmt *stmt)
bool setup_params_data_withlog(st_prep_stmt *stmt)
{
THD *thd= stmt->thd;
List<Item> &params= thd->lex.param_list;
List<Item> &params= thd->lex->param_list;
List_iterator<Item> param_iterator(params);
Item_param *param;
MYSQL_BIND *client_param= thd->client_params;
......
......@@ -2633,7 +2633,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
char llbuff[22],llbuff2[22];
DBUG_ENTER("sort_get_next_record");
if (*killed_ptr(param))
if (*killed_ptr(param->thd))
DBUG_RETURN(1);
switch (share->data_file_type) {
......
......@@ -1667,9 +1667,9 @@ static int sort_record_index(MI_SORT_PARAM *sort_param,MI_INFO *info,
DBUG_RETURN(1);
} /* sort_record_index */
volatile bool *killed_ptr(MI_CHECK *param)
int *killed_ptr(void *thd)
{
return (bool *)(& param->thd); /* always NULL */
return (int *)thd; /* always NULL */
}
/* print warnings and errors */
......
......@@ -703,7 +703,7 @@ int mi_open_keyfile(MYISAM_SHARE *share);
void mi_setup_functions(register MYISAM_SHARE *share);
/* Functions needed by mi_check */
volatile bool *killed_ptr(MI_CHECK *param);
int *killed_ptr(void *thd);
void mi_check_print_error _VARARGS((MI_CHECK *param, const char *fmt,...));
void mi_check_print_warning _VARARGS((MI_CHECK *param, const char *fmt,...));
void mi_check_print_info _VARARGS((MI_CHECK *param, const char *fmt,...));
......
......@@ -848,7 +848,8 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
uchar *strpos;
BUFFPEK *buffpek,**refpek;
QUEUE queue;
volatile bool *killed= killed_ptr(info->sort_info->param);
int *killed= killed_ptr(info->sort_info->param->thd);
DBUG_ENTER("merge_buffers");
count=error=0;
......
......@@ -8,6 +8,7 @@ help_keyword
help_relation
help_topic
host
proc
tables_priv
user
show tables;
......@@ -24,6 +25,7 @@ help_keyword
help_relation
help_topic
host
proc
tables_priv
user
show tables;
......@@ -41,6 +43,7 @@ help_keyword
help_relation
help_topic
host
proc
tables_priv
user
show tables;
......
......@@ -457,10 +457,10 @@ drop table t1,t2;
CREATE TABLE t1 (
html varchar(5) default NULL,
rin int(11) default '0',
out int(11) default '0'
rout int(11) default '0'
) TYPE=MyISAM;
INSERT INTO t1 VALUES ('1',1,0);
SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
SELECT DISTINCT html,SUM(rout)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
html prod
1 0.00
drop table t1;
......@@ -86,3 +86,16 @@ use mysqltest;
create table t1 (c int);
insert into mysqltest.t1 set mysqltest.t1.c = '1';
drop database mysqltest;
use test;
drop table if exists t1,t2,t3;
create table t1(id1 int not null auto_increment primary key, t char(12));
create table t2(id2 int not null, t char(12));
create table t3(id3 int not null, t char(12), index(id3));
select count(*) from t2;
count(*)
500
insert into t2 select t1.* from t1, t2 t, t3 where t1.id1 = t.id2 and t.id2 = t3.id3;
select count(*) from t2;
count(*)
25500
drop table if exists t1,t2,t3;
......@@ -809,4 +809,29 @@ show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 4
DROP TABLE t1;
create table t1 (a int);
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 48
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
/**/ select * from t1;
a
/**/ select * from t1;
a
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 49
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 13
drop table t1;
SET GLOBAL query_cache_size=0;
......@@ -127,6 +127,7 @@ insert into t1 values (1);
show open tables;
Database Table In_use Name_locked
test t1 0 0
mysql proc 0 0
drop table t1;
create table t1 (a int not null, b VARCHAR(10), INDEX (b) ) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" TYPE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed;
show create table t1;
......
delete from mysql.proc;
create procedure syntaxerror(t int);
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
create procedure syntaxerror(t int);
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
create procedure syntaxerror(t int);
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
create procedure proc1()
set @x = 42;
create function func1() returns int
return 42;
create procedure foo()
create procedure bar() set @x=3;
ERROR HY000: Can't create a PROCEDURE from within another stored routine
create procedure foo()
create function bar() returns double return 2.3;
ERROR HY000: Can't create a FUNCTION from within another stored routine
create procedure proc1()
set @x = 42;
ERROR HY000: PROCEDURE proc1 already exists
create function func1() returns int
return 42;
ERROR HY000: FUNCTION func1 already exists
drop procedure proc1;
drop function func1;
alter procedure foo;
ERROR HY000: PROCEDURE foo does not exist
alter function foo;
ERROR HY000: FUNCTION foo does not exist
drop procedure foo;
ERROR HY000: PROCEDURE foo does not exist
drop function foo;
ERROR HY000: FUNCTION foo does not exist
call foo();
ERROR HY000: PROCEDURE foo does not exist
drop procedure if exists foo;
Warnings:
Warning 1282 PROCEDURE foo does not exist
create procedure foo()
foo: loop
leave bar;
end loop;
ERROR HY000: LEAVE with no matching label: bar
create procedure foo()
foo: loop
iterate bar;
end loop;
ERROR HY000: ITERATE with no matching label: bar
create procedure foo()
foo: begin
iterate foo;
end;
ERROR HY000: ITERATE with no matching label: foo
create procedure foo()
foo: loop
foo: loop
set @x=2;
end loop foo;
end loop foo;
ERROR HY000: Redefining label foo
create procedure foo()
foo: loop
set @x=2;
end loop bar;
ERROR HY000: End-label bar without match
create procedure foo(out x int)
begin
declare y int;
set x = y;
end;
ERROR HY000: Referring to uninitialized variable y
create procedure foo()
begin
select name from mysql.proc;
select type from mysql.proc;
end;
call foo();
ERROR HY000: SELECT in a stored procedure must have INTO
drop procedure foo;
create procedure foo()
return 42;
ERROR HY000: RETURN is only allowed in a FUNCTION
create function foo() returns int
begin
declare x int;
select max(c) into x from test.t;
return x;
end;
ERROR HY000: Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION
create procedure p(x int)
insert into test.t1 values (x);
create function f(x int) returns int
return x+42;
call p();
ERROR HY000: Wrong number of arguments for PROCEDURE p, expected 1, got 0
call p(1, 2);
ERROR HY000: Wrong number of arguments for PROCEDURE p, expected 1, got 2
select f();
ERROR HY000: Wrong number of arguments for FUNCTION f, expected 1, got 0
select f(1, 2);
ERROR HY000: Wrong number of arguments for FUNCTION f, expected 1, got 2
drop procedure p;
drop function f;
create procedure p(val int, out res int)
begin
declare x int default 0;
declare continue handler for foo set x = 1;
insert into test.t1 values (val);
if (x) then
set res = 0;
else
set res = 1;
end if;
end;
ERROR HY000: Undefined CONDITION: foo
create procedure p(val int, out res int)
begin
declare x int default 0;
declare foo condition for 1146;
declare continue handler for bar set x = 1;
insert into test.t1 values (val);
if (x) then
set res = 0;
else
set res = 1;
end if;
end;
ERROR HY000: Undefined CONDITION: bar
create function f(val int) returns int
begin
declare x int;
set x = val+3;
end;
ERROR HY000: No RETURN found in FUNCTION f
create function f(val int) returns int
begin
declare x int;
set x = val+3;
if x < 4 then
return x;
end if;
end;
select f(10);
ERROR HY000: FUNCTION f ended without RETURN
drop function f;
create procedure p()
begin
declare c cursor for insert into test.t1 values ("foo", 42);
open c;
close c;
end;
ERROR HY000: Cursor statement must be a SELECT
create procedure p()
begin
declare x int;
declare c cursor for select * into x from test.t limit 1;
open c;
close c;
end;
ERROR HY000: Cursor SELECT must not have INTO
create procedure p()
begin
declare c cursor for select * from test.t;
open cc;
close c;
end;
ERROR HY000: Undefined CURSOR: cc
drop table if exists t1;
create table t1 (val int);
create procedure p()
begin
declare c cursor for select * from test.t1;
open c;
open c;
close c;
end;
call p();
ERROR HY000: Cursor is already open
drop procedure p;
create procedure p()
begin
declare c cursor for select * from test.t1;
open c;
close c;
close c;
end;
call p();
ERROR HY000: Cursor is not open
drop procedure p;
alter procedure bar3 sql security invoker;
ERROR HY000: PROCEDURE bar3 does not exist
alter procedure bar3 name
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
ERROR 42000: Identifier name 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' is too long
drop table t1;
drop table if exists t1;
create table t1 (val int, x float);
insert into t1 values (42, 3.1), (19, 1.2);
create procedure p()
begin
declare c cursor for select * from t1;
declare x int;
open c;
fetch c into x, y;
close c;
end;
ERROR HY000: Undeclared variable: y
create procedure p()
begin
declare c cursor for select * from t1;
declare x int;
open c;
fetch c into x;
close c;
end;
call p();
ERROR HY000: Wrong number of FETCH variables
drop procedure p;
create procedure p()
begin
declare c cursor for select * from t1;
declare x int;
declare y float;
declare z int;
open c;
fetch c into x, y, z;
close c;
end;
call p();
ERROR HY000: Wrong number of FETCH variables
drop procedure p;
create procedure p(in x int, x char(10))
begin
end;
ERROR HY000: Duplicate parameter: x
create function p(x int, x char(10))
begin
end;
ERROR HY000: Duplicate parameter: x
create procedure p()
begin
declare x float;
declare x int;
end;
ERROR HY000: Duplicate variable: x
create procedure p()
begin
declare c condition for 1064;
declare c condition for 1065;
end;
ERROR HY000: Duplicate condition: c
create procedure p()
begin
declare c cursor for select * from t1;
declare c cursor for select field from t1;
end;
ERROR HY000: Duplicate cursor: c
drop table t1;
This diff is collapsed.
......@@ -14,6 +14,6 @@ update t1 set n = 3;
unlock tables;
show status like 'Table_lock%';
Variable_name Value
Table_locks_immediate 3
Table_locks_immediate 4
Table_locks_waited 1
drop table t1;
......@@ -647,6 +647,14 @@ x
3
3
INSERT INTO t1 (x) select (SELECT SUM(x)+2 FROM t1) FROM t2;
select * from t1;
x
1
2
3
3
11
11
INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(x) FROM t2));
ERROR 42S22: Unknown column 'x' in 'field list'
INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2));
......
drop table if exists t1,t2;
set @`test`=1,@TEST=3,@select=2,@t5=1.23456;
select @test,@`select`,@TEST,@not_used;
@test @`select` @TEST @not_used
1 2 3 NULL
set @`test`=1;
select @test, @`test`, @TEST, @`TEST`, @"teSt";
@test @`test` @TEST @`TEST` @"teSt"
1 1 1 1 1
set @TEST=2;
select @test, @`test`, @TEST, @`TEST`, @"teSt";
@test @`test` @TEST @`TEST` @"teSt"
2 2 2 2 2
set @"tEST"=3;
select @test, @`test`, @TEST, @`TEST`, @"teSt";
@test @`test` @TEST @`TEST` @"teSt"
3 3 3 3 3
set @`TeST`=4;
select @test, @`test`, @TEST, @`TEST`, @"teSt";
@test @`test` @TEST @`TEST` @"teSt"
4 4 4 4 4
select @`teST`:=5;
@`teST`:=5
5
select @test, @`test`, @TEST, @`TEST`, @"teSt";
@test @`test` @TEST @`TEST` @"teSt"
5 5 5 5 5
set @select=2,@t5=1.23456;
select @`select`,@not_used;
@`select` @not_used
2 NULL
set @test_int=10,@test_double=1e-10,@test_string="abcdeghi",@test_string2="abcdefghij",@select=NULL;
select @test_int,@test_double,@test_string,@test_string2,@select;
@test_int @test_double @test_string @test_string2 @select
......@@ -337,6 +359,8 @@ set sql_buffer_result=1;
set sql_log_bin=1;
set sql_log_off=1;
set sql_log_update=1;
Warnings:
Note 1292 The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored.
set sql_low_priority_updates=1;
set sql_max_join_size=200;
select @@sql_max_join_size,@@max_join_size;
......
......@@ -326,9 +326,9 @@ drop table t1,t2;
CREATE TABLE t1 (
html varchar(5) default NULL,
rin int(11) default '0',
out int(11) default '0'
rout int(11) default '0'
) TYPE=MyISAM;
INSERT INTO t1 VALUES ('1',1,0);
SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
SELECT DISTINCT html,SUM(rout)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
drop table t1;
......@@ -87,3 +87,34 @@ use mysqltest;
create table t1 (c int);
insert into mysqltest.t1 set mysqltest.t1.c = '1';
drop database mysqltest;
use test;
--disable_warnings
drop table if exists t1,t2,t3;
--enable_warnings
create table t1(id1 int not null auto_increment primary key, t char(12));
create table t2(id2 int not null, t char(12));
create table t3(id3 int not null, t char(12), index(id3));
disable_query_log;
let $1 = 100;
while ($1)
{
let $2 = 5;
eval insert into t1(t) values ('$1');
while ($2)
{
eval insert into t2(id2,t) values ($1,'$2');
let $3 = 10;
while ($3)
{
eval insert into t3(id3,t) values ($1,'$2');
dec $3;
}
dec $2;
}
dec $1;
}
enable_query_log;
select count(*) from t2;
insert into t2 select t1.* from t1, t2 t, t3 where t1.id1 = t.id2 and t.id2 = t3.id3;
select count(*) from t2;
drop table if exists t1,t2,t3;
......@@ -581,6 +581,21 @@ set character_set_results=cp1251;
SELECT a,'',''='' FROM t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
drop table t1;
#
# comments before command
#
create table t1 (a int);
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
/**/ select * from t1;
/**/ select * from t1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
#
# Keep things tidy
#
......
#
# Stored PROCEDURE error tests
#
# Make sure we don't have any procedures left.
delete from mysql.proc;
delimiter |;
# This should give three syntax errors (sometimes crashed; bug #643)
# (Unfortunately, this is not a 100% test, on some platforms this
# passed despite the bug.)
--error 1064
create procedure syntaxerror(t int)|
--error 1064
create procedure syntaxerror(t int)|
--error 1064
create procedure syntaxerror(t int)|
# Check that we get the right error, i.e. UDF declaration parses correctly,
# but foo.so doesn't exist.
# QQ This generates an error message containing a misleading errno which
# might vary between systems (it usually doesn't have anything to do with
# the actual failing dlopen()).
#--error 1126
#create function foo returns real soname "foo.so"|
create procedure proc1()
set @x = 42|
create function func1() returns int
return 42|
# Can't create recursively
--error 1280
create procedure foo()
create procedure bar() set @x=3|
--error 1280
create procedure foo()
create function bar() returns double return 2.3|
# Already exists
--error 1281
create procedure proc1()
set @x = 42|
--error 1281
create function func1() returns int
return 42|
drop procedure proc1|
drop function func1|
# Does not exist
--error 1282
alter procedure foo|
--error 1282
alter function foo|
--error 1282
drop procedure foo|
--error 1282
drop function foo|
--error 1282
call foo()|
drop procedure if exists foo|
# LEAVE/ITERATE with no match
--error 1285
create procedure foo()
foo: loop
leave bar;
end loop|
--error 1285
create procedure foo()
foo: loop
iterate bar;
end loop|
--error 1285
create procedure foo()
foo: begin
iterate foo;
end|
# Redefining label
--error 1286
create procedure foo()
foo: loop
foo: loop
set @x=2;
end loop foo;
end loop foo|
# End label mismatch
--error 1287
create procedure foo()
foo: loop
set @x=2;
end loop bar|
# Referring to undef variable
--error 1288
create procedure foo(out x int)
begin
declare y int;
set x = y;
end|
# We require INTO in SELECTs for some older clients (as mysql and mysqltest,
# for now).
create procedure foo()
begin
select name from mysql.proc;
select type from mysql.proc;
end|
--error 1289
call foo()|
drop procedure foo|
# RETURN in FUNCTION only
--error 1290
create procedure foo()
return 42|
# Doesn't allow queries in FUNCTIONs (for now :-( )
--error 1291
create function foo() returns int
begin
declare x int;
select max(c) into x from test.t;
return x;
end|
# Wrong number of arguments
create procedure p(x int)
insert into test.t1 values (x)|
create function f(x int) returns int
return x+42|
--error 1295
call p()|
--error 1295
call p(1, 2)|
--error 1295
select f()|
--error 1295
select f(1, 2)|
drop procedure p|
drop function f|
--error 1296
create procedure p(val int, out res int)
begin
declare x int default 0;
declare continue handler for foo set x = 1;
insert into test.t1 values (val);
if (x) then
set res = 0;
else
set res = 1;
end if;
end|
--error 1296
create procedure p(val int, out res int)
begin
declare x int default 0;
declare foo condition for 1146;
declare continue handler for bar set x = 1;
insert into test.t1 values (val);
if (x) then
set res = 0;
else
set res = 1;
end if;
end|
--error 1297
create function f(val int) returns int
begin
declare x int;
set x = val+3;
end|
create function f(val int) returns int
begin
declare x int;
set x = val+3;
if x < 4 then
return x;
end if;
end|
--error 1298
select f(10)|
drop function f|
--error 1299
create procedure p()
begin
declare c cursor for insert into test.t1 values ("foo", 42);
open c;
close c;
end|
--error 1300
create procedure p()
begin
declare x int;
declare c cursor for select * into x from test.t limit 1;
open c;
close c;
end|
--error 1301
create procedure p()
begin
declare c cursor for select * from test.t;
open cc;
close c;
end|
--disable_warnings
drop table if exists t1|
--enable_warnings
create table t1 (val int)|
create procedure p()
begin
declare c cursor for select * from test.t1;
open c;
open c;
close c;
end|
--error 1302
call p()|
drop procedure p|
create procedure p()
begin
declare c cursor for select * from test.t1;
open c;
close c;
close c;
end|
--error 1303
call p()|
drop procedure p|
--error 1282
alter procedure bar3 sql security invoker|
--error 1059
alter procedure bar3 name
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA|
drop table t1|
--disable_warnings
drop table if exists t1|
--enable_warnings
create table t1 (val int, x float)|
insert into t1 values (42, 3.1), (19, 1.2)|
--error 1304
create procedure p()
begin
declare c cursor for select * from t1;
declare x int;
open c;
fetch c into x, y;
close c;
end|
create procedure p()
begin
declare c cursor for select * from t1;
declare x int;
open c;
fetch c into x;
close c;
end|
--error 1305
call p()|
drop procedure p|
create procedure p()
begin
declare c cursor for select * from t1;
declare x int;
declare y float;
declare z int;
open c;
fetch c into x, y, z;
close c;
end|
--error 1305
call p()|
drop procedure p|
--error 1307
create procedure p(in x int, x char(10))
begin
end|
--error 1307
create function p(x int, x char(10))
begin
end|
--error 1308
create procedure p()
begin
declare x float;
declare x int;
end|
--error 1309
create procedure p()
begin
declare c condition for 1064;
declare c condition for 1065;
end|
--error 1310
create procedure p()
begin
declare c cursor for select * from t1;
declare c cursor for select field from t1;
end|
drop table t1|
delimiter ;|
This diff is collapsed.
......@@ -352,7 +352,9 @@ INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2));
select * from t1;
INSERT INTO t1 (x) select (SELECT SUM(a)+1 FROM t2) FROM t2;
select * from t1;
# After this, only data based on old t1 records should have been added.
INSERT INTO t1 (x) select (SELECT SUM(x)+2 FROM t1) FROM t2;
select * from t1;
-- error 1054
INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(x) FROM t2));
INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2));
......@@ -507,6 +509,9 @@ select ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a');
select ROW(1, 1, 'a') IN (select b,a,c from t1 limit 2);
drop table t1;
#
# DO & SET
#
create table t1 (a int);
insert into t1 values (1);
do @a:=(SELECT a from t1);
......
......@@ -5,8 +5,20 @@
drop table if exists t1,t2;
--enable_warnings
set @`test`=1,@TEST=3,@select=2,@t5=1.23456;
select @test,@`select`,@TEST,@not_used;
# case insensitivity tests (new in 5.0)
set @`test`=1;
select @test, @`test`, @TEST, @`TEST`, @"teSt";
set @TEST=2;
select @test, @`test`, @TEST, @`TEST`, @"teSt";
set @"tEST"=3;
select @test, @`test`, @TEST, @`TEST`, @"teSt";
set @`TeST`=4;
select @test, @`test`, @TEST, @`TEST`, @"teSt";
select @`teST`:=5;
select @test, @`test`, @TEST, @`TEST`, @"teSt";
set @select=2,@t5=1.23456;
select @`select`,@not_used;
set @test_int=10,@test_double=1e-10,@test_string="abcdeghi",@test_string2="abcdefghij",@select=NULL;
select @test_int,@test_double,@test_string,@test_string2,@select;
set @test_int="hello",@test_double="hello",@test_string="hello",@test_string2="hello";
......
......@@ -29,7 +29,7 @@ rm -rf Makefile.in.bk
make clean bin-dist
# mark the build
for file in *.tar.gz
for file in *.tar.gz *.zip
do
if (expr "$file" : "mysql-[1-9].*" > /dev/null)
then
......
......@@ -8,6 +8,7 @@ set -e
path=`dirname $0`
$path/compile-netware-src
$path/compile-netware-standard
$path/compile-netware-debug
#$path/compile-netware-max
......
......@@ -13,7 +13,7 @@ path=`dirname $0`
suffix="standard"
extra_configs=" \
--with-innodb
--with-innodb \
"
. $path/compile-netware-END
......
......@@ -7,8 +7,8 @@
export MYDEV="WINE_BUILD_DIR"
export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/zlib-1.1.4"
export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/zlib-1.1.4"
export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a"
export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/mysql-VERSION/netware/BUILD;$MYDEV/zlib-1.1.4"
export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;knetware.imp;libz.a"
export WINEPATH="$MYDEV/mw/bin"
......@@ -19,9 +19,9 @@ export AR='mwldnlm'
export AR_FLAGS='-type library -o'
export AS='mwasmnlm'
export CC='mwccnlm -gccincludes'
export CFLAGS='-dialect c -proc 686 -relax_pointers'
export CFLAGS='-align 8 -proc 686 -relax_pointers -dialect c'
export CXX='mwccnlm -gccincludes'
export CXXFLAGS='-dialect c++ -proc 686 -bool on -wchar_t on -relax_pointers -D_WCHAR_T'
export CXXFLAGS='-align 8 -proc 686 -relax_pointers -dialect c++ -bool on -wchar_t on -D_WCHAR_T'
export LD='mwldnlm'
export LDFLAGS='-entry _LibCPrelude -exit _LibCPostlude -flags pseudopreemption'
export RANLIB=:
......
......@@ -147,10 +147,12 @@ then
fi
# make files writeable
echo "making files writable..."
cd $target_dir
chmod -R u+rw,g+rw .
# edit the mvenv file
echo "updating the mwenv environment file..."
mwenv="./netware/BUILD/mwenv"
mv -f $mwenv $mwenv.org
sed -e "s;WINE_BUILD_DIR;$wine_build_dir;g" \
......@@ -158,6 +160,17 @@ sed -e "s;WINE_BUILD_DIR;$wine_build_dir;g" \
-e "s;VERSION;$version;g" $mwenv.org > $mwenv
chmod +rwx $mwenv
#edit the def file versions
echo "updating *.def file versions..."
nlm_version=`echo "$version" | sed -e "s;\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*;\1, \2, \3;"`
for file in ./netware/*.def
do
mv -f $file $file.org
sed -e "s;VERSION.*;VERSION $nlm_version;g" $file.org > $file
rm $file.org
done
# build linux tools
echo "compiling linux tools..."
./netware/BUILD/compile-linux-tools
......
# Copyright (c) 2002 Novell, Inc. All Rights Reserved.
# Copyright (c) 2002 Novell, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -11,38 +11,37 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# 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
INCLUDES = -I$(srcdir)/../include -I../include -I..
bin_PROGRAMS = mysqld_safe mysql_install_db mysql_test_run libmysql
mysqld_safe_SOURCES= mysqld_safe.c my_manage.c
mysql_install_db_SOURCES= mysql_install_db.c my_manage.c
mysql_test_run_SOURCES= mysql_test_run.c my_manage.c
libmysql_SOURCES= libmysqlmain.c
libmysql_LDADD = ../libmysql/.libs/libmysqlclient.a
INCLUDES= -I$(srcdir)/../include -I../include -I..
bin_PROGRAMS= mysqld_safe mysql_install_db mysql_test_run libmysql
mysqld_safe_SOURCES= mysqld_safe.c my_manage.c
mysql_install_db_SOURCES= mysql_install_db.c my_manage.c
mysql_test_run_SOURCES= mysql_test_run.c my_manage.c
libmysql_SOURCES= libmysqlmain.c
libmysql_LDADD= ../libmysql/.libs/libmysqlclient.a
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 extra/comp_err.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
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 extra/comp_err.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
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;
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
%::SCCS/s.%
This diff is collapsed.
......@@ -26,17 +26,41 @@
******************************************************************************/
#include <stdlib.h>
#ifndef __WIN__
#include <unistd.h>
#endif
/******************************************************************************
macros
******************************************************************************/
#ifdef __WIN__
#define PATH_MAX _MAX_PATH
#define NAME_MAX _MAX_FNAME
#define kill(A,B) TerminateProcess((HANDLE)A,0)
#define NOT_NEED_PID 0
#define MASTER_PID 1
#define SLAVE_PID 2
#define mysqld_timeout 60000
intptr_t master_server;
intptr_t slave_server;
int pid_mode;
bool run_server;
char win_args[1024];
bool skip_first_param;
#endif
#define ARG_BUF 10
#define TRY_MAX 5
#ifdef __NETWARE__
#define strstr(A,B) strindex(A,B)
#endif
/******************************************************************************
structures
......@@ -53,6 +77,8 @@ typedef struct
} arg_list_t;
typedef int pid_t;
/******************************************************************************
global variables
......@@ -66,7 +92,7 @@ typedef struct
******************************************************************************/
void init_args(arg_list_t *);
void add_arg(arg_list_t *, char *, ...);
void add_arg(arg_list_t *, const char *, ...);
void free_args(arg_list_t *);
int sleep_until_file_exists(char *);
......@@ -80,8 +106,12 @@ pid_t get_server_pid(char *);
void kill_server(pid_t pid);
void del_tree(char *);
int removef(char *, ...);
int removef(const char *, ...);
void get_basedir(char *, char *);
char mysqladmin_file[PATH_MAX];
#endif /* _MY_MANAGE */
This diff is collapsed.
......@@ -85,8 +85,25 @@ do
fi
done
for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \
MySQLEULA.txt LICENSE.doc README.NW
# Non platform-specific doc files:
DOC_FILES=" \
COPYING COPYING.LIB README LICENSE.doc \
Docs/mysqlbug.txt \
";
# Platform-specific doc files:
if [ $BASE_SYSTEM = "netware" ] ; then
DOC_FILES="$DOC_FILES \
README.NW \
";
# For all other platforms:
else
DOC_FILES="$DOC_FILES \
Docs/INSTALL-BINARY MySQLEULA.txt \
";
fi
for i in $DOC_FILES
do
if [ -f $i ]
then
......@@ -94,7 +111,7 @@ do
fi
done
# Non platform-specific bin dir files:
# Non platform-specific bin files:
BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \
extra/resolveip$BS extra/my_print_defaults$BS \
extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \
......@@ -104,18 +121,18 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \
client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \
client/mysqldump$BS client/mysqlimport$BS \
client/mysqltest$BS client/mysqlcheck$BS \
client/mysqlbinlog$BS
client/mysqlbinlog$BS \
";
# Platform-specific bin dir files:
# Platform-specific bin files:
if [ $BASE_SYSTEM = "netware" ] ; then
BIN_FILES="$BIN_FILES \
netware/mysqld_safe$BS netware/mysql_install_db$BS \
netware/init_db.sql netware/test_db.sql netware/mysql_explain_log$BS \
netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql
netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql \
";
# For all other platforms:
else
# For all other platforms:
BIN_FILES="$BIN_FILES \
client/mysqlmanagerc \
client/mysqlmanager-pwgen tools/mysqlmanager \
......@@ -235,7 +252,9 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_
# Make safe_mysqld a symlink to mysqld_safe for backwards portability
# To be removed in MySQL 4.1
(cd $BASE/bin ; ln -s mysqld_safe safe_mysqld )
if [ $BASE_SYSTEM != "netware" ] ; then
(cd $BASE/bin ; ln -s mysqld_safe safe_mysqld )
fi
# Clean up if we did this from a bk tree
if [ -d $BASE/sql-bench/SCCS ] ; then
......@@ -294,29 +313,48 @@ which_1 ()
exit 1
}
#
# Create the result tar file
#
tar=`which_1 gnutar gtar`
if test "$?" = "1" -o "$tar" = ""
then
tar=tar
fi
echo "Using $tar to create archive"
cd $TMP
if [ $BASE_SYSTEM = "netware" ] ; then
#
# Create a zip file for NetWare users
#
if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi
zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME
echo "$NEW_NAME.zip created"
else
#
# Create the result tar file
#
tar=`which_1 gnutar gtar`
if test "$?" = "1" -o "$tar" = ""
then
tar=tar
fi
echo "Using $tar to create archive"
OPT=cvf
if [ x$SILENT = x1 ] ; then
OPT=cf
fi
$tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME
cd $SOURCE
echo "Compressing archive"
gzip -9 $NEW_NAME.tar
echo "$NEW_NAME.tar.gz created"
OPT=cvf
if [ x$SILENT = x1 ] ; then
OPT=cf
fi
$tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME
cd $SOURCE
echo "Compressing archive"
gzip -9 $NEW_NAME.tar
echo "Removing temporary directory"
rm -r -f $BASE
echo "$NEW_NAME.tar.gz created"
......@@ -39,6 +39,7 @@ c_hc=""
c_hr=""
c_hk=""
i_ht=""
c_p=""
# Check for old tables
if test ! -f $mdata/db.frm
......@@ -285,6 +286,22 @@ then
c_hr="$c_hr comment='keyword-topic relation';"
fi
if test ! -f $mdata/proc.frm
then
c_p="$c_p CREATE TABLE proc ("
c_p="$c_p name char(64) binary DEFAULT '' NOT NULL,"
c_p="$c_p type enum('function','procedure') NOT NULL,"
c_p="$c_p body blob DEFAULT '' NOT NULL,"
c_p="$c_p creator char(77) binary DEFAULT '' NOT NULL,"
c_p="$c_p modified timestamp,"
c_p="$c_p created timestamp,"
c_p="$c_p suid enum ('N', 'Y') DEFAULT 'Y' NOT NULL,"
c_p="$c_p comment char(64) binary DEFAULT '' NOT NULL,"
c_p="$c_p PRIMARY KEY (name,type)"
c_p="$c_p )"
c_p="$c_p comment='Stored Procedures';"
fi
cat << END_OF_DATA
use mysql;
$c_d
......@@ -306,5 +323,8 @@ $c_ht
$c_hc
$c_hr
$c_hk
$c_p
END_OF_DATA
......@@ -134,3 +134,20 @@ name varchar(64) not null,
primary key (help_keyword_id),
unique index (name)
) comment='help keywords';
#
# Create proc table if it doesn't exists
#
CREATE TABLE IF NOT EXISTS proc (
name char(64) binary DEFAULT '' NOT NULL,
type enum('function','procedure') NOT NULL,
body blob DEFAULT '' NOT NULL,
creator char(77) binary DEFAULT '' NOT NULL,
modified timestamp,
created timestamp,
suid enum ('N', 'Y') DEFAULT 'Y' NOT NULL,
comment char(64) binary DEFAULT '' NOT NULL,
PRIMARY KEY (name,type)
) comment='Stored Procedures';
......@@ -58,6 +58,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
log_event.h sql_repl.h slave.h \
stacktrace.h sql_sort.h sql_cache.h set_var.h \
spatial.h gstream.h client_settings.h
sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h
mysqld_SOURCES = sql_lex.cc sql_handler.cc \
item.cc item_sum.cc item_buff.cc item_func.cc \
item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \
......@@ -86,7 +87,9 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \
slave.cc sql_repl.cc sql_union.cc sql_derived.cc \
client.c sql_client.cc mini_client_errors.c pack.c\
stacktrace.c repl_failsafe.h repl_failsafe.cc sql_olap.cc\
gstream.cc spatial.cc sql_help.cc protocol_cursor.cc
gstream.cc spatial.cc sql_help.cc protocol_cursor.cc \
sp_head.cc sp_pcontext.cc sp_rcontext.cc sp.cc \
sp_cache.cc
gen_lex_hash_SOURCES = gen_lex_hash.cc
gen_lex_hash_LDADD = $(LDADD) $(CXXLDFLAGS)
......
......@@ -330,7 +330,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
byte *ref_pos,*next_pos,ref_buff[MAX_REFLENGTH];
my_off_t record;
TABLE *sort_form;
volatile bool *killed= &current_thd->killed;
volatile THD::killed_state *killed= &current_thd->killed;
handler *file;
DBUG_ENTER("find_all_keys");
DBUG_PRINT("info",("using: %s",(select?select->quick?"ranges":"where":"every row")));
......@@ -774,15 +774,15 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
BUFFPEK *buffpek,**refpek;
QUEUE queue;
qsort2_cmp cmp;
volatile bool *killed= &current_thd->killed;
bool not_killable;
volatile THD::killed_state *killed= &current_thd->killed;
THD::killed_state not_killable;
DBUG_ENTER("merge_buffers");
statistic_increment(filesort_merge_passes, &LOCK_status);
if (param->not_killable)
{
killed= &not_killable;
not_killable= 0;
not_killable=THD::NOT_KILLED;
}
error=0;
......@@ -1128,7 +1128,7 @@ get_addon_fields(THD *thd, Field **ptabfield, uint sortlength, uint *plength)
The fact is the filter 'field->query_id != thd->query_id'
doesn't work for alter table
*/
if (thd->lex.sql_command != SQLCOM_SELECT)
if (thd->lex->sql_command != SQLCOM_SELECT)
return 0;
for (pfield= ptabfield; (field= *pfield) ; pfield++)
{
......
......@@ -2113,7 +2113,7 @@ static void print_msg(THD *thd, const char *table_name, const char *op_name,
protocol->store(msg_type);
protocol->store(msgbuf);
if (protocol->write())
thd->killed=1;
thd->killed=THD::KILL_CONNECTION;
}
#endif
......
......@@ -2253,8 +2253,8 @@ ha_innobase::write_row(
skip_auto_inc_decr = FALSE;
if (error == DB_DUPLICATE_KEY
&& (user_thd->lex.sql_command == SQLCOM_REPLACE
|| user_thd->lex.sql_command
&& (user_thd->lex->sql_command == SQLCOM_REPLACE
|| user_thd->lex->sql_command
== SQLCOM_REPLACE_SELECT)) {
skip_auto_inc_decr= TRUE;
......
......@@ -89,9 +89,9 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
extern "C" {
volatile bool *killed_ptr(MI_CHECK *param)
int *killed_ptr(void *thd)
{
return &(((THD *)(param->thd))->killed);
return (int*)&((THD *)thd)->killed;
}
void mi_check_print_error(MI_CHECK *param, const char *fmt,...)
......@@ -391,7 +391,7 @@ int ha_myisam::analyze(THD *thd, HA_CHECK_OPT* check_opt)
int ha_myisam::restore(THD* thd, HA_CHECK_OPT *check_opt)
{
HA_CHECK_OPT tmp_check_opt;
char* backup_dir = thd->lex.backup_dir;
char* backup_dir = thd->lex->backup_dir;
char src_path[FN_REFLEN], dst_path[FN_REFLEN];
char* table_name = table->real_name;
int error;
......@@ -431,7 +431,7 @@ int ha_myisam::restore(THD* thd, HA_CHECK_OPT *check_opt)
int ha_myisam::backup(THD* thd, HA_CHECK_OPT *check_opt)
{
char* backup_dir = thd->lex.backup_dir;
char* backup_dir = thd->lex->backup_dir;
char src_path[FN_REFLEN], dst_path[FN_REFLEN];
char* table_name = table->real_name;
int error;
......
......@@ -70,6 +70,37 @@ const char *tx_isolation_names[] =
TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"",
tx_isolation_names};
enum db_type ha_resolve_by_name(char *name, uint namelen)
{
enum db_type result = DB_TYPE_UNKNOWN;
if (!my_strcasecmp(&my_charset_latin1, name, "HEAP") ||
!my_strcasecmp(&my_charset_latin1, name, "MEMORY")) {
result = DB_TYPE_HEAP;
} else
if (!my_strcasecmp(&my_charset_latin1, name, "MRG_MYISAM") ||
!my_strcasecmp(&my_charset_latin1, name, "MERGE")) {
result = DB_TYPE_MRG_MYISAM;
} else
if (!my_strcasecmp(&my_charset_latin1, name, "MYISAM")) {
result = DB_TYPE_MYISAM;
} else
if (!my_strcasecmp(&my_charset_latin1, name, "BDB") ||
!my_strcasecmp(&my_charset_latin1, name, "BERKELEYDB")) {
result = DB_TYPE_BERKELEY_DB;
} else
if (!my_strcasecmp(&my_charset_latin1, name, "INNODB") ||
!my_strcasecmp(&my_charset_latin1, name, "INNOBASE")) {
result = DB_TYPE_INNODB;
} else
if (!my_strcasecmp(&my_charset_latin1, name, "ISAM")) {
result = DB_TYPE_ISAM;
} else
if (!my_strcasecmp(&my_charset_latin1, name, "DEFAULT")) {
result = (enum db_type) current_thd->variables.table_type;
}
return result;
}
/* Use other database handler if databasehandler is not incompiled */
enum db_type ha_checktype(enum db_type database_type)
......@@ -77,18 +108,21 @@ enum db_type ha_checktype(enum db_type database_type)
switch (database_type) {
#ifdef HAVE_BERKELEY_DB
case DB_TYPE_BERKELEY_DB:
return(berkeley_skip ? DB_TYPE_MYISAM : database_type);
if (berkeley_skip) break;
return (database_type);
#endif
#ifdef HAVE_INNOBASE_DB
case DB_TYPE_INNODB:
return(innodb_skip ? DB_TYPE_MYISAM : database_type);
if (innodb_skip) break;
return (database_type);
#endif
#ifndef NO_HASH
case DB_TYPE_HASH:
#endif
#ifdef HAVE_ISAM
case DB_TYPE_ISAM:
return (isam_skip ? DB_TYPE_MYISAM : database_type);
if (isam_skip) break;
return (database_type);
case DB_TYPE_MRG_ISAM:
return (isam_skip ? DB_TYPE_MRG_MYISAM : database_type);
#else
......@@ -102,7 +136,12 @@ enum db_type ha_checktype(enum db_type database_type)
default:
break;
}
return(DB_TYPE_MYISAM); /* Use this as default */
/* Use this as default */
#if 0
return((enum db_type) current_thd->variables.table_type);
#else
return(DB_TYPE_MYISAM);
#endif
} /* ha_checktype */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment