mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Merge with 4.1 to get new thd->mem_root handling
BitKeeper/etc/ignore: auto-union client/mysqldump.c: Auto merged client/mysqltest.c: Auto merged innobase/include/row0mysql.h: Auto merged libmysql/libmysql.c: Auto merged mysql-test/r/ctype_ucs.result: Auto merged mysql-test/r/fulltext.result: Auto merged mysql-test/r/func_in.result: Auto merged mysql-test/r/ps.result: Auto merged mysql-test/r/ps_2myisam.result: Auto merged mysql-test/r/ps_3innodb.result: Auto merged mysql-test/r/ps_4heap.result: Auto merged mysql-test/r/ps_5merge.result: Auto merged mysql-test/r/ps_6bdb.result: Auto merged mysql-test/r/type_float.result: Auto merged mysql-test/r/user_var.result: Auto merged mysql-test/t/innodb.test: Auto merged mysql-test/t/user_var.test: Auto merged mysql-test/t/variables.test: Auto merged sql/ha_berkeley.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_innodb.h: Auto merged sql/ha_ndbcluster.h: Auto merged sql/item.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_sum.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/repl_failsafe.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_db.cc: Auto merged sql/sql_error.cc: Auto merged sql/sql_help.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_select.h: Auto merged sql/sql_yacc.yy: Auto merged
This commit is contained in:
commit
47a5ac0e30
125 changed files with 5745 additions and 14937 deletions
|
@ -519,6 +519,7 @@ mysql-max-4.0.2-alpha-pc-linux-gnu-i686.tar.gz
|
|||
mysql-test/gmon.out
|
||||
mysql-test/install_test_db
|
||||
mysql-test/mysql-test-run
|
||||
mysql-test/mysql_test_run_new
|
||||
mysql-test/ndb/ndbcluster
|
||||
mysql-test/r/*.reject
|
||||
mysql-test/r/index_merge_load.result
|
||||
|
|
35
Docs/Images/Makefile.am
Normal file
35
Docs/Images/Makefile.am
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this library; if not, write to the Free
|
||||
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
# MA 02111-1307, USA
|
||||
|
||||
## Process this file with automake to create Makefile.in
|
||||
|
||||
# This is a dummy file to satisfy the hierarchy of Makefiles.
|
||||
# When a release is built, the true Makefile will be copied
|
||||
# together with the "real" files in this directory.
|
||||
|
||||
EXTRA_DIST =
|
||||
|
||||
# Nothing to create in this dummy directory.
|
||||
all:
|
||||
:
|
||||
|
||||
# Nothing to cleanup in this dummy directory.
|
||||
clean:
|
||||
:
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
|
@ -208,7 +208,7 @@ INCLUDES="$INCLUDES $ZLIB_INCLUDES"
|
|||
LIBS="$LIBS $ZLIB_LIBS"
|
||||
AC_CACHE_VAL([mysql_cv_compress],
|
||||
[AC_TRY_LINK([#include <zlib.h>],
|
||||
[int link_test() { return compress(0, (unsigned long*) 0, "", 0); }],
|
||||
[return compress(0, (unsigned long*) 0, "", 0);],
|
||||
[mysql_cv_compress="yes"
|
||||
AC_MSG_RESULT([ok])],
|
||||
[mysql_cv_compress="no"])
|
||||
|
|
|
@ -108,7 +108,7 @@ static const char *command_names[]= {
|
|||
};
|
||||
|
||||
static TYPELIB command_typelib=
|
||||
{ array_elements(command_names)-1,"commands", command_names};
|
||||
{ array_elements(command_names)-1,"commands", command_names, NULL};
|
||||
|
||||
static struct my_option my_long_options[] =
|
||||
{
|
||||
|
|
|
@ -126,7 +126,7 @@ const char *compatible_mode_names[]=
|
|||
(1<<10) /* ANSI */\
|
||||
)
|
||||
TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1,
|
||||
"", compatible_mode_names};
|
||||
"", compatible_mode_names, NULL};
|
||||
|
||||
|
||||
static struct my_option my_long_options[] =
|
||||
|
@ -319,7 +319,7 @@ static struct my_option my_long_options[] =
|
|||
{"comments", 'i', "Write additional information.",
|
||||
(gptr*) &opt_comments, (gptr*) &opt_comments, 0, GET_BOOL, NO_ARG,
|
||||
1, 0, 0, 0, 0, 0},
|
||||
{"hex-blob", OPT_HEXBLOB, "Dump BLOBs in HEX. this mode does not work with extended-insert",
|
||||
{"hex-blob", OPT_HEXBLOB, "Dump BLOBs in HEX.",
|
||||
(gptr*) &opt_hex_blob, (gptr*) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
@ -1543,10 +1543,12 @@ static void dumpTable(uint numFields, char *table)
|
|||
/*
|
||||
63 is my_charset_bin. If charsetnr is not 63,
|
||||
we have not a BLOB but a TEXT column.
|
||||
we'll dump it in hex only BLOB columns.
|
||||
we'll dump in hex only BLOB columns.
|
||||
*/
|
||||
is_blob= (opt_hex_blob && field->charsetnr == 63 &&
|
||||
(field->type == FIELD_TYPE_BLOB ||
|
||||
(field->type == FIELD_TYPE_STRING ||
|
||||
field->type == FIELD_TYPE_VAR_STRING ||
|
||||
field->type == FIELD_TYPE_BLOB ||
|
||||
field->type == FIELD_TYPE_LONG_BLOB ||
|
||||
field->type == FIELD_TYPE_MEDIUM_BLOB ||
|
||||
field->type == FIELD_TYPE_TINY_BLOB)) ? 1 : 0;
|
||||
|
@ -1564,6 +1566,13 @@ static void dumpTable(uint numFields, char *table)
|
|||
{
|
||||
if (!IS_NUM_FIELD(field))
|
||||
{
|
||||
/*
|
||||
"length * 2 + 2" is OK for both HEX and non-HEX modes:
|
||||
- In HEX mode we need exactly 2 bytes per character
|
||||
plus 2 bytes for '0x' prefix.
|
||||
- In non-HEX mode we need up to 2 bytes per character,
|
||||
plus 2 bytes for leading and trailing '\'' characters.
|
||||
*/
|
||||
if (dynstr_realloc(&extended_row,length * 2+2))
|
||||
{
|
||||
fputs("Aborting dump (out of memory)",stderr);
|
||||
|
@ -1572,15 +1581,11 @@ static void dumpTable(uint numFields, char *table)
|
|||
}
|
||||
if (opt_hex_blob && is_blob)
|
||||
{
|
||||
ulong counter;
|
||||
unsigned char *ptr= row[i];
|
||||
dynstr_append(&extended_row, "0x");
|
||||
for (counter = 0; counter < lengths[i]; counter++)
|
||||
{
|
||||
char xx[3];
|
||||
sprintf(xx, "%02X", ptr[counter]);
|
||||
dynstr_append(&extended_row, xx);
|
||||
}
|
||||
extended_row.length+= mysql_hex_string(extended_row.str +
|
||||
extended_row.length,
|
||||
row[i], length);
|
||||
extended_row.str[extended_row.length]= '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -951,7 +951,6 @@ static void do_exec(struct st_query* q)
|
|||
while (fgets(buf, sizeof(buf), res_file))
|
||||
replace_dynstr_append_mem(ds, buf, strlen(buf));
|
||||
}
|
||||
|
||||
error= pclose(res_file);
|
||||
|
||||
if (error != 0)
|
||||
|
@ -4520,8 +4519,7 @@ static void get_replace_column(struct st_query *q)
|
|||
my_free(start, MYF(0));
|
||||
}
|
||||
|
||||
#ifdef __NETWARE__
|
||||
|
||||
#if defined(__NETWARE__) || defined(__WIN__)
|
||||
/*
|
||||
Substitute environment variables with text.
|
||||
|
||||
|
@ -4617,4 +4615,4 @@ FILE *my_popen(const char *cmd, const char *mode __attribute__((unused)))
|
|||
return res_file;
|
||||
}
|
||||
|
||||
#endif /* __NETWARE__ */
|
||||
#endif /* __NETWARE__ or __WIN__*/
|
||||
|
|
|
@ -175,6 +175,8 @@ typedef uint rf_SetTimer;
|
|||
#define sigset(A,B) signal((A),(B))
|
||||
#define finite(A) _finite(A)
|
||||
#define sleep(A) Sleep((A)*1000)
|
||||
#define popen(A) popen(A,B) _popen((A),(B))
|
||||
#define pclose(A) _pclose(A)
|
||||
|
||||
#ifndef __BORLANDC__
|
||||
#define access(A,B) _access(A,B)
|
||||
|
|
|
@ -463,6 +463,14 @@ lock_rec_hash(
|
|||
ulint space, /* in: space */
|
||||
ulint page_no);/* in: page number */
|
||||
/*************************************************************************
|
||||
Gets the table covered by an IX table lock. */
|
||||
|
||||
dict_table_t*
|
||||
lock_get_ix_table(
|
||||
/*==============*/
|
||||
/* out: the table covered by the lock */
|
||||
lock_t* lock); /* in: table lock */
|
||||
/*************************************************************************
|
||||
Checks that a transaction id is sensible, i.e., not in the future. */
|
||||
|
||||
ibool
|
||||
|
|
|
@ -175,8 +175,12 @@ int
|
|||
row_lock_table_for_mysql(
|
||||
/*=====================*/
|
||||
/* out: error code or DB_SUCCESS */
|
||||
row_prebuilt_t* prebuilt); /* in: prebuilt struct in the MySQL
|
||||
row_prebuilt_t* prebuilt, /* in: prebuilt struct in the MySQL
|
||||
table handle */
|
||||
dict_table_t* table); /* in: table to LOCK_IX, or NULL
|
||||
if prebuilt->table should be
|
||||
locked as LOCK_TABLE_EXP |
|
||||
prebuilt->select_lock_type */
|
||||
/*************************************************************************
|
||||
Does an insert for MySQL. */
|
||||
|
||||
|
|
|
@ -395,6 +395,19 @@ lock_rec_get_nth_bit(
|
|||
return(ut_bit_get_nth(b, bit_index));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the table covered by an IX table lock. */
|
||||
|
||||
dict_table_t*
|
||||
lock_get_ix_table(
|
||||
/*==============*/
|
||||
/* out: the table covered by the lock */
|
||||
lock_t* lock) /* in: table lock */
|
||||
{
|
||||
ut_a(lock->type_mode == (LOCK_TABLE | LOCK_IX));
|
||||
return(lock->un_member.tab_lock.table);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
#define lock_mutex_enter_kernel() mutex_enter(&kernel_mutex)
|
||||
|
|
|
@ -779,8 +779,12 @@ int
|
|||
row_lock_table_for_mysql(
|
||||
/*=====================*/
|
||||
/* out: error code or DB_SUCCESS */
|
||||
row_prebuilt_t* prebuilt) /* in: prebuilt struct in the MySQL
|
||||
row_prebuilt_t* prebuilt, /* in: prebuilt struct in the MySQL
|
||||
table handle */
|
||||
dict_table_t* table) /* in: table to LOCK_IX, or NULL
|
||||
if prebuilt->table should be
|
||||
locked as LOCK_TABLE_EXP |
|
||||
prebuilt->select_lock_type */
|
||||
{
|
||||
trx_t* trx = prebuilt->trx;
|
||||
que_thr_t* thr;
|
||||
|
@ -813,8 +817,12 @@ run_again:
|
|||
|
||||
trx_start_if_not_started(trx);
|
||||
|
||||
err = lock_table(LOCK_TABLE_EXP, prebuilt->table,
|
||||
prebuilt->select_lock_type, thr);
|
||||
if (table) {
|
||||
err = lock_table(0, table, LOCK_IX, thr);
|
||||
} else {
|
||||
err = lock_table(LOCK_TABLE_EXP, prebuilt->table,
|
||||
prebuilt->select_lock_type, thr);
|
||||
}
|
||||
|
||||
trx->error_state = err;
|
||||
|
||||
|
|
|
@ -1563,7 +1563,8 @@ void my_net_local_init(NET *net)
|
|||
trailing '. The caller must supply whichever of those is desired.
|
||||
*/
|
||||
|
||||
ulong mysql_hex_string(char *to, const char *from, ulong length)
|
||||
ulong STDCALL
|
||||
mysql_hex_string(char *to, const char *from, ulong length)
|
||||
{
|
||||
char *to0= to;
|
||||
const char *end;
|
||||
|
|
|
@ -47,6 +47,7 @@ EXPORTS
|
|||
mysql_errno
|
||||
mysql_error
|
||||
mysql_escape_string
|
||||
mysql_hex_string
|
||||
mysql_stmt_execute
|
||||
mysql_stmt_fetch
|
||||
mysql_stmt_fetch_column
|
||||
|
|
|
@ -36,6 +36,12 @@ test_SCRIPTS = mysql-test-run install_test_db
|
|||
test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem
|
||||
CLEANFILES = $(test_SCRIPTS) $(test_DATA)
|
||||
|
||||
INCLUDES = -I$(srcdir)/../include -I../include -I..
|
||||
bin_PROGRAMS = mysql_test_run_new
|
||||
noinst_HEADERS = my_manage.h
|
||||
mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c
|
||||
|
||||
|
||||
dist-hook:
|
||||
mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \
|
||||
$(distdir)/std_data
|
||||
|
|
26
mysql-test/init_db.sql
Normal file
26
mysql-test/init_db.sql
Normal file
|
@ -0,0 +1,26 @@
|
|||
CREATE DATABASE mysql;
|
||||
CREATE DATABASE test;
|
||||
|
||||
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';
|
||||
|
||||
INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');
|
||||
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');
|
||||
|
||||
CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) 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)) comment='Host privileges; Merged with database privileges';
|
||||
|
||||
CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(45) 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, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_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, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_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, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges';
|
||||
|
||||
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
|
||||
INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
|
||||
|
||||
INSERT INTO user (host,user) values ('localhost','');
|
||||
INSERT INTO user (host,user) values ('','');
|
||||
|
||||
CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions';
|
||||
|
||||
CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(60) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges';
|
||||
|
||||
CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges';
|
||||
|
851
mysql-test/my_manage.c
Normal file
851
mysql-test/my_manage.c
Normal file
|
@ -0,0 +1,851 @@
|
|||
/*
|
||||
Copyright (c) 2003 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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#ifndef __WIN__
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#ifdef __NETWARE__
|
||||
#include <screen.h>
|
||||
#include <proc.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#ifndef __WIN__
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <fnmatch.h>
|
||||
#else
|
||||
#include <direct.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "my_manage.h"
|
||||
|
||||
#ifndef __NETWARE__
|
||||
#define ASSERT assert
|
||||
extern char **environ;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
macros
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
global variables
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
functions
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
init_args()
|
||||
|
||||
Init an argument list.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
void init_args(arg_list_t *al)
|
||||
{
|
||||
ASSERT(al != NULL);
|
||||
|
||||
al->argc= 0;
|
||||
al->size= ARG_BUF;
|
||||
al->argv= malloc(al->size * sizeof(char *));
|
||||
ASSERT(al->argv != NULL);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
add_arg()
|
||||
|
||||
Add an argument to a list.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
void add_arg(arg_list_t *al, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char temp[PATH_MAX];
|
||||
|
||||
ASSERT(al != NULL);
|
||||
|
||||
/* increase size */
|
||||
if (al->argc >= (int)al->size)
|
||||
{
|
||||
al->size+= ARG_BUF;
|
||||
al->argv= realloc(al->argv, al->size * sizeof(char *));
|
||||
ASSERT(al->argv != NULL);
|
||||
}
|
||||
|
||||
if (format)
|
||||
{
|
||||
va_start(ap, format);
|
||||
vsprintf(temp, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
al->argv[al->argc]= malloc(strlen(temp)+1);
|
||||
ASSERT(al->argv[al->argc] != NULL);
|
||||
strcpy(al->argv[al->argc], temp);
|
||||
|
||||
++(al->argc);
|
||||
}
|
||||
else
|
||||
{
|
||||
al->argv[al->argc]= NULL;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
free_args()
|
||||
|
||||
Free an argument list.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
void free_args(arg_list_t *al)
|
||||
{
|
||||
int i;
|
||||
|
||||
ASSERT(al != NULL);
|
||||
|
||||
for (i= 0; i < al->argc; i++)
|
||||
{
|
||||
ASSERT(al->argv[i] != NULL);
|
||||
free(al->argv[i]);
|
||||
al->argv[i]= NULL;
|
||||
}
|
||||
|
||||
free(al->argv);
|
||||
al->argc= 0;
|
||||
al->argv= NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
sleep_until_file_deleted()
|
||||
|
||||
Sleep until the given file is no longer found.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __WIN__
|
||||
int sleep_until_file_deleted(char *pid_file)
|
||||
#else
|
||||
int sleep_until_file_deleted(HANDLE pid_file)
|
||||
#endif
|
||||
{
|
||||
int err= 0; /* Initiate to supress warning */
|
||||
#ifndef __WIN__
|
||||
struct stat buf;
|
||||
int i;
|
||||
|
||||
for (i= 0; (i < TRY_MAX) && (err= !stat(pid_file, &buf)); i++) sleep(1);
|
||||
|
||||
if (err != 0) err= errno;
|
||||
#else
|
||||
err= (WaitForSingleObject(pid_file, TRY_MAX*1000) == WAIT_TIMEOUT);
|
||||
#endif
|
||||
return err;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
sleep_until_file_exists()
|
||||
|
||||
Sleep until the given file exists.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __WIN__
|
||||
int sleep_until_file_exists(char *pid_file)
|
||||
#else
|
||||
int sleep_until_file_exists(HANDLE pid_file)
|
||||
#endif
|
||||
{
|
||||
int err= 0; /* Initiate to supress warning */
|
||||
#ifndef __WIN__
|
||||
struct stat buf;
|
||||
int i;
|
||||
|
||||
for (i= 0; (i < TRY_MAX) && (err= stat(pid_file, &buf)); i++) sleep(1);
|
||||
|
||||
if (err != 0) err= errno;
|
||||
#else
|
||||
err= (WaitForSingleObject(pid_file, TRY_MAX*1000) == WAIT_TIMEOUT);
|
||||
#endif
|
||||
return err;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
wait_for_server_start()
|
||||
|
||||
Wait for the server on the given port to start.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
int wait_for_server_start(char *bin_dir __attribute__((unused)),
|
||||
char *mysqladmin_file,
|
||||
char *user, char *password, int port,char *tmp_dir)
|
||||
{
|
||||
arg_list_t al;
|
||||
int err= 0, i;
|
||||
char trash[PATH_MAX];
|
||||
|
||||
/* mysqladmin file */
|
||||
snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir);
|
||||
|
||||
/* args */
|
||||
init_args(&al);
|
||||
add_arg(&al, "%s", mysqladmin_file);
|
||||
add_arg(&al, "--no-defaults");
|
||||
add_arg(&al, "--port=%u", port);
|
||||
add_arg(&al, "--user=%s", user);
|
||||
add_arg(&al, "--password=%s", password);
|
||||
add_arg(&al, "--silent");
|
||||
|
||||
/* #ifdef NOT_USED */
|
||||
#ifndef __NETWARE__
|
||||
add_arg(&al, "-O");
|
||||
add_arg(&al, "connect_timeout=10");
|
||||
add_arg(&al, "-w");
|
||||
#endif
|
||||
|
||||
add_arg(&al, "--host=localhost");
|
||||
#ifndef __NETWARE__
|
||||
add_arg(&al, "--protocol=tcp");
|
||||
#endif
|
||||
add_arg(&al, "ping");
|
||||
|
||||
/*
|
||||
NetWare does not support the connect timeout in the TCP/IP stack
|
||||
-- we will try the ping multiple times
|
||||
*/
|
||||
#ifndef __WIN__
|
||||
for (i= 0; (i < TRY_MAX)
|
||||
&& (err= spawn(mysqladmin_file, &al, TRUE, NULL,
|
||||
trash, NULL, NULL)); i++) sleep(1);
|
||||
#else
|
||||
err= spawn(mysqladmin_file, &al, TRUE, NULL,trash, NULL, NULL);
|
||||
#endif
|
||||
|
||||
/* free args */
|
||||
free_args(&al);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
spawn()
|
||||
|
||||
Spawn the given path with the given arguments.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef __NETWARE__
|
||||
int spawn(char *path, arg_list_t *al, int join, char *input,
|
||||
char *output, char *error, char *pid_file)
|
||||
{
|
||||
pid_t pid;
|
||||
int result= 0;
|
||||
wiring_t wiring= { FD_UNUSED, FD_UNUSED, FD_UNUSED };
|
||||
unsigned long flags= PROC_CURRENT_SPACE | PROC_INHERIT_CWD;
|
||||
|
||||
/* open wiring */
|
||||
if (input)
|
||||
wiring.infd= open(input, O_RDONLY);
|
||||
|
||||
if (output)
|
||||
wiring.outfd= open(output, O_WRONLY | O_CREAT | O_TRUNC);
|
||||
|
||||
if (error)
|
||||
wiring.errfd= open(error, O_WRONLY | O_CREAT | O_TRUNC);
|
||||
|
||||
/* procve requires a NULL */
|
||||
add_arg(al, NULL);
|
||||
|
||||
/* go */
|
||||
pid= procve(path, flags, NULL, &wiring, NULL, NULL, 0,
|
||||
NULL, (const char **)al->argv);
|
||||
|
||||
/* close wiring */
|
||||
if (wiring.infd != -1)
|
||||
close(wiring.infd);
|
||||
|
||||
if (wiring.outfd != -1)
|
||||
close(wiring.outfd);
|
||||
|
||||
if (wiring.errfd != -1)
|
||||
close(wiring.errfd);
|
||||
|
||||
return result;
|
||||
}
|
||||
#elif __WIN__
|
||||
|
||||
int spawn(char *path, arg_list_t *al, int join, char *input,
|
||||
char *output, char *error, HANDLE *pid)
|
||||
{
|
||||
intptr_t result;
|
||||
int i;
|
||||
STARTUPINFO startup_info;
|
||||
PROCESS_INFORMATION process_information;
|
||||
DWORD exit_code;
|
||||
char win_args[1024]= "";
|
||||
char command_line[1024]= "";
|
||||
|
||||
/* Skip the first parameter */
|
||||
for (i= 1; i < al->argc; i++)
|
||||
{
|
||||
ASSERT(al->argv[i] != NULL);
|
||||
strcat(win_args,al->argv[i]);
|
||||
strcat(win_args," ");
|
||||
}
|
||||
|
||||
memset(&startup_info,0,sizeof(STARTUPINFO));
|
||||
startup_info.cb= sizeof(STARTUPINFO);
|
||||
|
||||
if (input)
|
||||
freopen(input, "rb", stdin);
|
||||
|
||||
if (output)
|
||||
freopen(output, "wb", stdout);
|
||||
|
||||
if (error)
|
||||
freopen(error, "wb", stderr);
|
||||
|
||||
result= CreateProcess(
|
||||
path,
|
||||
(LPSTR)&win_args,
|
||||
NULL,
|
||||
NULL,
|
||||
TRUE,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
&startup_info,
|
||||
&process_information
|
||||
);
|
||||
|
||||
if (result && process_information.hProcess)
|
||||
{
|
||||
if (join)
|
||||
{
|
||||
if (WaitForSingleObject(process_information.hProcess, mysqld_timeout)
|
||||
== WAIT_TIMEOUT)
|
||||
{
|
||||
exit_code= -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
GetExitCodeProcess(process_information.hProcess, &exit_code);
|
||||
}
|
||||
CloseHandle(process_information.hProcess);
|
||||
}
|
||||
else
|
||||
{
|
||||
exit_code= 0;
|
||||
}
|
||||
if (pid != NULL)
|
||||
*pid= process_information.hProcess;
|
||||
}
|
||||
else
|
||||
{
|
||||
exit_code= -1;
|
||||
}
|
||||
if (input)
|
||||
freopen("CONIN$","rb",stdin);
|
||||
if (output)
|
||||
freopen("CONOUT$","wb",stdout);
|
||||
if (error)
|
||||
freopen("CONOUT$","wb",stderr);
|
||||
|
||||
return exit_code;
|
||||
}
|
||||
#else
|
||||
int spawn(char *path, arg_list_t *al, int join, char *input,
|
||||
char *output, char *error, char *pid_file __attribute__((unused)))
|
||||
{
|
||||
pid_t pid;
|
||||
int res_exec= 0;
|
||||
int result= 0;
|
||||
|
||||
pid= fork();
|
||||
|
||||
if (pid == -1)
|
||||
{
|
||||
fprintf(stderr, "fork was't created\n");
|
||||
/* We can't create the fork...exit with error */
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (pid > 0)
|
||||
{
|
||||
/* The parent process is waiting for child process if join is not zero */
|
||||
if (join)
|
||||
{
|
||||
waitpid(pid, &result, 0);
|
||||
if (WIFEXITED(result) != 0)
|
||||
{
|
||||
result= WEXITSTATUS(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
result= EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
/* Child process */
|
||||
add_arg(al, NULL);
|
||||
|
||||
/* Reassign streams */
|
||||
if (input)
|
||||
freopen(input, "r", stdin);
|
||||
|
||||
if (output)
|
||||
freopen(output, "w", stdout);
|
||||
|
||||
if (error)
|
||||
freopen(error, "w", stderr);
|
||||
|
||||
/* Spawn the process */
|
||||
if ((res_exec= execve(path, al->argv, environ)) < 0)
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
/* Restore streams */
|
||||
if (input)
|
||||
freopen("/dev/tty", "r", stdin);
|
||||
|
||||
if (output)
|
||||
freopen("/dev/tty", "w", stdout);
|
||||
|
||||
if (error)
|
||||
freopen("/dev/tty", "w", stderr);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
/******************************************************************************
|
||||
|
||||
stop_server()
|
||||
|
||||
Stop the server with the given port and pid file.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
int stop_server(char *bin_dir __attribute__((unused)), char *mysqladmin_file,
|
||||
char *user, char *password, int port,
|
||||
#ifndef __WIN__
|
||||
char *pid_file,
|
||||
#else
|
||||
HANDLE pid_file,
|
||||
#endif
|
||||
char *tmp_dir)
|
||||
{
|
||||
arg_list_t al;
|
||||
int err= 0;
|
||||
char trash[PATH_MAX];
|
||||
|
||||
snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir);
|
||||
|
||||
/* args */
|
||||
init_args(&al);
|
||||
add_arg(&al, "%s", mysqladmin_file);
|
||||
add_arg(&al, "--no-defaults");
|
||||
add_arg(&al, "--port=%u", port);
|
||||
add_arg(&al, "--user=%s", user);
|
||||
add_arg(&al, "--password=%s", password);
|
||||
add_arg(&al, "-O");
|
||||
add_arg(&al, "shutdown_timeout=20");
|
||||
#ifndef __NETWARE__
|
||||
add_arg(&al, "--protocol=tcp");
|
||||
#endif
|
||||
add_arg(&al, "shutdown");
|
||||
|
||||
/* spawn */
|
||||
if ((err= spawn(mysqladmin_file, &al, TRUE, NULL,
|
||||
trash, NULL, NULL)) == 0)
|
||||
{
|
||||
sleep_until_file_deleted(pid_file);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef __WIN__
|
||||
pid_t pid= get_server_pid(pid_file);
|
||||
|
||||
/* shutdown failed - kill server */
|
||||
kill_server(pid);
|
||||
|
||||
sleep(TRY_MAX);
|
||||
|
||||
/* remove pid file if possible */
|
||||
err= remove(pid_file);
|
||||
#else
|
||||
TerminateProcess(pid_file,err);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* free args */
|
||||
free_args(&al);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
get_server_pid()
|
||||
|
||||
Get the VM id with the given pid file.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __WIN__
|
||||
pid_t get_server_pid(char *pid_file)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
int fd, err;
|
||||
char *p;
|
||||
pid_t id= 0;
|
||||
|
||||
/* discover id */
|
||||
fd= open(pid_file, O_RDONLY);
|
||||
|
||||
err= read(fd, buf, PATH_MAX);
|
||||
|
||||
close(fd);
|
||||
|
||||
if (err > 0)
|
||||
{
|
||||
/* terminate string */
|
||||
if ((p= strchr(buf, '\n')) != NULL)
|
||||
{
|
||||
*p= '\0';
|
||||
|
||||
/* check for a '\r' */
|
||||
if ((p= strchr(buf, '\r')) != NULL)
|
||||
{
|
||||
*p= '\0';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buf[err]= '\0';
|
||||
}
|
||||
|
||||
id= strtol(buf, NULL, 0);
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
kill_server()
|
||||
|
||||
Force a kill of the server with the given pid.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
void kill_server(pid_t pid)
|
||||
{
|
||||
if (pid > 0)
|
||||
{
|
||||
#if !defined(__NETWARE__)
|
||||
/* Send SIGTERM to pid */
|
||||
kill(pid, SIGTERM);
|
||||
#else /* __NETWARE__ */
|
||||
/* destroy vm */
|
||||
NXVmDestroy(pid);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/******************************************************************************
|
||||
|
||||
del_tree()
|
||||
|
||||
Delete the directory and subdirectories.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
void del_tree(char *dir)
|
||||
{
|
||||
#ifndef __WIN__
|
||||
DIR *parent= opendir(dir);
|
||||
struct dirent *entry;
|
||||
char temp[PATH_MAX];
|
||||
|
||||
if (parent == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
while ((entry= readdir(parent)) != NULL)
|
||||
{
|
||||
/* create long name */
|
||||
snprintf(temp, PATH_MAX, "%s/%s", dir, entry->d_name);
|
||||
|
||||
if (entry->d_name[0] == '.')
|
||||
{
|
||||
/* Skip */
|
||||
}
|
||||
else
|
||||
if (S_ISDIR(entry->d_type))
|
||||
{
|
||||
/* delete subdirectory */
|
||||
del_tree(temp);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* remove file */
|
||||
remove(temp);
|
||||
}
|
||||
}
|
||||
/* remove directory */
|
||||
rmdir(dir);
|
||||
#else
|
||||
struct _finddata_t parent;
|
||||
intptr_t handle;
|
||||
char temp[PATH_MAX];
|
||||
char mask[PATH_MAX];
|
||||
|
||||
snprintf(mask,MAX_PATH,"%s/*.*",dir);
|
||||
|
||||
if ((handle=_findfirst(mask,&parent)) == -1L)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
/* create long name */
|
||||
snprintf(temp, PATH_MAX, "%s/%s", dir, parent.name);
|
||||
if (parent.name[0] == '.')
|
||||
{
|
||||
/* Skip */
|
||||
}
|
||||
else
|
||||
if (parent.attrib & _A_SUBDIR)
|
||||
{
|
||||
/* delete subdirectory */
|
||||
del_tree(temp);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* remove file */
|
||||
remove(temp);
|
||||
}
|
||||
} while (_findnext(handle,&parent) == 0);
|
||||
|
||||
_findclose(handle);
|
||||
|
||||
/* remove directory */
|
||||
_rmdir(dir);
|
||||
#endif
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
removef()
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
int removef(const char *format, ...)
|
||||
{
|
||||
#ifdef __NETWARE__
|
||||
va_list ap;
|
||||
char path[PATH_MAX];
|
||||
|
||||
va_start(ap, format);
|
||||
|
||||
vsnprintf(path, PATH_MAX, format, ap);
|
||||
|
||||
va_end(ap);
|
||||
return remove(path);
|
||||
|
||||
#eldef __WIN__
|
||||
{
|
||||
va_list ap;
|
||||
char path[PATH_MAX];
|
||||
struct _finddata_t parent;
|
||||
intptr_t handle;
|
||||
char temp[PATH_MAX];
|
||||
char *p;
|
||||
|
||||
va_start(ap, format);
|
||||
|
||||
vsnprintf(path, PATH_MAX, format, ap);
|
||||
|
||||
va_end(ap);
|
||||
|
||||
p= path + strlen(path);
|
||||
while (*p != '\\' && *p != '/' && p > path) p--;
|
||||
|
||||
if ((handle=_findfirst(path,&parent)) == -1L)
|
||||
{
|
||||
/* if there is not files....it's ok */
|
||||
return 0;
|
||||
}
|
||||
|
||||
*p= '\0';
|
||||
|
||||
do
|
||||
{
|
||||
if (! (parent.attrib & _A_SUBDIR))
|
||||
{
|
||||
snprintf(temp, PATH_MAX, "%s/%s", path, parent.name);
|
||||
remove(temp);
|
||||
}
|
||||
}while (_findnext(handle,&parent) == 0);
|
||||
|
||||
_findclose(handle);
|
||||
}
|
||||
#else
|
||||
DIR *parent;
|
||||
struct dirent *entry;
|
||||
char temp[PATH_MAX];
|
||||
va_list ap;
|
||||
char path[PATH_MAX];
|
||||
char *p;
|
||||
/* Get path with mask */
|
||||
va_start(ap, format);
|
||||
|
||||
vsnprintf(path, PATH_MAX, format, ap);
|
||||
|
||||
va_end(ap);
|
||||
|
||||
p= path + strlen(path);
|
||||
while (*p != '\\' && *p != '/' && p > path) p--;
|
||||
*p= '\0';
|
||||
p++;
|
||||
|
||||
parent= opendir(path);
|
||||
|
||||
if (parent == NULL)
|
||||
{
|
||||
return 1; /* Error, directory missing */
|
||||
}
|
||||
|
||||
while ((entry= readdir(parent)) != NULL)
|
||||
{
|
||||
/* entry is not directory and entry matches with mask */
|
||||
if (!S_ISDIR(entry->d_type) && !fnmatch(p, entry->d_name,0))
|
||||
{
|
||||
/* create long name */
|
||||
snprintf(temp, PATH_MAX, "%s/%s", path, entry->d_name);
|
||||
/* Delete only files */
|
||||
remove(temp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
get_basedir()
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
void get_basedir(char *argv0, char *basedir)
|
||||
{
|
||||
char temp[PATH_MAX];
|
||||
char *p;
|
||||
int position;
|
||||
|
||||
ASSERT(argv0 != NULL);
|
||||
ASSERT(basedir != NULL);
|
||||
|
||||
strcpy(temp, strlwr(argv0));
|
||||
while ((p= strchr(temp, '\\')) != NULL) *p= '/';
|
||||
|
||||
if ((position= strinstr(temp, "/bin/")) != 0)
|
||||
{
|
||||
p= temp + position;
|
||||
*p= '\0';
|
||||
strcpy(basedir, temp);
|
||||
}
|
||||
}
|
||||
|
||||
uint strinstr(reg1 const char *str,reg4 const char *search)
|
||||
{
|
||||
reg2 my_string i,j;
|
||||
my_string start= (my_string) str;
|
||||
|
||||
skipp:
|
||||
while (*str != '\0')
|
||||
{
|
||||
if (*str++ == *search)
|
||||
{
|
||||
i=(my_string) str;
|
||||
j= (my_string) search+1;
|
||||
while (*j)
|
||||
if (*i++ != *j++) goto skipp;
|
||||
return ((uint) (str - start));
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
remove_empty_file()
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
void remove_empty_file(const char *file_name)
|
||||
{
|
||||
struct stat file;
|
||||
|
||||
if (!stat(file_name,&file))
|
||||
{
|
||||
if (!file.st_size)
|
||||
remove(file_name);
|
||||
}
|
||||
}
|
135
mysql-test/my_manage.h
Normal file
135
mysql-test/my_manage.h
Normal file
|
@ -0,0 +1,135 @@
|
|||
/*
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _MY_MANAGE
|
||||
#define _MY_MANAGE
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
includes
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifndef __WIN__
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifndef __NETWARE__
|
||||
#include <string.h>
|
||||
#include <my_global.h>
|
||||
#include <m_string.h>
|
||||
|
||||
#ifndef __WIN__
|
||||
#define strnicmp strncasecmp
|
||||
#define strlwr(STRARG) (STRARG)
|
||||
#else
|
||||
int my_vsnprintf_(char *to, size_t n, const char* value, ...);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
macros
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#define ARG_BUF 10
|
||||
#define TRY_MAX 5
|
||||
|
||||
#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
|
||||
|
||||
int pid_mode;
|
||||
bool run_server;
|
||||
bool skip_first_param;
|
||||
|
||||
#define snprintf _snprintf
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
structures
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
int argc;
|
||||
char **argv;
|
||||
|
||||
size_t size;
|
||||
|
||||
} arg_list_t;
|
||||
|
||||
#ifdef __WIN__
|
||||
typedef int pid_t;
|
||||
#endif
|
||||
/******************************************************************************
|
||||
|
||||
global variables
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
prototypes
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
void init_args(arg_list_t *);
|
||||
void add_arg(arg_list_t *, const char *, ...);
|
||||
void free_args(arg_list_t *);
|
||||
|
||||
#ifndef __WIN__
|
||||
int sleep_until_file_exists(char *);
|
||||
int sleep_until_file_deleted(char *);
|
||||
#else
|
||||
int sleep_until_file_exists(HANDLE);
|
||||
int sleep_until_file_deleted(HANDLE);
|
||||
#endif
|
||||
int wait_for_server_start(char *, char *, char *, char *, int,char *);
|
||||
|
||||
#ifndef __WIN__
|
||||
int spawn(char *, arg_list_t *, int, char *, char *, char *, char *);
|
||||
#else
|
||||
int spawn(char *, arg_list_t *, int , char *, char *, char *, HANDLE *);
|
||||
#endif
|
||||
|
||||
#ifndef __WIN__
|
||||
int stop_server(char *, char *, char *, char *, int, char *,char *);
|
||||
pid_t get_server_pid(char *);
|
||||
void kill_server(pid_t pid);
|
||||
#else
|
||||
int stop_server(char *, char *, char *, char *, int, HANDLE,char *);
|
||||
#endif
|
||||
void del_tree(char *);
|
||||
int removef(const char *, ...);
|
||||
|
||||
void get_basedir(char *, char *);
|
||||
void remove_empty_file(const char *file_name);
|
||||
|
||||
#endif /* _MY_MANAGE */
|
1728
mysql-test/mysql_test_run.c
Normal file
1728
mysql-test/mysql_test_run.c
Normal file
File diff suppressed because it is too large
Load diff
1771
mysql-test/mysql_test_run_new.c
Normal file
1771
mysql-test/mysql_test_run_new.c
Normal file
File diff suppressed because it is too large
Load diff
|
@ -102,12 +102,43 @@ if [ ! -x "$exec_mgmtsrvr" ]; then
|
|||
echo "$exec_mgmtsrvr missing"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -x "$exec_waiter" ]; then
|
||||
echo "$exec_waiter missing"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec_mgmtclient="$exec_mgmtclient --no-defaults"
|
||||
exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults"
|
||||
exec_ndb="$exec_ndb --no-defaults"
|
||||
exec_waiter="$exec_waiter --no-defaults"
|
||||
|
||||
ndb_host="localhost"
|
||||
ndb_mgmd_port=$port_base
|
||||
NDB_CONNECTSTRING="host=$ndb_host:$ndb_mgmd_port"
|
||||
export NDB_CONNECTSTRING
|
||||
|
||||
sleep_until_file_created () {
|
||||
file=$1
|
||||
loop=$2
|
||||
org_time=$2
|
||||
message=$3
|
||||
while (test $loop -gt 0)
|
||||
do
|
||||
if [ -r $file ]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
sleep 1
|
||||
loop=`expr $loop - 1`
|
||||
done
|
||||
if [ $message ]
|
||||
then
|
||||
echo $message
|
||||
fi
|
||||
echo "ERROR: $file was not created in $org_time seconds; Aborting"
|
||||
return 1;
|
||||
}
|
||||
|
||||
start_default_ndbcluster() {
|
||||
|
||||
# do some checks
|
||||
|
@ -127,8 +158,8 @@ port_transporter=`expr $ndb_mgmd_port + 2`
|
|||
# Start management server as deamon
|
||||
|
||||
# Edit file system path and ports in config file
|
||||
|
||||
if [ $initial_ndb ] ; then
|
||||
rm -f $fs_ndb/ndb_*
|
||||
sed \
|
||||
-e s,"CHOOSE_MaxNoOfOrderedIndexes","$ndb_no_ord",g \
|
||||
-e s,"CHOOSE_MaxNoOfConcurrentOperations","$ndb_con_op",g \
|
||||
|
@ -150,21 +181,32 @@ if ( cd "$fs_ndb" ; $exec_mgmtsrvr -f config.ini ) ; then :; else
|
|||
echo "Unable to start $exec_mgmtsrvr from `pwd`"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if sleep_until_file_created $fs_ndb/ndb_3.pid 30
|
||||
then :; else
|
||||
exit 1
|
||||
fi
|
||||
cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile"
|
||||
|
||||
# Start database node
|
||||
|
||||
echo "Starting ndbd"
|
||||
( cd "$fs_ndb" ; $exec_ndb $flags_ndb & )
|
||||
|
||||
if sleep_until_file_created $fs_ndb/ndb_1.pid 30
|
||||
then :; else
|
||||
stop_default_ndbcluster
|
||||
exit 1
|
||||
fi
|
||||
cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile"
|
||||
|
||||
# Start database node
|
||||
|
||||
echo "Starting ndbd"
|
||||
( cd "$fs_ndb" ; $exec_ndb $flags_ndb & )
|
||||
|
||||
if sleep_until_file_created $fs_ndb/ndb_2.pid 30
|
||||
then :; else
|
||||
stop_default_ndbcluster
|
||||
exit 1
|
||||
fi
|
||||
cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile"
|
||||
|
||||
# test if Ndb Cluster starts properly
|
||||
|
@ -172,6 +214,7 @@ cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile"
|
|||
echo "Waiting for started..."
|
||||
if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK"; then :; else
|
||||
echo "Ndbcluster startup failed"
|
||||
stop_default_ndbcluster
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -198,10 +241,12 @@ if [ -f "$fs_ndb/$pidfile" ] ; then
|
|||
attempt=0
|
||||
while [ $attempt -lt 10 ] ; do
|
||||
new_kill_pid=""
|
||||
kill_pids2=""
|
||||
for p in $kill_pids ; do
|
||||
kill -0 $p 2> /dev/null
|
||||
if [ $? -eq 0 ] ; then
|
||||
new_kill_pid="$p $new_kill_pid"
|
||||
kill_pids2="-$p $kill_pids2"
|
||||
fi
|
||||
done
|
||||
kill_pids=$new_kill_pid
|
||||
|
@ -211,9 +256,14 @@ if [ -f "$fs_ndb/$pidfile" ] ; then
|
|||
sleep 1
|
||||
attempt=`expr $attempt + 1`
|
||||
done
|
||||
if [ "$kill_pids" != "" ] ; then
|
||||
echo "Failed to shutdown ndbcluster, executing kill "$kill_pids
|
||||
kill $kill_pids
|
||||
if [ "$kill_pids2" != "" ] ; then
|
||||
echo "Failed to shutdown ndbcluster, executing kill "$kill_pids2
|
||||
kill -9 -- $kill_pids2 2> /dev/null
|
||||
/bin/kill -9 -- $kill_pids2 2> /dev/null
|
||||
/usr/bin/kill -9 -- $kill_pids2 2> /dev/null
|
||||
kill -9 $kill_pids2 2> /dev/null
|
||||
/bin/kill -9 $kill_pids2 2> /dev/null
|
||||
/usr/bin/kill -9 $kill_pids2 2> /dev/null
|
||||
fi
|
||||
rm "$fs_ndb/$pidfile"
|
||||
fi
|
||||
|
|
|
@ -480,3 +480,10 @@ a 0061
|
|||
b 0062
|
||||
c 0063
|
||||
drop table t1;
|
||||
set @ivar= 1234;
|
||||
set @str1 = 'select ?';
|
||||
set @str2 = convert(@str1 using ucs2);
|
||||
prepare stmt1 from @str2;
|
||||
execute stmt1 using @ivar;
|
||||
?
|
||||
1234
|
||||
|
|
|
@ -355,9 +355,9 @@ t collation(t)
|
|||
aus Osnabrück utf8_general_ci
|
||||
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
|
||||
t collation(t)
|
||||
SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAINST ('Osnabruck');
|
||||
t collation(t) MATCH t AGAINST ('Osnabruck')
|
||||
aus Osnabrück utf8_general_ci 1.591139793396
|
||||
SELECT t, collation(t),FORMAT(MATCH t AGAINST ('Osnabruck'),6) FROM t1 WHERE MATCH t AGAINST ('Osnabruck');
|
||||
t collation(t) FORMAT(MATCH t AGAINST ('Osnabruck'),6)
|
||||
aus Osnabrück utf8_general_ci 1.591140
|
||||
alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 't' at row 3
|
||||
|
|
|
@ -6,53 +6,53 @@ FULLTEXT(message)
|
|||
) comment = 'original testcase by sroussey@network54.com';
|
||||
INSERT INTO t1 (message) VALUES ("Testing"),("table"),("testbug"),
|
||||
("steve"),("is"),("cool"),("steve is cool");
|
||||
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve');
|
||||
a MATCH (message) AGAINST ('steve')
|
||||
4 0.90587323904037
|
||||
7 0.89568990468979
|
||||
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve');
|
||||
a FORMAT(MATCH (message) AGAINST ('steve'),6)
|
||||
4 0.905873
|
||||
7 0.895690
|
||||
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve');
|
||||
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
|
||||
4 1
|
||||
7 1
|
||||
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
|
||||
a MATCH (message) AGAINST ('steve')
|
||||
4 0.90587323904037
|
||||
7 0.89568990468979
|
||||
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
|
||||
a FORMAT(MATCH (message) AGAINST ('steve'),6)
|
||||
4 0.905873
|
||||
7 0.895690
|
||||
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
|
||||
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
|
||||
4 1
|
||||
7 1
|
||||
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a;
|
||||
a MATCH (message) AGAINST ('steve')
|
||||
4 0.90587323904037
|
||||
7 0.89568990468979
|
||||
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a;
|
||||
a FORMAT(MATCH (message) AGAINST ('steve'),6)
|
||||
4 0.905873
|
||||
7 0.895690
|
||||
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a;
|
||||
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
|
||||
4 1
|
||||
7 1
|
||||
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC;
|
||||
a MATCH (message) AGAINST ('steve')
|
||||
7 0.89568990468979
|
||||
4 0.90587323904037
|
||||
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC;
|
||||
a FORMAT(MATCH (message) AGAINST ('steve'),6)
|
||||
7 0.895690
|
||||
4 0.905873
|
||||
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a DESC;
|
||||
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
|
||||
7 1
|
||||
4 1
|
||||
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1;
|
||||
a MATCH (message) AGAINST ('steve')
|
||||
7 0.89568990468979
|
||||
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1;
|
||||
a FORMAT(MATCH (message) AGAINST ('steve'),6)
|
||||
7 0.895690
|
||||
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY 1;
|
||||
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
|
||||
7 1
|
||||
SELECT a, MATCH (message) AGAINST ('steve') as rel FROM t1 ORDER BY rel;
|
||||
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) as rel FROM t1 ORDER BY rel;
|
||||
a rel
|
||||
1 0
|
||||
2 0
|
||||
3 0
|
||||
5 0
|
||||
6 0
|
||||
7 0.89568990468979
|
||||
4 0.90587323904037
|
||||
1 0.000000
|
||||
2 0.000000
|
||||
3 0.000000
|
||||
5 0.000000
|
||||
6 0.000000
|
||||
7 0.895690
|
||||
4 0.905873
|
||||
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel;
|
||||
a rel
|
||||
1 0
|
||||
|
|
|
@ -179,3 +179,9 @@ select 1 in ('1.1',2);
|
|||
select 1 in ('1.1',2.0);
|
||||
1 in ('1.1',2.0)
|
||||
0
|
||||
create table t1 (a char(20) character set binary);
|
||||
insert into t1 values ('aa'), ('bb');
|
||||
select * from t1 where a in (NULL, 'aa');
|
||||
a
|
||||
aa
|
||||
drop table t1;
|
||||
|
|
|
@ -745,6 +745,71 @@ player_id match_1_h * match_id home UUX
|
|||
7 4 * 1 2 2
|
||||
3 3 * 1 2 1
|
||||
drop table t1, t2;
|
||||
create table t1 (a int, b int, unique index idx (a, b));
|
||||
create table t2 (a int, b int, c int, unique index idx (a, b));
|
||||
insert into t1 values (1, 10), (1,11), (2,10), (2,11);
|
||||
insert into t2 values (1,10,3);
|
||||
select t1.a, t1.b, t2.c from t1 left join t2
|
||||
on t1.a=t2.a and t1.b=t2.b and t2.c=3
|
||||
where t1.a=1 and t2.c is null;
|
||||
a b c
|
||||
1 11 NULL
|
||||
drop table t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
ts_id bigint(20) default NULL,
|
||||
inst_id tinyint(4) default NULL,
|
||||
flag_name varchar(64) default NULL,
|
||||
flag_value text,
|
||||
UNIQUE KEY ts_id (ts_id,inst_id,flag_name)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
CREATE TABLE t2 (
|
||||
ts_id bigint(20) default NULL,
|
||||
inst_id tinyint(4) default NULL,
|
||||
flag_name varchar(64) default NULL,
|
||||
flag_value text,
|
||||
UNIQUE KEY ts_id (ts_id,inst_id,flag_name)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
INSERT INTO t1 VALUES
|
||||
(111056548820001, 0, 'flag1', NULL),
|
||||
(111056548820001, 0, 'flag2', NULL),
|
||||
(2, 0, 'other_flag', NULL);
|
||||
INSERT INTO t2 VALUES
|
||||
(111056548820001, 3, 'flag1', 'sss');
|
||||
SELECT t1.flag_name,t2.flag_value
|
||||
FROM t1 LEFT JOIN t2
|
||||
ON (t1.ts_id = t2.ts_id AND t1.flag_name = t2.flag_name AND
|
||||
t2.inst_id = 3)
|
||||
WHERE t1.inst_id = 0 AND t1.ts_id=111056548820001 AND
|
||||
t2.flag_value IS NULL;
|
||||
flag_name flag_value
|
||||
flag2 NULL
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE invoice (
|
||||
id int(11) unsigned NOT NULL auto_increment,
|
||||
text_id int(10) unsigned default NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
INSERT INTO invoice VALUES("1", "0");
|
||||
INSERT INTO invoice VALUES("2", "10");
|
||||
CREATE TABLE text_table (
|
||||
text_id char(3) NOT NULL default '',
|
||||
language_id char(3) NOT NULL default '',
|
||||
text_data text,
|
||||
PRIMARY KEY (text_id,language_id)
|
||||
);
|
||||
INSERT INTO text_table VALUES("0", "EN", "0-EN");
|
||||
INSERT INTO text_table VALUES("0", "SV", "0-SV");
|
||||
INSERT INTO text_table VALUES("10", "EN", "10-EN");
|
||||
INSERT INTO text_table VALUES("10", "SV", "10-SV");
|
||||
SELECT invoice.id, invoice.text_id, text_table.text_data
|
||||
FROM invoice LEFT JOIN text_table
|
||||
ON invoice.text_id = text_table.text_id
|
||||
AND text_table.language_id = 'SV'
|
||||
WHERE (invoice.id LIKE '%' OR text_table.text_data LIKE '%');
|
||||
id text_id text_data
|
||||
1 0 0-SV
|
||||
2 10 10-SV
|
||||
DROP TABLE invoice, text_table;
|
||||
CREATE TABLE t0 (a0 int PRIMARY KEY);
|
||||
CREATE TABLE t1 (a1 int PRIMARY KEY);
|
||||
CREATE TABLE t2 (a2 int);
|
||||
|
|
|
@ -40,6 +40,11 @@ SELECT * FROM t1 ORDER BY pk1;
|
|||
pk1 attr1 attr2 attr3
|
||||
3 1 NULL 9412
|
||||
9412 9413 17 9413
|
||||
UPDATE t1 SET pk1=4 WHERE pk1 = 3;
|
||||
SELECT * FROM t1 ORDER BY pk1;
|
||||
pk1 attr1 attr2 attr3
|
||||
4 1 NULL 9412
|
||||
9412 9413 17 9413
|
||||
DELETE FROM t1;
|
||||
SELECT * FROM t1;
|
||||
pk1 attr1 attr2 attr3
|
||||
|
|
|
@ -106,12 +106,6 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
|||
set @fvar= 123.4567;
|
||||
prepare stmt1 from @fvar;
|
||||
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 '123.4567' at line 1
|
||||
set @str1 = 'select ?';
|
||||
set @str2 = convert(@str1 using ucs2);
|
||||
prepare stmt1 from @str2;
|
||||
execute stmt1 using @ivar;
|
||||
?
|
||||
1234
|
||||
drop table t1,t2;
|
||||
PREPARE stmt1 FROM "select _utf8 'A' collate utf8_bin = ?";
|
||||
set @var='A';
|
||||
|
|
|
@ -1792,7 +1792,7 @@ t5 CREATE TABLE `t5` (
|
|||
`const12` char(0) default NULL,
|
||||
`param12` bigint(20) default NULL,
|
||||
`param13` double default NULL,
|
||||
`param14` longblob,
|
||||
`param14` longtext,
|
||||
`param15` longblob
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
select * from t5 ;
|
||||
|
@ -1822,7 +1822,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
|
|||
def test t5 t5 const12 const12 254 0 0 Y 0 0 8
|
||||
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
|
||||
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
|
||||
def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63
|
||||
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
|
||||
def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
|
||||
const01 8
|
||||
param01 8
|
||||
|
@ -1975,19 +1975,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select
|
||||
|
@ -2065,19 +2065,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
|
||||
|
@ -2157,19 +2157,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
|
||||
|
@ -2241,19 +2241,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
|
||||
|
|
|
@ -1775,7 +1775,7 @@ t5 CREATE TABLE `t5` (
|
|||
`const12` char(0) default NULL,
|
||||
`param12` bigint(20) default NULL,
|
||||
`param13` double default NULL,
|
||||
`param14` longblob,
|
||||
`param14` longtext,
|
||||
`param15` longblob
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
select * from t5 ;
|
||||
|
@ -1805,7 +1805,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
|
|||
def test t5 t5 const12 const12 254 0 0 Y 0 0 8
|
||||
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
|
||||
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
|
||||
def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63
|
||||
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
|
||||
def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
|
||||
const01 8
|
||||
param01 8
|
||||
|
@ -1958,19 +1958,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select
|
||||
|
@ -2048,19 +2048,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
|
||||
|
@ -2140,19 +2140,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
|
||||
|
@ -2224,19 +2224,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
|
||||
|
|
|
@ -1776,7 +1776,7 @@ t5 CREATE TABLE `t5` (
|
|||
`const12` char(0) default NULL,
|
||||
`param12` bigint(20) default NULL,
|
||||
`param13` double default NULL,
|
||||
`param14` longblob,
|
||||
`param14` longtext,
|
||||
`param15` longblob
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
select * from t5 ;
|
||||
|
@ -1806,7 +1806,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
|
|||
def test t5 t5 const12 const12 254 0 0 Y 0 0 8
|
||||
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
|
||||
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
|
||||
def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63
|
||||
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
|
||||
def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
|
||||
const01 8
|
||||
param01 8
|
||||
|
@ -1959,19 +1959,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 0 31 8
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 0 31 8
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 0 31 8
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 0 31 8
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select
|
||||
|
@ -2049,19 +2049,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 0 31 8
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 0 31 8
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 0 31 8
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 0 31 8
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
|
||||
|
@ -2141,19 +2141,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 0 31 8
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 0 31 8
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 0 31 8
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 0 31 8
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
|
||||
|
@ -2225,19 +2225,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 0 31 8
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 0 31 8
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 0 31 8
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 0 31 8
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
|
||||
|
|
|
@ -1715,7 +1715,7 @@ t5 CREATE TABLE `t5` (
|
|||
`const12` char(0) default NULL,
|
||||
`param12` bigint(20) default NULL,
|
||||
`param13` double default NULL,
|
||||
`param14` longblob,
|
||||
`param14` longtext,
|
||||
`param15` longblob
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
select * from t5 ;
|
||||
|
@ -1745,7 +1745,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
|
|||
def test t5 t5 const12 const12 254 0 0 Y 0 0 8
|
||||
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
|
||||
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
|
||||
def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63
|
||||
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
|
||||
def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
|
||||
const01 8
|
||||
param01 8
|
||||
|
@ -1898,19 +1898,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select
|
||||
|
@ -1988,19 +1988,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
|
||||
|
@ -2080,19 +2080,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
|
||||
|
@ -2164,19 +2164,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
|
||||
|
@ -4724,7 +4724,7 @@ t5 CREATE TABLE `t5` (
|
|||
`const12` char(0) default NULL,
|
||||
`param12` bigint(20) default NULL,
|
||||
`param13` double default NULL,
|
||||
`param14` longblob,
|
||||
`param14` longtext,
|
||||
`param15` longblob
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
select * from t5 ;
|
||||
|
@ -4754,7 +4754,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
|
|||
def test t5 t5 const12 const12 254 0 0 Y 0 0 8
|
||||
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
|
||||
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
|
||||
def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63
|
||||
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
|
||||
def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
|
||||
const01 8
|
||||
param01 8
|
||||
|
@ -4907,19 +4907,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select
|
||||
|
@ -4997,19 +4997,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
|
||||
|
@ -5089,19 +5089,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
|
||||
|
@ -5173,19 +5173,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
|
||||
|
|
|
@ -1775,7 +1775,7 @@ t5 CREATE TABLE `t5` (
|
|||
`const12` char(0) default NULL,
|
||||
`param12` bigint(20) default NULL,
|
||||
`param13` double default NULL,
|
||||
`param14` longblob,
|
||||
`param14` longtext,
|
||||
`param15` longblob
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
select * from t5 ;
|
||||
|
@ -1805,7 +1805,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
|
|||
def test t5 t5 const12 const12 254 0 0 Y 0 0 8
|
||||
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
|
||||
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
|
||||
def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63
|
||||
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
|
||||
def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
|
||||
const01 8
|
||||
param01 8
|
||||
|
@ -1958,19 +1958,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select
|
||||
|
@ -2048,19 +2048,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
|
||||
|
@ -2140,19 +2140,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
|
||||
|
@ -2224,19 +2224,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
|
||||
|
|
|
@ -1752,7 +1752,7 @@ t5 CREATE TABLE `t5` (
|
|||
`const12` char(0) default NULL,
|
||||
`param12` bigint(20) default NULL,
|
||||
`param13` double default NULL,
|
||||
`param14` longblob,
|
||||
`param14` longtext,
|
||||
`param15` longblob
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
select * from t5 ;
|
||||
|
@ -1782,7 +1782,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
|
|||
def test t5 t5 const12 const12 254 0 0 Y 0 0 8
|
||||
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
|
||||
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
|
||||
def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63
|
||||
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
|
||||
def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63
|
||||
const01 8
|
||||
param01 8
|
||||
|
@ -1935,19 +1935,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 0 31 8
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 0 31 8
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 0 31 8
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 0 31 8
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select
|
||||
|
@ -2025,19 +2025,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 0 31 8
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 0 31 8
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 0 31 8
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 0 31 8
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
|
||||
|
@ -2117,19 +2117,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 0 31 8
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 0 31 8
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 0 31 8
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 0 31 8
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
|
||||
|
@ -2201,19 +2201,19 @@ def @arg16 254 8192 0 Y 128 31 63
|
|||
def @arg17 254 20 0 Y 128 31 63
|
||||
def @arg18 254 20 0 Y 128 31 63
|
||||
def @arg19 254 20 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 128 31 63
|
||||
def @arg21 254 8192 0 Y 128 31 63
|
||||
def @arg22 254 8192 0 Y 128 31 63
|
||||
def @arg23 254 8192 0 Y 128 31 63
|
||||
def @arg24 254 8192 0 Y 128 31 63
|
||||
def @arg25 254 8192 0 Y 128 31 63
|
||||
def @arg26 254 8192 0 Y 128 31 63
|
||||
def @arg27 254 8192 0 Y 128 31 63
|
||||
def @arg28 254 8192 0 Y 128 31 63
|
||||
def @arg29 254 8192 0 Y 128 31 63
|
||||
def @arg30 254 8192 0 Y 128 31 63
|
||||
def @arg31 254 8192 0 Y 128 31 63
|
||||
def @arg32 254 8192 0 Y 128 31 63
|
||||
def @arg20 254 8192 0 Y 0 31 8
|
||||
def @arg21 254 8192 0 Y 0 31 8
|
||||
def @arg22 254 8192 0 Y 0 31 8
|
||||
def @arg23 254 8192 0 Y 0 31 8
|
||||
def @arg24 254 8192 0 Y 0 31 8
|
||||
def @arg25 254 8192 0 Y 0 31 8
|
||||
def @arg26 254 8192 0 Y 0 31 8
|
||||
def @arg27 254 8192 0 Y 0 31 8
|
||||
def @arg28 254 8192 0 Y 0 31 8
|
||||
def @arg29 254 8192 0 Y 0 31 8
|
||||
def @arg30 254 8192 0 Y 0 31 8
|
||||
def @arg31 254 8192 0 Y 0 31 8
|
||||
def @arg32 254 8192 0 Y 0 31 8
|
||||
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
|
||||
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
|
||||
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
|
||||
|
|
|
@ -22,14 +22,14 @@ select * from t1;
|
|||
f1 f2
|
||||
10 10
|
||||
100000 100000
|
||||
1.23457e+09 1234567890
|
||||
1.23457e+9 1234567890
|
||||
1e+10 10000000000
|
||||
1e+15 1e+15
|
||||
1e+20 1e+20
|
||||
3.40282e+38 1e+50
|
||||
3.40282e+38 1e+150
|
||||
-10 -10
|
||||
1e-05 1e-05
|
||||
1e-5 1e-5
|
||||
1e-10 1e-10
|
||||
1e-15 1e-15
|
||||
1e-20 1e-20
|
||||
|
|
|
@ -201,3 +201,7 @@ SET @`v`:=_ucs2 0x006100620063 COLLATE ucs2_general_ci;
|
|||
SET TIMESTAMP=10000;
|
||||
insert into t2 values (@v);
|
||||
drop table t1, t2;
|
||||
set @var= NULL ;
|
||||
select FIELD( @var,'1it','Hit') as my_column;
|
||||
my_column
|
||||
0
|
||||
|
|
|
@ -315,3 +315,11 @@ alter table t1 modify a char(5);
|
|||
select a, hex(a) from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Check prepare statement from an UCS2 string
|
||||
#
|
||||
set @ivar= 1234;
|
||||
set @str1 = 'select ?';
|
||||
set @str2 = convert(@str1 using ucs2);
|
||||
prepare stmt1 from @str2;
|
||||
execute stmt1 using @ivar;
|
||||
|
|
|
@ -279,7 +279,7 @@ SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabr
|
|||
SET NAMES latin1;
|
||||
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück');
|
||||
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
|
||||
SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAINST ('Osnabruck');
|
||||
SELECT t, collation(t),FORMAT(MATCH t AGAINST ('Osnabruck'),6) FROM t1 WHERE MATCH t AGAINST ('Osnabruck');
|
||||
#alter table t1 modify t text character set latin1 collate latin1_german2_ci not null;
|
||||
alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
|
||||
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück');
|
||||
|
|
|
@ -10,25 +10,25 @@ CREATE TABLE t1 (
|
|||
INSERT INTO t1 (message) VALUES ("Testing"),("table"),("testbug"),
|
||||
("steve"),("is"),("cool"),("steve is cool");
|
||||
# basic MATCH
|
||||
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve');
|
||||
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve');
|
||||
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve');
|
||||
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
|
||||
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
|
||||
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
|
||||
|
||||
# MATCH + ORDER BY (with ft-ranges)
|
||||
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a;
|
||||
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a;
|
||||
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a;
|
||||
|
||||
# MATCH + ORDER BY (with normal ranges) + UNIQUE
|
||||
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC;
|
||||
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC;
|
||||
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a DESC;
|
||||
|
||||
# MATCH + ORDER BY + UNIQUE (const_table)
|
||||
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1;
|
||||
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1;
|
||||
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY 1;
|
||||
|
||||
# ORDER BY MATCH
|
||||
SELECT a, MATCH (message) AGAINST ('steve') as rel FROM t1 ORDER BY rel;
|
||||
SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) as rel FROM t1 ORDER BY rel;
|
||||
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel;
|
||||
|
||||
drop table t1;
|
||||
|
|
|
@ -89,3 +89,10 @@ select 1 in ('1.0',2.0);
|
|||
select 1 in (1.0,'2.0');
|
||||
select 1 in ('1.1',2);
|
||||
select 1 in ('1.1',2.0);
|
||||
|
||||
# Test case for bug #6365
|
||||
|
||||
create table t1 (a char(20) character set binary);
|
||||
insert into t1 values ('aa'), ('bb');
|
||||
select * from t1 where a in (NULL, 'aa');
|
||||
drop table t1;
|
||||
|
|
|
@ -1110,6 +1110,7 @@ show create table t2;
|
|||
drop table t2;
|
||||
|
||||
# Test error handling
|
||||
--replace_result \\ /
|
||||
--error 1005
|
||||
create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
|
||||
|
||||
|
|
|
@ -99,22 +99,27 @@ create table t1(number int auto_increment primary key, original_value varchar(50
|
|||
|
||||
set @value= "aa";
|
||||
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
||||
--replace_result e-0 e- e+0 e+
|
||||
--query_vertical select * from t1 where number =last_insert_id()
|
||||
|
||||
set @value= "1aa";
|
||||
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
||||
--replace_result e-0 e- e+0 e+
|
||||
--query_vertical select * from t1 where number =last_insert_id()
|
||||
|
||||
set @value= "aa1";
|
||||
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
||||
--replace_result e-0 e- e+0 e+
|
||||
--query_vertical select * from t1 where number =last_insert_id()
|
||||
|
||||
set @value= "1e+1111111111a";
|
||||
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
||||
--replace_result e-0 e- e+0 e+
|
||||
--query_vertical select * from t1 where number =last_insert_id()
|
||||
|
||||
set @value= "-1e+1111111111a";
|
||||
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
||||
--replace_result e-0 e- e+0 e+
|
||||
--query_vertical select * from t1 where number =last_insert_id()
|
||||
|
||||
--error 1367
|
||||
|
@ -122,20 +127,25 @@ set @value= 1e+1111111111;
|
|||
--error 1367
|
||||
set @value= -1e+1111111111;
|
||||
|
||||
|
||||
set @value= 1e+111;
|
||||
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
||||
--replace_result e-0 e- e+0 e+
|
||||
--query_vertical select * from t1 where number =last_insert_id()
|
||||
|
||||
set @value= -1e+111;
|
||||
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
||||
--replace_result e-0 e- e+0 e+
|
||||
--query_vertical select * from t1 where number =last_insert_id()
|
||||
|
||||
set @value= 1;
|
||||
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
||||
--replace_result e-0 e- e+0 e+
|
||||
--query_vertical select * from t1 where number =last_insert_id()
|
||||
|
||||
set @value= -1;
|
||||
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
||||
--replace_result e-0 e- e+0 e+
|
||||
--query_vertical select * from t1 where number =last_insert_id()
|
||||
|
||||
drop table t1;
|
||||
|
|
|
@ -507,6 +507,82 @@ select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
|
|||
|
||||
drop table t1, t2;
|
||||
|
||||
# Tests for bugs #6307 and 6460
|
||||
|
||||
create table t1 (a int, b int, unique index idx (a, b));
|
||||
create table t2 (a int, b int, c int, unique index idx (a, b));
|
||||
|
||||
insert into t1 values (1, 10), (1,11), (2,10), (2,11);
|
||||
insert into t2 values (1,10,3);
|
||||
|
||||
select t1.a, t1.b, t2.c from t1 left join t2
|
||||
on t1.a=t2.a and t1.b=t2.b and t2.c=3
|
||||
where t1.a=1 and t2.c is null;
|
||||
|
||||
drop table t1, t2;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
ts_id bigint(20) default NULL,
|
||||
inst_id tinyint(4) default NULL,
|
||||
flag_name varchar(64) default NULL,
|
||||
flag_value text,
|
||||
UNIQUE KEY ts_id (ts_id,inst_id,flag_name)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
ts_id bigint(20) default NULL,
|
||||
inst_id tinyint(4) default NULL,
|
||||
flag_name varchar(64) default NULL,
|
||||
flag_value text,
|
||||
UNIQUE KEY ts_id (ts_id,inst_id,flag_name)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT INTO t1 VALUES
|
||||
(111056548820001, 0, 'flag1', NULL),
|
||||
(111056548820001, 0, 'flag2', NULL),
|
||||
(2, 0, 'other_flag', NULL);
|
||||
|
||||
INSERT INTO t2 VALUES
|
||||
(111056548820001, 3, 'flag1', 'sss');
|
||||
|
||||
SELECT t1.flag_name,t2.flag_value
|
||||
FROM t1 LEFT JOIN t2
|
||||
ON (t1.ts_id = t2.ts_id AND t1.flag_name = t2.flag_name AND
|
||||
t2.inst_id = 3)
|
||||
WHERE t1.inst_id = 0 AND t1.ts_id=111056548820001 AND
|
||||
t2.flag_value IS NULL;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
CREATE TABLE invoice (
|
||||
id int(11) unsigned NOT NULL auto_increment,
|
||||
text_id int(10) unsigned default NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
INSERT INTO invoice VALUES("1", "0");
|
||||
INSERT INTO invoice VALUES("2", "10");
|
||||
|
||||
CREATE TABLE text_table (
|
||||
text_id char(3) NOT NULL default '',
|
||||
language_id char(3) NOT NULL default '',
|
||||
text_data text,
|
||||
PRIMARY KEY (text_id,language_id)
|
||||
);
|
||||
|
||||
INSERT INTO text_table VALUES("0", "EN", "0-EN");
|
||||
INSERT INTO text_table VALUES("0", "SV", "0-SV");
|
||||
INSERT INTO text_table VALUES("10", "EN", "10-EN");
|
||||
INSERT INTO text_table VALUES("10", "SV", "10-SV");
|
||||
|
||||
SELECT invoice.id, invoice.text_id, text_table.text_data
|
||||
FROM invoice LEFT JOIN text_table
|
||||
ON invoice.text_id = text_table.text_id
|
||||
AND text_table.language_id = 'SV'
|
||||
WHERE (invoice.id LIKE '%' OR text_table.text_data LIKE '%');
|
||||
|
||||
DROP TABLE invoice, text_table;
|
||||
|
||||
# Test for bug #5896
|
||||
|
||||
CREATE TABLE t0 (a0 int PRIMARY KEY);
|
||||
|
|
|
@ -36,6 +36,8 @@ UPDATE t1 SET pk1=2 WHERE attr1=1;
|
|||
SELECT * FROM t1 ORDER BY pk1;
|
||||
UPDATE t1 SET pk1=pk1 + 1;
|
||||
SELECT * FROM t1 ORDER BY pk1;
|
||||
UPDATE t1 SET pk1=4 WHERE pk1 = 3;
|
||||
SELECT * FROM t1 ORDER BY pk1;
|
||||
|
||||
# Delete the record
|
||||
DELETE FROM t1;
|
||||
|
|
|
@ -110,10 +110,6 @@ set @fvar= 123.4567;
|
|||
--error 1064
|
||||
prepare stmt1 from @fvar;
|
||||
|
||||
set @str1 = 'select ?';
|
||||
set @str2 = convert(@str1 using ucs2);
|
||||
prepare stmt1 from @str2;
|
||||
execute stmt1 using @ivar;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
|
|
|
@ -1 +1 @@
|
|||
--innodb-lock-wait-timeout=1
|
||||
--loose-innodb-lock-wait-timeout=1
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
--replace_result e-0 e- e+0 e+
|
||||
SELECT 10,10.0,10.,.1e+2,100.0e-1;
|
||||
--replace_result e-00 e-0
|
||||
SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000;
|
||||
SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1;
|
||||
|
||||
|
@ -14,6 +16,7 @@ create table t1 (f1 float(24),f2 float(52));
|
|||
show full columns from t1;
|
||||
insert into t1 values(10,10),(1e+5,1e+5),(1234567890,1234567890),(1e+10,1e+10),(1e+15,1e+15),(1e+20,1e+20),(1e+50,1e+50),(1e+150,1e+150);
|
||||
insert into t1 values(-10,-10),(1e-5,1e-5),(1e-10,1e-10),(1e-15,1e-15),(1e-20,1e-20),(1e-50,1e-50),(1e-150,1e-150);
|
||||
--replace_result e-0 e- e+0 e+
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
|
|
|
@ -121,3 +121,9 @@ show binlog events from 95;
|
|||
drop table t1, t2;
|
||||
|
||||
|
||||
#
|
||||
# Bug #6321 strange error:
|
||||
# string function FIELD(<uservariable content NULL>, ...)
|
||||
#
|
||||
set @var= NULL ;
|
||||
select FIELD( @var,'1it','Hit') as my_column;
|
||||
|
|
|
@ -20,6 +20,7 @@ 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;
|
||||
--replace_result e-0 e- e+0 e+
|
||||
select @test_int,@test_double,@test_string,@test_string2,@select;
|
||||
set @test_int="hello",@test_double="hello",@test_string="hello",@test_string2="hello";
|
||||
select @test_int,@test_double,@test_string,@test_string2;
|
||||
|
|
|
@ -1,569 +0,0 @@
|
|||
#!/usr/bin/perl -w
|
||||
#
|
||||
# cvschk -- fast offline check for new files and modifications of files
|
||||
|
||||
# cvschk : A perl program which checks the status of the CVS controlled
|
||||
# files and gives an ASCII table sorted after the status of files.
|
||||
#
|
||||
# If you have used CVS, then you know that it is hard to
|
||||
# get a good overview the CVS-status of the files in you
|
||||
# directories. Any new files? Any files changes?
|
||||
# cvschk will help the programmer get the overview in the
|
||||
# situation, where we do not have access to the CVS repository.
|
||||
#
|
||||
# Note that the program does only local checks of the files
|
||||
# If you have fast access to the CVS repositiory, then consider
|
||||
# the cvsstat-program - which additionally can tell if other
|
||||
# people have made newer versions of the files.
|
||||
#
|
||||
# The program requires Perl 5.004 (maybe previous versions also work).
|
||||
#
|
||||
# It is tuned to parse the output of cvs(1) version 1.9.
|
||||
# Earlier and later versions may require modifications to the script.
|
||||
#
|
||||
# ** Note that the first line might be wrong depending **
|
||||
# ** on the location of your perl program. **
|
||||
#
|
||||
# Sample output:
|
||||
# The directory ./mytempdir is not under CVS control
|
||||
#
|
||||
# Changed files
|
||||
# ---------------
|
||||
# ./cvs2html
|
||||
# ./cvschk
|
||||
# ./cvsstat
|
||||
#
|
||||
# New files
|
||||
# ---------------
|
||||
# ./.#cvschk
|
||||
# ./XX
|
||||
# ./cvs2html.ok
|
||||
#
|
||||
# Deleted files
|
||||
# ---------------
|
||||
# (none)
|
||||
|
||||
# Changelog:
|
||||
#
|
||||
# Ver Date Author Changelog
|
||||
# --- ---------- -------------------- -------------------------------------
|
||||
# 1.12 2002-01-04 Michael Kohne Fixed a $foo=<> warning for
|
||||
# 5.004_01 with defined($foo=<>)
|
||||
# Added a --tabular|-t switch
|
||||
#
|
||||
# 1.11 2001-12-27 Michael Kohne Added cvsignore functionality
|
||||
# Handling of 'dummy timestamp'
|
||||
# Handling of 'Result of Merge'
|
||||
#
|
||||
# 1.10 2001-11-06 Michael Kohne Added -r and -l options
|
||||
#
|
||||
# 1.9 2001-08-03 Lars G. T. Jørgensen Hack to allow special entry-line
|
||||
#
|
||||
# 1.8 2001-06-07 Peter Toft Back to the same as 1.6
|
||||
# CVS is my friend
|
||||
#
|
||||
# 1.7 2001-06-04 Peter Toft Peter was very tired and
|
||||
# applied a wrong patch -
|
||||
# version 1.7 is crap
|
||||
#
|
||||
# 1.6 2000-12-17 Peter Toft Better description added
|
||||
#
|
||||
# 1.5 2000-11-04 Peter Toft URL of cvsstat changed
|
||||
#
|
||||
# 1.4 2000-09-20 Peter Toft Must show deleted files also
|
||||
# as the default
|
||||
#
|
||||
# 1.3 2000-08-08 Ole Tange and Initial version
|
||||
# Peter Toft
|
||||
# ---- ---------- -------------------- -------------------------------------
|
||||
#
|
||||
# -----------------------------------------------------------------------------
|
||||
#
|
||||
# This program is protected by the GPL, and all modifications of
|
||||
# general interest should be emailed to the maintainer (pto@sslug.dk).
|
||||
#
|
||||
# This program also uses code parts from cvsstat
|
||||
# (same homepage as cvschk)
|
||||
#
|
||||
# Copyright 2000,2001 by Peter Toft <pto@sslug.dk> and Ole Tange <ole@tange.dk>
|
||||
# as well as
|
||||
# Lars G. T. Jørgensen <larsj@diku.dk>
|
||||
#
|
||||
# The URL of the home page of cvschk is shown below.
|
||||
|
||||
|
||||
use Time::Local;
|
||||
use strict;
|
||||
use Getopt::Long;
|
||||
|
||||
my $startdir = ".";
|
||||
|
||||
my $debug = 0;
|
||||
my (%files,%filesok,%seen,%skip);
|
||||
|
||||
|
||||
# Michael Kohne 12/16/01
|
||||
#
|
||||
# Simulation of .cvsignore as CVS does it...
|
||||
#
|
||||
# using .cvsignore handling makes cvschk take from 2 to 3 times
|
||||
# longer to run over the same set of files.
|
||||
# in my tests, disabling cvsignore altogether, cvschk takes .2
|
||||
# seconds on my working directory. Adding cvsignore,takes
|
||||
# .4 seconds.
|
||||
# Note that I do not use individual .cvsignore files - if there
|
||||
# are a lot of them in your directory tree, it will add run time
|
||||
#
|
||||
# variables used for .cvsignore handling
|
||||
my $initcvsignoreregex;# regex holding all startup cvsignore pattersn (no ())
|
||||
my $cvsignoreregex;# one regex holding all current cvsignore patterns
|
||||
my $disable_cvsignore=0;# set to 1 to disable cvsignore emulation
|
||||
# (available in case it's REALLY screwed up)
|
||||
my $disable_ind_cvsignore=0;# set to 1 to disable finding .cvsignore files
|
||||
# in each directory.
|
||||
my $debug_cvsignore = 0; # For debugging .cvsignore problems
|
||||
|
||||
my %mon;
|
||||
@mon{qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)}=
|
||||
0..11; # Perl months are 0 .. 11
|
||||
|
||||
my ($version) = ('$Revision: 1.12 $ ' =~ /^\$\w+: (.*) \$ $/);
|
||||
my $URL = "http://cvs.sslug.dk/cvs2html";
|
||||
my $version_line = "cvschk version $version (see $URL)\n";
|
||||
|
||||
my $opt_all;
|
||||
my $restrict;
|
||||
my $local;
|
||||
my $tabular;
|
||||
|
||||
my $opt_restrict;
|
||||
|
||||
sub show_version {print $version_line}
|
||||
|
||||
sub die_version {die $version_line}
|
||||
|
||||
sub die_usage {
|
||||
my $bundled = ($] > 5.00399
|
||||
? "can be bundled"
|
||||
: "can't be bundled, because your Perl is too old");
|
||||
die <<END_OF_USAGE; # Help in the style of GNU `ls --help' or `make --help'
|
||||
Usage: $0 [OPTION]...
|
||||
Show the CVS status of FILEs (the current directory by default),
|
||||
traversing directories recursively and telling if new files exist
|
||||
in the repository.
|
||||
Options:
|
||||
-a, --all Show all statistics, including the names of files that
|
||||
are up to date, used tags, ignored patterns and more
|
||||
-r, --restrict Don't show the names of the unknown files
|
||||
(useful if you have many temporary files)
|
||||
-t, --tabular Show one file per line, each preceeded with a status word,
|
||||
Sorted by filename.
|
||||
-l, --local Don't descend into sub-directories
|
||||
-d, --debug Debug info
|
||||
-h, --help Show this help end exit immediately
|
||||
-V, --version Show the version line and exit immediately
|
||||
The one-letter options $bundled.
|
||||
END_OF_USAGE
|
||||
}
|
||||
|
||||
sub die_help {show_version; die_usage}
|
||||
|
||||
# Let `-ar' mean `-a -r' and require `--all' (or -a) instead of `-all'.
|
||||
if ($] > 5.00399) { # This requires 5.004, so silently skip it for older Perls.
|
||||
eval {Getopt::Long::config("bundling")}; # avoid 5.003 compilation error
|
||||
warn $@ if $@; # For Perl 5.004+ we do want to see any compilation error
|
||||
}
|
||||
|
||||
|
||||
GetOptions( "all|a" => \$opt_all,
|
||||
"tabular|t" => \$tabular,
|
||||
"restrict|r" => \$restrict,
|
||||
"local|l" => \$local,
|
||||
"help|h" => \&die_help,
|
||||
"debug|d" => \$debug,
|
||||
"version|V" => \&die_version,
|
||||
) or die_usage;
|
||||
|
||||
sub cvs_changed_in_dir($); #define prototype (for recursion)
|
||||
|
||||
# functions for .cvsignore handling
|
||||
|
||||
# converts a given filename pattern
|
||||
# (of the sort that sh(1) takes) to
|
||||
# a perl regex of similar meaning.
|
||||
#
|
||||
# It works by doing the following:
|
||||
#
|
||||
# change:
|
||||
# . to \.
|
||||
# $ to \$
|
||||
# * to .*
|
||||
# ? to .
|
||||
#
|
||||
sub fpat_to_regex($)
|
||||
{
|
||||
my $fexp;
|
||||
$fexp = shift;
|
||||
$fexp =~ s/\./\\\./g;#change . to \.
|
||||
$fexp =~ s/\$/\\\$/g;#change dollar sign to \dollar sign
|
||||
$fexp =~ s/\*/.*/g;# change * to .*
|
||||
$fexp =~ s/\?/./g; # change ? to .
|
||||
return $fexp;
|
||||
}
|
||||
|
||||
# copy the input list to one single regex,
|
||||
# items seperated by | symbols.
|
||||
# return the regex string
|
||||
sub do_regex_convert
|
||||
{
|
||||
my $rx = "";
|
||||
my $first = 1;#true for first element only
|
||||
|
||||
|
||||
# convert each element of cvsignore into a regex
|
||||
# this makes the patterns usable in perl
|
||||
my $cp;
|
||||
foreach $cp (@_) {
|
||||
if (not $first) { $rx = $rx . "|"; }
|
||||
if ($first) { $first = 0; }
|
||||
$rx = $rx . fpat_to_regex($cp);
|
||||
}
|
||||
|
||||
return $rx;
|
||||
}
|
||||
|
||||
# first parameter is a reference to the array
|
||||
# to be loaded
|
||||
# the rest of the parameters are just items
|
||||
# that need to be loaded into the array.
|
||||
# Note that if a ! is found, the list is
|
||||
# emptied, then further items are added.
|
||||
# returns true if a ! was found
|
||||
sub load_list_from_list
|
||||
{
|
||||
my $arref = shift;# get reference to array from front
|
||||
my $item;
|
||||
my $ret=0;#false means no ! found
|
||||
|
||||
chomp @_;#kill newlines
|
||||
foreach $item (@_) {
|
||||
$item =~ s/^\s*(.*?)\s*$/$1/;#kill leading/trailing whitespace
|
||||
if ($item) { # empty string is false
|
||||
push @$arref,$item;
|
||||
}
|
||||
if ($item eq "!") {
|
||||
@$arref = ();# '!' causes list to clear
|
||||
$ret = 1;# ! found
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
# loads the given list with lines from the
|
||||
# specified file. Note that if a '!' is found
|
||||
# all prior patterns are removed from the list
|
||||
# before the following patterns are loaded
|
||||
# first param is the filename,
|
||||
# second param is a reference to an array
|
||||
# that the data is to go into
|
||||
# returns true if a ! was found
|
||||
sub load_list_from_file
|
||||
{
|
||||
my @inlist;
|
||||
my $fname = shift;#filename to read from
|
||||
#if (not -e $fname) { return; }
|
||||
my $arref = shift;#array to store into
|
||||
open CVSIGNORE,"$fname" or return;#file might not exist, that's OK
|
||||
@inlist = <CVSIGNORE>;
|
||||
close CVSIGNORE;
|
||||
return load_list_from_list($arref,@inlist);
|
||||
}
|
||||
|
||||
# loads $cvsignoreregex from
|
||||
# $initcvsignoreregex and the .cvsignore file
|
||||
# in the local directory
|
||||
sub load_cvsignore
|
||||
{
|
||||
if ($disable_ind_cvsignore) {return;}#don't look for local .cvsignore files
|
||||
if ($disable_cvsignore) {return;}#don't do anything
|
||||
|
||||
my $dir = shift;
|
||||
my @cvsignore;
|
||||
|
||||
# bang will be true if a ! was found. In such cases, I need
|
||||
# to not use the pre-exisitng regex list.
|
||||
my $bang = load_list_from_file("$dir/.cvsignore",\@cvsignore);
|
||||
|
||||
# if we get a local cvsignore list, then...
|
||||
my $rx = do_regex_convert(@cvsignore);
|
||||
if ($rx) {
|
||||
$cvsignoreregex = "(";
|
||||
if (not $bang) {$cvsignoreregex = $cvsignoreregex . $initcvsignoreregex . "|";}
|
||||
$cvsignoreregex = $cvsignoreregex . $rx . ")";
|
||||
} else {
|
||||
if ($bang) {$cvsignoreregex = "";}
|
||||
else {$cvsignoreregex = "(" . $initcvsignoreregex . ")";}
|
||||
}
|
||||
|
||||
if ($debug_cvsignore) {print $dir,":",$cvsignoreregex, "\n";}
|
||||
}
|
||||
|
||||
|
||||
# loads all of the cvsignore patterns that
|
||||
# can be loaded at script startup
|
||||
sub load_initial_cvsignore()
|
||||
{
|
||||
#load the default patterns
|
||||
# (taken from http://www.gnu.org/manual/cvs-1.9/html_node/cvs_141.html#IDX399)
|
||||
#
|
||||
# this gives you the patterns that cvs normally starts with
|
||||
my @initcvsignore;
|
||||
push @initcvsignore,("RCS");
|
||||
push @initcvsignore,("SCCS");
|
||||
push @initcvsignore,("CVS");
|
||||
push @initcvsignore,("CVS.adm");
|
||||
push @initcvsignore,("RCSLOG");
|
||||
push @initcvsignore,("cvslog.*");
|
||||
push @initcvsignore,("tags");
|
||||
push @initcvsignore,("TAGS");
|
||||
push @initcvsignore,(".make.state");
|
||||
push @initcvsignore,(".nse_depinfo");
|
||||
push @initcvsignore,("*~");
|
||||
push @initcvsignore,("\#*");
|
||||
push @initcvsignore,(".\#*");
|
||||
push @initcvsignore,("\,*");
|
||||
push @initcvsignore,("_\$\*");
|
||||
push @initcvsignore,("*\$");
|
||||
push @initcvsignore,("*.old");
|
||||
push @initcvsignore,("*.bak");
|
||||
push @initcvsignore,("*.BAK");
|
||||
push @initcvsignore,("*.orig");
|
||||
push @initcvsignore,("*.rej");
|
||||
push @initcvsignore,(".del-*");
|
||||
push @initcvsignore,("*.a");
|
||||
push @initcvsignore,("*.olb");
|
||||
push @initcvsignore,("*.o");
|
||||
push @initcvsignore,("*.obj");
|
||||
push @initcvsignore,("*.so");
|
||||
push @initcvsignore,("*.exe");
|
||||
push @initcvsignore,("*.Z");
|
||||
push @initcvsignore,("*.elc");
|
||||
push @initcvsignore,("*.ln");
|
||||
push @initcvsignore,("core");
|
||||
|
||||
|
||||
# now, load (in proper order!)
|
||||
# each of the possible cvsignore files
|
||||
|
||||
# there are 4 possible .cvsignore files:
|
||||
|
||||
# $CVSROOT/CVSROOT/cvsignore
|
||||
# ~/.cvsignore
|
||||
# $CVSIGNORE environment variable
|
||||
# .cvsignore in current directory
|
||||
|
||||
# The first (CVSROOT/cvsignore) would require calling cvs, so
|
||||
# we won't do that one.
|
||||
# The last (.cvsignore in current directory) is done
|
||||
# for each directory. It's handled in the load_cvsignore routine.
|
||||
|
||||
# ~/.cvsignore
|
||||
my @inlist;
|
||||
my $item;
|
||||
my $HOME=$ENV{"HOME"};
|
||||
if (not $HOME) {$HOME = ".";}
|
||||
load_list_from_file("$HOME/.cvsignore",\@initcvsignore);
|
||||
|
||||
# $CVSIGNORE environment variable
|
||||
my $igstr = $ENV{"CVSIGNORE"}; # get env var
|
||||
if ($igstr) {
|
||||
my @iglist = split(/\s+/, $igstr); #if it exists, convert to list
|
||||
load_list_from_list(\@initcvsignore,@iglist);
|
||||
}
|
||||
|
||||
# now that @initcvsignore is setup,
|
||||
# turn it into a regex string
|
||||
$initcvsignoreregex = do_regex_convert(@initcvsignore);
|
||||
|
||||
# now preset the cvsignore regex string to match
|
||||
# @initcvsignore. That way, if we aren't using local
|
||||
# cvsignore files, we do nothing.
|
||||
$cvsignoreregex = "(" . $initcvsignoreregex . ")";
|
||||
}
|
||||
# routine to see if the given name is in the cvsignore regex
|
||||
# returns true if it is, false if it's not
|
||||
sub ignore_file($)
|
||||
{
|
||||
#allow user to disable the cvsignore stuff
|
||||
if ($disable_cvsignore) {return 0;}
|
||||
if (not $cvsignoreregex) {return 0;}# if regex is empty, nothing matches the regex
|
||||
my $filename = shift;
|
||||
|
||||
if ($debug_cvsignore) {print "ignore_file:",$filename,"\n";}
|
||||
|
||||
if ($filename =~ $cvsignoreregex) {
|
||||
if ($debug_cvsignore) {print $filename," matches\n";}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ($debug_cvsignore) {print $filename," doesn't match\n";}
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub cvs_changed_in_dir($) {
|
||||
my $dir = shift;
|
||||
|
||||
my ($line,$filename,$version,$mtime,$date,
|
||||
$dir_filename,$cvstime,@subdirs,
|
||||
@new_in_dir,$i);
|
||||
|
||||
# Examine status of files in CVS/Entries
|
||||
if(not open(ENTRIES,"$dir/CVS/Entries")) {
|
||||
if ($tabular) {
|
||||
push @{$files{Unknown}}, $dir;
|
||||
}
|
||||
else {
|
||||
warn "The directory $dir is not under CVS control\n";
|
||||
}
|
||||
} else {
|
||||
load_cvsignore($dir);#load up proper cvsignore for given directory
|
||||
|
||||
while(defined ($line=<ENTRIES>)) {
|
||||
# Parse CVS/Entries-line
|
||||
$line=~m!^/(.*)/(.*)/(.*)/.*/! or do {
|
||||
$debug and warn("Skipping entry-line $line");
|
||||
next;
|
||||
};
|
||||
($filename,$version,$date) = ($1,$2,$3);
|
||||
$dir_filename=$dir."/".$filename;
|
||||
|
||||
# Mark this file as seen
|
||||
$seen{$dir_filename}=1;
|
||||
|
||||
# if not exists: Deleted
|
||||
if(not -e $dir_filename) {
|
||||
push @{$files{Deleted}}, $dir_filename; next;
|
||||
}
|
||||
# if dir: save name for recursion
|
||||
-d $dir_filename and do {
|
||||
push @subdirs, $dir_filename; next;
|
||||
};
|
||||
|
||||
# modification time of $dir_filename
|
||||
$mtime= (stat $dir_filename)[9];
|
||||
|
||||
|
||||
if($date eq "dummy timestamp") {
|
||||
# dummy timestamp means it's new to the repository.
|
||||
push @{$files{Changed}}, $dir_filename;
|
||||
if ($debug) {
|
||||
print "$dir_filename is changed\n";
|
||||
}
|
||||
}
|
||||
elsif($date eq "Result of merge") {
|
||||
# result of merge means it's changed, then updated.
|
||||
push @{$files{Changed}}, $dir_filename;
|
||||
if ($debug) {
|
||||
print "$dir_filename is changed\n";
|
||||
}
|
||||
}
|
||||
elsif(not
|
||||
$date=~/... (...)\s+(\d+)\s+(\d+):(\d+):(\d+) (\d{4})/)
|
||||
{
|
||||
#bogus entry in Entires
|
||||
warn "Warning: $dir_filename -> '$date' ".
|
||||
"not in ctime(3) format\n";
|
||||
} else {
|
||||
$cvstime=timegm($5,$4,$3,$2,$mon{$1},$6);
|
||||
if($cvstime != $mtime) {
|
||||
push @{$files{Changed}}, $dir_filename;
|
||||
if ($debug) {
|
||||
print "$dir_filename is changed\n";
|
||||
}
|
||||
} else {
|
||||
push @{$files{Unchanged}}, $dir_filename;
|
||||
if ($debug) {
|
||||
print "$dir_filename is Unchanged\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
close ENTRIES;
|
||||
|
||||
# Locate any new files/dirs
|
||||
if(not opendir(D,$dir)) {
|
||||
warn("Cannot open $dir");
|
||||
@new_in_dir= ();
|
||||
} else {
|
||||
@skip{qw(. .. CVS)}=1..3; # Filenames that that we want to ignore
|
||||
#(note: these are exact filenames)
|
||||
@new_in_dir=
|
||||
(grep { not $seen{$_} } # files we have not already processed
|
||||
map { $dir."/".$_ } # map from file to dir/file
|
||||
grep { not ignore_file($_) } # ignore files in the cvsignore list
|
||||
grep { not $skip{$_} } # skip files to be ignored
|
||||
readdir(D));
|
||||
closedir(D);
|
||||
}
|
||||
|
||||
# Remember new files (actually non-directories)
|
||||
push @{$files{New}}, grep { not -d $_ } @new_in_dir;
|
||||
if ($debug) { print "@{$files{New}} are new in $dir\n"; }
|
||||
|
||||
# Remember new subdirs
|
||||
push @subdirs, grep { -d $_ } @new_in_dir;
|
||||
|
||||
# Recurse all subdirs
|
||||
if (not $local) {
|
||||
for $i (@subdirs) { cvs_changed_in_dir($i); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub print_status()
|
||||
{
|
||||
my $k;
|
||||
my %show_these_states = ("Changed" => 1);
|
||||
if(not $restrict) {
|
||||
$show_these_states{"New"} = 1;
|
||||
$show_these_states{"Deleted"} = 1;
|
||||
}
|
||||
|
||||
if($opt_all) { $show_these_states{"Unchanged"} = 1; }
|
||||
|
||||
if ($tabular) {
|
||||
my %allfiles; # key: filesname, value: state
|
||||
my ($file, $state, $statefiles);
|
||||
|
||||
$show_these_states{"Unknown"} = 1;
|
||||
while (($state, $statefiles) = each %files) {
|
||||
for my $f (@{$statefiles}) {
|
||||
$allfiles{$f} = $state;
|
||||
}
|
||||
}
|
||||
for $file (sort keys %allfiles) {
|
||||
$state = $allfiles{$file};
|
||||
printf("%-10s %s\n", $state, $file) if $show_these_states{$state};
|
||||
}
|
||||
}
|
||||
else {
|
||||
print "\n";
|
||||
for $k (keys %show_these_states) {
|
||||
if(not $files{$k} or not @{$files{$k}}) {
|
||||
# no files
|
||||
$files{$k}=["(none)"];
|
||||
}
|
||||
print("$k files\n",
|
||||
"---------------\n",
|
||||
map { "$_\n" } sort @{$files{$k}});
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
load_initial_cvsignore();
|
||||
if ($debug_cvsignore) {print "initial regex:",$cvsignoreregex,"\n";}
|
||||
cvs_changed_in_dir($startdir);
|
||||
print_status();
|
||||
|
|
@ -1,19 +1,3 @@
|
|||
/* Copyright (C) 2003 MySQL AB
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* -*- c-basic-offset: 4; -*-
|
||||
** $Revision: 1.8 $
|
||||
**
|
||||
|
|
|
@ -1,19 +1,3 @@
|
|||
/* Copyright (C) 2003 MySQL AB
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* -*- c-basic-offset: 4; -*-
|
||||
** $Revision: 1.6 $
|
||||
**
|
||||
|
|
|
@ -1,19 +1,3 @@
|
|||
/* Copyright (C) 2003 MySQL AB
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* $Revision: 1.2 $
|
||||
**
|
||||
** Internal header file for editline library.
|
||||
|
|
|
@ -1,19 +1,3 @@
|
|||
/* Copyright (C) 2003 MySQL AB
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* $Revision: 1.4 $
|
||||
**
|
||||
** Unix system-dependant routines for editline library.
|
||||
|
|
|
@ -1,19 +1,3 @@
|
|||
/* Copyright (C) 2003 MySQL AB
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* $Revision: 1.3 $
|
||||
**
|
||||
** Editline system header file for Unix.
|
||||
|
|
|
@ -1,315 +0,0 @@
|
|||
.\" Copyright (c) 1999 Kungliga Tekniska Högskolan
|
||||
.\" $KTH: getarg.3,v 1.1.4.1 2001/07/26 19:54:45 lha Exp $
|
||||
.Dd September 24, 1999
|
||||
.Dt GETARG 3
|
||||
.Os ROKEN
|
||||
.Sh NAME
|
||||
.Nm getarg ,
|
||||
.Nm arg_printusage
|
||||
.Nd collect command line options
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <getarg.h>
|
||||
|
||||
.Ft int
|
||||
.Fn getarg "struct getargs *args" "size_t num_args" "int argc" "char **argv" "int *optind"
|
||||
|
||||
.Ft void
|
||||
.Fn arg_printusage "struct getargs *args" "size_t num_args" "const char *progname" "const char *extra_string"
|
||||
|
||||
.Sh DESCRIPTION
|
||||
.Fn getarg
|
||||
collects any command line options given to a program in an easily used way.
|
||||
.Fn arg_printusage
|
||||
pretty-prints the available options, with a short help text.
|
||||
.Pp
|
||||
.Fa args
|
||||
is the option specification to use, and it's an array of
|
||||
.Fa struct getargs
|
||||
elements.
|
||||
.Fa num_args
|
||||
is the size of
|
||||
.Fa args
|
||||
(in elements).
|
||||
.Fa argc
|
||||
and
|
||||
.Fa argv
|
||||
are the argument count and argument vector to extract option from.
|
||||
.Fa optind
|
||||
is a pointer to an integer where the index to the last processed
|
||||
argument is stored, it must be initialised to the first index (minus
|
||||
one) to process (normally 0) before the first call.
|
||||
.Pp
|
||||
.Fa arg_printusage
|
||||
take the same
|
||||
.Fa args
|
||||
and
|
||||
.Fa num_args
|
||||
as getarg;
|
||||
.Fa progname is the name of the program (to be used in the help text), and
|
||||
.Fa extra_string
|
||||
is a string to print after the actual options to indicate more
|
||||
arguments. The usefulness of this function is realised only be people
|
||||
who has used programs that has help strings that doesn't match what
|
||||
the code does.
|
||||
.Pp
|
||||
The
|
||||
.Fa getargs
|
||||
struct has the following elements.
|
||||
|
||||
.Bd -literal
|
||||
struct getargs{
|
||||
const char *long_name;
|
||||
char short_name;
|
||||
enum { arg_integer,
|
||||
arg_string,
|
||||
arg_flag,
|
||||
arg_negative_flag,
|
||||
arg_strings,
|
||||
arg_double,
|
||||
arg_collect
|
||||
} type;
|
||||
void *value;
|
||||
const char *help;
|
||||
const char *arg_help;
|
||||
};
|
||||
.Ed
|
||||
.Pp
|
||||
.Fa long_name
|
||||
is the long name of the option, it can be
|
||||
.Dv NULL ,
|
||||
if you don't want a long name.
|
||||
.Fa short_name
|
||||
is the characted to use as short option, it can be zero. If the option
|
||||
has a value the
|
||||
.Fa value
|
||||
field gets filled in with that value interpreted as specified by the
|
||||
.Fa type
|
||||
field.
|
||||
.Fa help
|
||||
is a longer help string for the option as a whole, if it's
|
||||
.Dv NULL
|
||||
the help text for the option is omitted (but it's still displayed in
|
||||
the synopsis).
|
||||
.Fa arg_help
|
||||
is a description of the argument, if
|
||||
.Dv NULL
|
||||
a default value will be used, depending on the type of the option:
|
||||
.Pp
|
||||
.Bl -hang -width arg_negative_flag
|
||||
.It arg_integer
|
||||
the argument is a signed integer, and
|
||||
.Fa value
|
||||
should point to an
|
||||
.Fa int .
|
||||
.It Fa arg_string
|
||||
the argument is a string, and
|
||||
.Fa value
|
||||
should point to a
|
||||
.Fa char* .
|
||||
.It Fa arg_flag
|
||||
the argument is a flag, and
|
||||
.Fa value
|
||||
should point to a
|
||||
.Fa int .
|
||||
It gets filled in with either zero or one, depending on how the option
|
||||
is given, the normal case beeing one. Note that if the option isn't
|
||||
given, the value isn't altered, so it should be initialised to some
|
||||
useful default.
|
||||
.It Fa arg_negative_flag
|
||||
this is the same as
|
||||
.Fa arg_flag
|
||||
but it reverses the meaning of the flag (a given short option clears
|
||||
the flag), and the synopsis of a long option is negated.
|
||||
.It Fa arg_strings
|
||||
the argument can be given multiple times, and the values are collected
|
||||
in an array;
|
||||
.Fa value
|
||||
should be a pointer to a
|
||||
.Fa struct getarg_strings
|
||||
structure, which holds a length and a string pointer.
|
||||
.It Fa arg_double
|
||||
argument is a double precision floating point value, and
|
||||
.Fa value
|
||||
should point to a
|
||||
.Fa double .
|
||||
.It Fa arg_collect
|
||||
allows more fine-grained control of the option parsing process.
|
||||
.Fa value
|
||||
should be a pointer to a
|
||||
.Fa getarg_collect_info
|
||||
structure:
|
||||
.Bd -literal
|
||||
typedef int (*getarg_collect_func)(int short_opt,
|
||||
int argc,
|
||||
char **argv,
|
||||
int *optind,
|
||||
int *optarg,
|
||||
void *data);
|
||||
|
||||
typedef struct getarg_collect_info {
|
||||
getarg_collect_func func;
|
||||
void *data;
|
||||
} getarg_collect_info;
|
||||
.Ed
|
||||
.Pp
|
||||
With the
|
||||
.Fa func
|
||||
member set to a function to call, and
|
||||
.Fa data
|
||||
to some application specific data. The parameters to the collect function are:
|
||||
.Bl -inset
|
||||
.It Fa short_flag
|
||||
non-zero if this call is via a short option flag, zero otherwise
|
||||
.It Fa argc , argv
|
||||
the whole argument list
|
||||
.It Fa optind
|
||||
pointer to the index in argv where the flag is
|
||||
.It Fa optarg
|
||||
pointer to the index in argv[*optind] where the flag name starts
|
||||
.It Fa data
|
||||
application specific data
|
||||
.El
|
||||
.Pp
|
||||
You can modify
|
||||
.Fa *optind ,
|
||||
and
|
||||
.Fa *optarg ,
|
||||
but to do this correct you (more or less) have to know about the inner
|
||||
workings of getarg.
|
||||
|
||||
You can skip parts of arguments by increasing
|
||||
.Fa *optarg
|
||||
(you could
|
||||
implement the
|
||||
.Fl z Ns Ar 3
|
||||
set of flags from
|
||||
.Nm gzip
|
||||
with this), or whole argument strings by increasing
|
||||
.Fa *optind
|
||||
(let's say you want a flag
|
||||
.Fl c Ar x y z
|
||||
to specify a coordinate); if you also have to set
|
||||
.Fa *optarg
|
||||
to a sane value.
|
||||
.Pp
|
||||
The collect function should return one of
|
||||
.Dv ARG_ERR_NO_MATCH , ARG_ERR_BAD_ARG , ARG_ERR_NO_ARG
|
||||
on error, zero otherwise.
|
||||
.Pp
|
||||
For your convenience there is a function,
|
||||
.Fn getarg_optarg ,
|
||||
that returns the traditional argument string, and you pass it all
|
||||
arguments, sans data, that where given to the collection function.
|
||||
.Pp
|
||||
Don't use this more this unless you absolutely have to.
|
||||
.El
|
||||
.Pp
|
||||
Option parsing is similar to what
|
||||
.Xr getopt
|
||||
uses. Short options without arguments can be compressed
|
||||
.Pf ( Fl xyz
|
||||
is the same as
|
||||
.Fl x y z ) ,
|
||||
and short
|
||||
options with arguments take these as either the rest of the
|
||||
argv-string or as the next option
|
||||
.Pf ( Fl o Ns Ar foo ,
|
||||
or
|
||||
.Fl o Ar foo ) .
|
||||
.Pp
|
||||
Long option names are prefixed with -- (double dash), and the value
|
||||
with a = (equal),
|
||||
.Fl -foo= Ns Ar bar .
|
||||
Long option flags can either be specified as they are
|
||||
.Pf ( Fl -help ) ,
|
||||
or with an (boolean parsable) option
|
||||
.Pf ( Fl -help= Ns Ar yes ,
|
||||
.Fl -help= Ns Ar true ,
|
||||
or similar), or they can also be negated
|
||||
.Pf ( Fl -no-help
|
||||
is the same as
|
||||
.Fl -help= Ns no ) ,
|
||||
and if you're really confused you can do it multiple times
|
||||
.Pf ( Fl -no-no-help= Ns Ar false ,
|
||||
or even
|
||||
.Fl -no-no-help= Ns Ar maybe ) .
|
||||
.Sh EXAMPLE
|
||||
.Bd -literal
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <getarg.h>
|
||||
|
||||
char *source = "Ouagadougou";
|
||||
char *destination;
|
||||
int weight;
|
||||
int include_catalog = 1;
|
||||
int help_flag;
|
||||
|
||||
struct getargs args[] = {
|
||||
{ "source", 's', arg_string, &source,
|
||||
"source of shippment", "city" },
|
||||
{ "destination", 'd', arg_string, &destination,
|
||||
"destination of shippment", "city" },
|
||||
{ "weight", 'w', arg_integer, &weight,
|
||||
"weight of shippment", "tons" },
|
||||
{ "catalog", 'c', arg_negative_flag, &include_catalog,
|
||||
"include product catalog" },
|
||||
{ "help", 'h', arg_flag, &help_flag }
|
||||
};
|
||||
|
||||
int num_args = sizeof(args) / sizeof(args[0]); /* number of elements in args */
|
||||
|
||||
const char *progname = "ship++";
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int optind = 0;
|
||||
if (getarg(args, num_args, argc, argv, &optind)) {
|
||||
arg_printusage(args, num_args, progname, "stuff...");
|
||||
exit (1);
|
||||
}
|
||||
if (help_flag) {
|
||||
arg_printusage(args, num_args, progname, "stuff...");
|
||||
exit (0);
|
||||
}
|
||||
if (destination == NULL) {
|
||||
fprintf(stderr, "%s: must specify destination\n", progname);
|
||||
exit(1);
|
||||
}
|
||||
if (strcmp(source, destination) == 0) {
|
||||
fprintf(stderr, "%s: destination must be different from source\n");
|
||||
exit(1);
|
||||
}
|
||||
/* include more stuff here ... */
|
||||
exit(2);
|
||||
}
|
||||
.Ed
|
||||
.Pp
|
||||
The output help output from this program looks like this:
|
||||
.Bd -literal
|
||||
$ ship++ --help
|
||||
Usage: ship++ [--source=city] [-s city] [--destination=city] [-d city]
|
||||
[--weight=tons] [-w tons] [--no-catalog] [-c] [--help] [-h] stuff...
|
||||
-s city, --source=city source of shippment
|
||||
-d city, --destination=city destination of shippment
|
||||
-w tons, --weight=tons weight of shippment
|
||||
-c, --no-catalog include product catalog
|
||||
.Ed
|
||||
|
||||
.Sh BUGS
|
||||
It should be more flexible, so it would be possible to use other more
|
||||
complicated option syntaxes, such as what
|
||||
.Xr ps 1 ,
|
||||
and
|
||||
.Xr tar 1 ,
|
||||
uses, or the AFS model where you can skip the flag names as long as
|
||||
the options come in the correct order.
|
||||
.Pp
|
||||
Options with multiple arguments should be handled better.
|
||||
.Pp
|
||||
Should be integreated with SL.
|
||||
.Pp
|
||||
It's very confusing that the struct you pass in is called getargS.
|
||||
.Sh SEE ALSO
|
||||
.Xr getopt 3
|
|
@ -1,458 +0,0 @@
|
|||
%!PS-Adobe-3.0
|
||||
%%Creator: groff version 1.15
|
||||
%%CreationDate: Thu Nov 7 12:53:13 2002
|
||||
%%DocumentNeededResources: font Times-Roman
|
||||
%%+ font Times-Bold
|
||||
%%+ font Courier-Bold
|
||||
%%+ font Courier-Oblique
|
||||
%%+ font Symbol
|
||||
%%+ font Courier
|
||||
%%DocumentSuppliedResources: procset grops 1.15 0
|
||||
%%Pages: 4
|
||||
%%PageOrder: Ascend
|
||||
%%Orientation: Portrait
|
||||
%%EndComments
|
||||
%%BeginProlog
|
||||
%%BeginResource: procset grops 1.15 0
|
||||
/setpacking where{
|
||||
pop
|
||||
currentpacking
|
||||
true setpacking
|
||||
}if
|
||||
/grops 120 dict dup begin
|
||||
/SC 32 def
|
||||
/A/show load def
|
||||
/B{0 SC 3 -1 roll widthshow}bind def
|
||||
/C{0 exch ashow}bind def
|
||||
/D{0 exch 0 SC 5 2 roll awidthshow}bind def
|
||||
/E{0 rmoveto show}bind def
|
||||
/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
|
||||
/G{0 rmoveto 0 exch ashow}bind def
|
||||
/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
|
||||
/I{0 exch rmoveto show}bind def
|
||||
/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
|
||||
/K{0 exch rmoveto 0 exch ashow}bind def
|
||||
/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
|
||||
/M{rmoveto show}bind def
|
||||
/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
|
||||
/O{rmoveto 0 exch ashow}bind def
|
||||
/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
|
||||
/Q{moveto show}bind def
|
||||
/R{moveto 0 SC 3 -1 roll widthshow}bind def
|
||||
/S{moveto 0 exch ashow}bind def
|
||||
/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
|
||||
/SF{
|
||||
findfont exch
|
||||
[exch dup 0 exch 0 exch neg 0 0]makefont
|
||||
dup setfont
|
||||
[exch/setfont cvx]cvx bind def
|
||||
}bind def
|
||||
/MF{
|
||||
findfont
|
||||
[5 2 roll
|
||||
0 3 1 roll
|
||||
neg 0 0]makefont
|
||||
dup setfont
|
||||
[exch/setfont cvx]cvx bind def
|
||||
}bind def
|
||||
/level0 0 def
|
||||
/RES 0 def
|
||||
/PL 0 def
|
||||
/LS 0 def
|
||||
/MANUAL{
|
||||
statusdict begin/manualfeed true store end
|
||||
}bind def
|
||||
/PLG{
|
||||
gsave newpath clippath pathbbox grestore
|
||||
exch pop add exch pop
|
||||
}bind def
|
||||
/BP{
|
||||
/level0 save def
|
||||
1 setlinecap
|
||||
1 setlinejoin
|
||||
72 RES div dup scale
|
||||
LS{
|
||||
90 rotate
|
||||
}{
|
||||
0 PL translate
|
||||
}ifelse
|
||||
1 -1 scale
|
||||
}bind def
|
||||
/EP{
|
||||
level0 restore
|
||||
showpage
|
||||
}bind def
|
||||
/DA{
|
||||
newpath arcn stroke
|
||||
}bind def
|
||||
/SN{
|
||||
transform
|
||||
.25 sub exch .25 sub exch
|
||||
round .25 add exch round .25 add exch
|
||||
itransform
|
||||
}bind def
|
||||
/DL{
|
||||
SN
|
||||
moveto
|
||||
SN
|
||||
lineto stroke
|
||||
}bind def
|
||||
/DC{
|
||||
newpath 0 360 arc closepath
|
||||
}bind def
|
||||
/TM matrix def
|
||||
/DE{
|
||||
TM currentmatrix pop
|
||||
translate scale newpath 0 0 .5 0 360 arc closepath
|
||||
TM setmatrix
|
||||
}bind def
|
||||
/RC/rcurveto load def
|
||||
/RL/rlineto load def
|
||||
/ST/stroke load def
|
||||
/MT/moveto load def
|
||||
/CL/closepath load def
|
||||
/FL{
|
||||
currentgray exch setgray fill setgray
|
||||
}bind def
|
||||
/BL/fill load def
|
||||
/LW/setlinewidth load def
|
||||
/RE{
|
||||
findfont
|
||||
dup maxlength 1 index/FontName known not{1 add}if dict begin
|
||||
{
|
||||
1 index/FID ne{def}{pop pop}ifelse
|
||||
}forall
|
||||
/Encoding exch def
|
||||
dup/FontName exch def
|
||||
currentdict end definefont pop
|
||||
}bind def
|
||||
/DEFS 0 def
|
||||
/EBEGIN{
|
||||
moveto
|
||||
DEFS begin
|
||||
}bind def
|
||||
/EEND/end load def
|
||||
/CNT 0 def
|
||||
/level1 0 def
|
||||
/PBEGIN{
|
||||
/level1 save def
|
||||
translate
|
||||
div 3 1 roll div exch scale
|
||||
neg exch neg exch translate
|
||||
0 setgray
|
||||
0 setlinecap
|
||||
1 setlinewidth
|
||||
0 setlinejoin
|
||||
10 setmiterlimit
|
||||
[]0 setdash
|
||||
/setstrokeadjust where{
|
||||
pop
|
||||
false setstrokeadjust
|
||||
}if
|
||||
/setoverprint where{
|
||||
pop
|
||||
false setoverprint
|
||||
}if
|
||||
newpath
|
||||
/CNT countdictstack def
|
||||
userdict begin
|
||||
/showpage{}def
|
||||
}bind def
|
||||
/PEND{
|
||||
clear
|
||||
countdictstack CNT sub{end}repeat
|
||||
level1 restore
|
||||
}bind def
|
||||
end def
|
||||
/setpacking where{
|
||||
pop
|
||||
setpacking
|
||||
}if
|
||||
%%EndResource
|
||||
%%IncludeResource: font Times-Roman
|
||||
%%IncludeResource: font Times-Bold
|
||||
%%IncludeResource: font Courier-Bold
|
||||
%%IncludeResource: font Courier-Oblique
|
||||
%%IncludeResource: font Symbol
|
||||
%%IncludeResource: font Courier
|
||||
grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
|
||||
def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
|
||||
/scaron/zcaron/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef
|
||||
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
|
||||
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
|
||||
/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
|
||||
/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
|
||||
/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
|
||||
/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
|
||||
/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
|
||||
/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
|
||||
/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
|
||||
/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
|
||||
/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
|
||||
/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
|
||||
/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
|
||||
/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
|
||||
/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
|
||||
/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
|
||||
/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
|
||||
/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
|
||||
/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
|
||||
/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
|
||||
/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
|
||||
/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
|
||||
/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
|
||||
/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
|
||||
/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
|
||||
/Courier@0 ENC0/Courier RE/Courier-Oblique@0 ENC0/Courier-Oblique RE
|
||||
/Courier-Bold@0 ENC0/Courier-Bold RE/Times-Bold@0 ENC0/Times-Bold RE
|
||||
/Times-Roman@0 ENC0/Times-Roman RE
|
||||
%%EndProlog
|
||||
%%Page: 1 1
|
||||
%%BeginPageSetup
|
||||
BP
|
||||
%%EndPageSetup
|
||||
/F0 10/Times-Roman@0 SF(GET)72 48 Q -.834(ARG \( 3 \))-.93 F
|
||||
(OpenBSD Programmer')111.062 E 2.5(sM)-.55 G 108.562(anual GET)-2.5 F
|
||||
-.834(ARG \( 3 \))-.93 F/F1 10/Times-Bold@0 SF -.2(NA)72 108 S(ME).2 E
|
||||
/F2 10/Courier-Bold@0 SF(getarg)102 120 Q F0(,)A F2(arg_printusage)2.5 E
|
||||
F0 2.5<ad63>2.5 G(ollect command line options)-2.5 E F1(SYNOPSIS)72 144
|
||||
Q F2(#include <getarg.h>)102 156 Q/F3 10/Courier-Oblique@0 SF(int)102
|
||||
186 Q F2(getarg)102 198 Q F0(\()A F3(struct getargs)A/F4 10/Symbol SF(*)
|
||||
6 E F3(args)A F0(,)1.666 E F3(size_t num_args)4.166 E F0(,)1.666 E F3
|
||||
(int argc)4.166 E F0(,)1.666 E F3(char)4.166 E F4(**)6 E F3(argv)A F0(,)
|
||||
1.666 E F3(int)151.666 210 Q F4(*)6 E F3(optind)A F0(\);)A F3(void)102
|
||||
240 Q F2(arg_printusage)102 252 Q F0(\()A F3(struct getargs)A F4(*)6 E
|
||||
F3(args)A F0(,)1.666 E F3(size_t num_args)4.166 E F0(,)1.666 E F3
|
||||
(const char)4.166 E F4(*)6 E F3(progname)A F0(,)1.666 E F3(const char)
|
||||
151.666 264 Q F4(*)6 E F3(extra_string)A F0(\);)A F1(DESCRIPTION)72 300
|
||||
Q F2(getarg)102 312 Q F0 2.721 1.666(\(\) c)D 6.053(ollects an)-1.666 F
|
||||
8.553(yc)-.15 G 6.053(ommand line options gi)-8.553 F -.15(ve)-.25 G
|
||||
8.552(nt).15 G 8.552(oap)-8.552 G 6.052(rogram in an easily used w)
|
||||
-8.552 F(ay)-.1 E(.)-.65 E F2(arg_printusage)102 324 Q F0 -3.332 1.666
|
||||
(\(\) p)D(retty-prints the a)-1.666 E -.25(va)-.2 G
|
||||
(ilable options, with a short help te).25 E(xt.)-.15 E F3(args)102 342 Q
|
||||
F0 .855(is the option speci\214cation to use, and it')3.355 F 3.356(sa)
|
||||
-.55 G 3.356(na)-3.356 G .856(rray of)-3.356 F F3 .856(struct getargs)
|
||||
3.356 F F0(elements.)3.356 E F3(num_args)5.856 E F0(is)3.356 E .344
|
||||
(the size of)102 354 R F3(args)2.844 E F0 .344(\(in elements\).)2.844 F
|
||||
F3(argc)5.344 E F0(and)2.844 E F3(argv)2.844 E F0 .344(are the ar)2.844
|
||||
F .344(gument count and ar)-.18 F .344(gument v)-.18 F .344(ector to e)
|
||||
-.15 F .343(xtract op-)-.15 F 1.127(tion from.)102 366 R F3(optind)6.127
|
||||
E F0 1.127(is a pointer to an inte)3.627 F 1.127(ger where the inde)-.15
|
||||
F 3.627(xt)-.15 G 3.628(ot)-3.627 G 1.128(he last processed ar)-3.628 F
|
||||
1.128(gument is stored, it)-.18 F
|
||||
(must be initialised to the \214rst inde)102 378 Q 2.5(x\()-.15 G
|
||||
(minus one\) to process \(normally 0\) before the \214rst call.)-2.5 E
|
||||
F3(arg_printusage)102 396 Q F0(tak)4.178 E 4.178(et)-.1 G 1.678(he same)
|
||||
-4.178 F F3(args)4.178 E F0(and)4.178 E F3(num_args)4.178 E F0 1.678
|
||||
(as getar)4.178 F(g;)-.18 E F3 1.677(progname is the name of)4.178 F
|
||||
6.381(the program \(to be)102 408 R F0(progname0)12.381 E F3(0)12.381 E
|
||||
F0(progname1)A F3(1)12.381 E F0(progname2)A F3(2)12.382 E F0(progname3)A
|
||||
F3(3)12.382 E F0(progname4)A F3(4)102 420 Q F0(progname5)A F3
|
||||
(extra_string)3.404 E F0 .904
|
||||
(is a string to print after the actual options to indicate more ar)3.404
|
||||
F .904(guments. The)-.18 F .025(usefulness of this function is realised\
|
||||
only be people who has used programs that has help strings that doesn')
|
||||
102 432 R(t)-.18 E(match what the code does.)102 444 Q(The)102 462 Q F3
|
||||
(getargs)2.5 E F0(struct has the follo)2.5 E(wing elements.)-.25 E/F5 10
|
||||
/Courier@0 SF(struct getargs{)102 504 Q(const char)126 516 Q F4(*)6 E F5
|
||||
(long_name;)A(char short_name;)126 528 Q(enum { arg_integer,)126 540 Q
|
||||
(arg_string,)165 552 Q(arg_flag,)165 564 Q(arg_negative_flag,)165 576 Q
|
||||
(arg_strings,)165 588 Q(arg_double,)165 600 Q(arg_collect)168 612 Q 6
|
||||
(}t)126 624 S(ype;)-6 E(void)126 636 Q F4(*)6 E F5(value;)A(const char)
|
||||
126 648 Q F4(*)6 E F5(help;)A(const char)126 660 Q F4(*)6 E F5
|
||||
(arg_help;)A(};)102 672 Q F3(long_name)102 690 Q F0 .207
|
||||
(is the long name of the option, it can be)2.707 F F5(NULL)2.706 E F0
|
||||
2.706(,i)C 2.706(fy)-2.706 G .206(ou don')-2.706 F 2.706(tw)-.18 G .206
|
||||
(ant a long name.)-2.806 F F3(short_name)5.206 E F0 .397(is the charact\
|
||||
ed to use as short option, it can be zero. If the option has a v)102 702
|
||||
R .398(alue the)-.25 F F3(value)2.898 E F0 .398
|
||||
(\214eld gets \214lled in)2.898 F -.4(RO)77 750 S 152.325(KEN September)
|
||||
.4 F(24, 1999)2.5 E(1)188.865 E EP
|
||||
%%Page: 2 2
|
||||
%%BeginPageSetup
|
||||
BP
|
||||
%%EndPageSetup
|
||||
/F0 10/Times-Roman@0 SF(GET)72 48 Q -.834(ARG \( 3 \))-.93 F
|
||||
(OpenBSD Programmer')111.062 E 2.5(sM)-.55 G 108.562(anual GET)-2.5 F
|
||||
-.834(ARG \( 3 \))-.93 F .737(with that v)102 96 R .737
|
||||
(alue interpreted as speci\214ed by the)-.25 F/F1 10/Courier-Oblique@0
|
||||
SF(type)3.237 E F0(\214eld.)3.237 E F1(help)5.737 E F0 .737
|
||||
(is a longer help string for the option as a)3.237 F 2.833
|
||||
(whole, if it')102 108 R(s)-.55 E/F2 10/Courier@0 SF(NULL)5.333 E F0
|
||||
2.833(the help te)5.333 F 2.833(xt for the option is omitted \(b)-.15 F
|
||||
2.834(ut it')-.2 F 5.334(ss)-.55 G 2.834
|
||||
(till displayed in the synopsis\).)-5.334 F F1(arg_help)102 120 Q F0
|
||||
.391(is a description of the ar)2.891 F .391(gument, if)-.18 F F2(NULL)
|
||||
2.891 E F0 2.891(ad)2.891 G(ef)-2.891 E .39(ault v)-.1 F .39
|
||||
(alue will be used, depending on the type of)-.25 F(the option:)102 132
|
||||
Q(ar)102 150 Q(g_inte)-.18 E 59.29(ger the)-.15 F(ar)2.5 E
|
||||
(gument is a signed inte)-.18 E(ger)-.15 E 2.5(,a)-.4 G(nd)-2.5 E F1
|
||||
(value)2.5 E F0(should point to an)2.5 E F1(int)2.5 E F0(.)A F1
|
||||
(arg_string)102 168 Q F0(the ar)47 E(gument is a string, and)-.18 E F1
|
||||
(value)2.5 E F0(should point to a)2.5 E F1(char)2.5 E/F3 10/Symbol SF(*)
|
||||
A F0(.)A F1(arg_flag)102 186 Q F0 .4(the ar)59 F .4
|
||||
(gument is a \215ag, and)-.18 F F1(value)2.9 E F0 .4(should point to a)
|
||||
2.9 F F1(int)2.9 E F0 2.9(.I)C 2.9(tg)-2.9 G .4
|
||||
(ets \214lled in with ei-)-2.9 F 1.154
|
||||
(ther zero or one, depending on ho)209 198 R 3.654(wt)-.25 G 1.153
|
||||
(he option is gi)-3.654 F -.15(ve)-.25 G 1.153
|
||||
(n, the normal case beeing).15 F .526(one. Note that if the option isn')
|
||||
209 210 R 3.026(tg)-.18 G -2.15 -.25(iv e)-3.026 H .526(n, the v).25 F
|
||||
.526(alue isn')-.25 F 3.026(ta)-.18 G .527(ltered, so it should be ini-)
|
||||
-3.026 F(tialised to some useful def)209 222 Q(ault.)-.1 E F1
|
||||
(arg_negative_flag)102 240 Q F0 .058(this is the same as)2.558 F F1
|
||||
(arg_flag)2.558 E F0 -.2(bu)2.558 G 2.558(ti).2 G 2.558(tr)-2.558 G
|
||||
-2.15 -.25(ev e)-2.558 H .057(rses the meaning of the \215ag \(a gi).25
|
||||
F -.15(ve)-.25 G 2.557(ns).15 G(hort)-2.557 E
|
||||
(option clears the \215ag\), and the synopsis of a long option is ne)209
|
||||
252 Q -.05(ga)-.15 G(ted.).05 E F1(arg_strings)102 270 Q F0 .195(the ar)
|
||||
41 F .195(gument can be gi)-.18 F -.15(ve)-.25 G 2.695(nm).15 G .195
|
||||
(ultiple times, and the v)-2.695 F .195
|
||||
(alues are collected in an array;)-.25 F F1(value)209 282 Q F0 .947
|
||||
(should be a pointer to a)3.447 F F1 .947(struct getarg_strings)3.447 F
|
||||
F0 .947(structure, which)3.447 F(holds a length and a string pointer)209
|
||||
294 Q(.)-.55 E F1(arg_double)102 312 Q F0(ar)47 E .538
|
||||
(gument is a double precision \215oating point v)-.18 F .539(alue, and)
|
||||
-.25 F F1(value)3.039 E F0 .539(should point to a)3.039 F F1(double)209
|
||||
324 Q F0(.)A F1(arg_collect)102 342 Q F0(allo)41 E .345
|
||||
(ws more \214ne-grained control of the option parsing process.)-.25 F F1
|
||||
(value)5.344 E F0 .344(should be)2.844 F 2.5(ap)209 354 S(ointer to a)
|
||||
-2.5 E F1(getarg_collect_info)2.5 E F0(structure:)2.5 E F2
|
||||
(typedef int \()209 372 Q F3(*)A F2
|
||||
(getarg_collect_func\)\(int short_opt,)A(int argc,)407 384 Q(char)407
|
||||
396 Q F3(**)6 E F2(argv,)A(int)407 408 Q F3(*)6 E F2(optind,)A(int)407
|
||||
420 Q F3(*)6 E F2(optarg,)A(void)407 432 Q F3(*)6 E F2(data\);)A
|
||||
(typedef struct getarg_collect_info {)209 456 Q
|
||||
(getarg_collect_func func;)233 468 Q(void)233 480 Q F3(*)6 E F2(data;)A
|
||||
6(}g)209 492 S(etarg_collect_info;)-6 E F0 -.4(Wi)209 510 S 1.018
|
||||
(th the).4 F F1(func)3.518 E F0 1.019
|
||||
(member set to a function to call, and)3.518 F F1(data)3.519 E F0 1.019
|
||||
(to some application)3.519 F
|
||||
(speci\214c data. The parameters to the collect function are:)209 522 Q
|
||||
F1(short_flag)209 540 Q F0
|
||||
(non-zero if this call is via a short option \215ag, zero otherwise)2.5
|
||||
E F1(argc)209 558 Q F0(,)A F1(argv)6 E F0(the whole ar)2.5 E
|
||||
(gument list)-.18 E F1(optind)209 576 Q F0(pointer to the inde)2.5 E 2.5
|
||||
(xi)-.15 G 2.5(na)-2.5 G -.18(rg)-2.5 G 2.5(vw).18 G(here the \215ag is)
|
||||
-2.5 E F1(optarg)209 594 Q F0(pointer to the inde)2.5 E 2.5(xi)-.15 G
|
||||
2.5(na)-2.5 G -.18(rg)-2.5 G(v[).18 E F3(*)A F0
|
||||
(optind] where the \215ag name starts)A F1(data)209 612 Q F0
|
||||
(application speci\214c data)2.5 E -1.1(Yo)209 630 S 3.915(uc)1.1 G
|
||||
1.415(an modify)-3.915 F F3(*)3.915 E F1(optind)A F0 3.915(,a)C(nd)
|
||||
-3.915 E F3(*)3.915 E F1(optarg)A F0 3.915(,b)C 1.414
|
||||
(ut to do this correct you \(more or)-4.115 F(less\) ha)209 642 Q .3
|
||||
-.15(ve t)-.2 H 2.5(ok).15 G(no)-2.5 E 2.5(wa)-.25 G(bout the inner w)
|
||||
-2.5 E(orkings of getar)-.1 E(g.)-.18 E -1.1(Yo)209 666 S 3.604(uc)1.1 G
|
||||
1.104(an skip parts of ar)-3.604 F 1.105(guments by increasing)-.18 F F3
|
||||
(*)3.605 E F1(optarg)A F0 1.105(\(you could implement)3.605 F(the)209
|
||||
678 Q/F4 10/Courier-Bold@0 SF<ad7a>4.567 E F1(3)A F0 .401
|
||||
(set of \215ags from)2.901 F F4(gzip)2.9 E F0 .4
|
||||
(with this\), or whole ar)2.9 F .4(gument strings by increas-)-.18 F
|
||||
(ing)209 690 Q F3(*)3.275 E F1(optind)A F0(\(let')3.275 E 3.276(ss)-.55
|
||||
G .776(ay you w)-3.276 F .776(ant a \215ag)-.1 F F4<ad63>4.942 E F1
|
||||
6.776(xyz)6.776 G F0 .776(to specify a coordinate\); if)-3.5 F
|
||||
(you also ha)209 702 Q .3 -.15(ve t)-.2 H 2.5(os).15 G(et)-2.5 E F3(*)
|
||||
2.5 E F1(optarg)A F0(to a sane v)2.5 E(alue.)-.25 E -.4(RO)77 750 S
|
||||
152.325(KEN September).4 F(24, 1999)2.5 E(2)188.865 E EP
|
||||
%%Page: 3 3
|
||||
%%BeginPageSetup
|
||||
BP
|
||||
%%EndPageSetup
|
||||
/F0 10/Times-Roman@0 SF(GET)72 48 Q -.834(ARG \( 3 \))-.93 F
|
||||
(OpenBSD Programmer')111.062 E 2.5(sM)-.55 G 108.562(anual GET)-2.5 F
|
||||
-.834(ARG \( 3 \))-.93 F 9.449
|
||||
(The collect function should return one of)209 96 R/F1 10/Courier@0 SF
|
||||
(ARG_ERR_NO_MATCH)11.948 E F0(,)A F1(ARG_ERR_BAD_ARG)209 108 Q F0(,)A F1
|
||||
(ARG_ERR_NO_ARG)6 E F0(on error)2.5 E 2.5(,z)-.4 G(ero otherwise.)-2.5 E
|
||||
-.15(Fo)209 126 S 4.042(ry).15 G 1.542(our con)-4.042 F -.15(ve)-.4 G
|
||||
1.542(nience there is a function,).15 F/F2 10/Courier-Bold@0 SF
|
||||
(getarg_optarg)4.042 E F0 1.542(\(\), that returns the)B 1.251
|
||||
(traditional ar)209 138 R 1.251(gument string, and you pass it all ar)
|
||||
-.18 F 1.251(guments, sans data, that where)-.18 F(gi)209 150 Q -.15(ve)
|
||||
-.25 G 2.5(nt).15 G 2.5(ot)-2.5 G(he collection function.)-2.5 E(Don')
|
||||
209 168 Q 2.5(tu)-.18 G(se this more this unless you absolutely ha)-2.5
|
||||
E .3 -.15(ve t)-.2 H(o.).15 E .213(Option parsing is similar to what)102
|
||||
186 R F1(getopt)2.713 E F0 .214(uses. Short options without ar)2.714 F
|
||||
.214(guments can be compressed \()-.18 F F2(\255xyz)1.666 E F0 .207
|
||||
(is the same as)102 198 R F2 1.873<ad7820ad7920ad7a>4.373 F F0 .207
|
||||
(\), and short options with ar)B .207(guments tak)-.18 F 2.706(et)-.1 G
|
||||
.206(hese as either the rest of the ar)-2.706 F(gv-string)-.18 E
|
||||
(or as the ne)102 210 Q(xt option \()-.15 E F2<ad6f>1.666 E/F3 10
|
||||
/Courier-Oblique@0 SF(foo)A F0 2.5(,o)C(r)-2.5 E F2<ad6f>4.166 E F3(foo)
|
||||
6 E F0(\).)A .78(Long option names are pre\214x)102 228 R .781
|
||||
(ed with -- \(double dash\), and the v)-.15 F .781
|
||||
(alue with a = \(equal\),)-.25 F F2(\255-foo=)4.947 E F3(bar)A F0 3.281
|
||||
(.L)C(ong)-3.281 E 3.815
|
||||
(option \215ags can either be speci\214ed as the)102 240 R 6.315(ya)-.15
|
||||
G 3.815(re \()-6.315 F F2(\255-help)1.666 E F0 3.815
|
||||
(\), or with an \(boolean parsable\) option)B(\()102 252 Q F2
|
||||
(\255-help=)1.666 E F3(yes)A F0(,)A F2(\255-help=)5.659 E F3(true)A F0
|
||||
3.993(,o)C 3.993(rs)-3.993 G 1.493(imilar\), or the)-3.993 F 3.993(yc)
|
||||
-.15 G 1.493(an also be ne)-3.993 F -.05(ga)-.15 G 1.493(ted \().05 F F2
|
||||
(\255-no-help)1.666 E F0 1.493(is the same as)3.993 F F2(\255-help=)
|
||||
103.666 264 Q F0 1.363(no\), and if you')B 1.362
|
||||
(re really confused you can do it multiple times \()-.5 F F2
|
||||
(\255-no-no-help=)1.666 E F3(false)A F0 3.862(,o)C(r)-3.862 E -2.15 -.25
|
||||
(ev e)102 276 T(n).25 E F2(\255-no-no-help=)4.166 E F3(maybe)A F0(\).)A
|
||||
/F4 10/Times-Bold@0 SF(EXAMPLE)72 300 Q F1(#include <stdio.h>)102 330 Q
|
||||
(#include <string.h>)102 342 Q(#include <getarg.h>)102 354 Q(char)102
|
||||
378 Q/F5 10/Symbol SF(*)6 E F1(source = "Ouagadougou";)A(char)102 390 Q
|
||||
F5(*)6 E F1(destination;)A(int weight;)102 402 Q
|
||||
(int include_catalog = 1;)102 414 Q(int help_flag;)102 426 Q
|
||||
(struct getargs args[] = {)102 450 Q 6({")126 462 S 30(source", 's',)-6
|
||||
F 6(arg_string, &source,)6 F("source of shippment", "city" },)138 474 Q
|
||||
6({")126 486 S(destination", 'd', arg_string,)-6 E(&destination,)12 E
|
||||
("destination of shippment", "city" },)138 498 Q 6({")126 510 S 30
|
||||
(weight", 'w',)-6 F(arg_integer, &weight,)6 E
|
||||
("weight of shippment", "tons" },)138 522 Q 6({")126 534 S 24
|
||||
(catalog", 'c',)-6 F(arg_negative_flag, &include_catalog,)6 E
|
||||
("include product catalog" },)138 546 Q 6({")126 558 S 42(help", 'h',)-6
|
||||
F(arg_flag, &help_flag })6 E(};)102 570 Q
|
||||
(int num_args = sizeof\(args\) / sizeof\(args[0]\); /)102 594 Q F5(*)A
|
||||
F1(number of elements in args)6 E F5(*)6 E F1(/)A(const char)102 618 Q
|
||||
F5(*)6 E F1(progname = "ship++";)A(int)102 642 Q(main\(int argc, char)
|
||||
102 654 Q F5(**)6 E F1(argv\))A({)102 666 Q(int optind = 0;)126 678 Q
|
||||
(if \(getarg\(args, num_args, argc, argv, &optind\)\) {)126 690 Q
|
||||
(arg_printusage\(args, num_args, progname, "stuff..."\);)147 702 Q F0
|
||||
-.4(RO)77 750 S 152.325(KEN September).4 F(24, 1999)2.5 E(3)188.865 E EP
|
||||
%%Page: 4 4
|
||||
%%BeginPageSetup
|
||||
BP
|
||||
%%EndPageSetup
|
||||
/F0 10/Times-Roman@0 SF(GET)72 48 Q -.834(ARG \( 3 \))-.93 F
|
||||
(OpenBSD Programmer')111.062 E 2.5(sM)-.55 G 108.562(anual GET)-2.5 F
|
||||
-.834(ARG \( 3 \))-.93 F/F1 10/Courier@0 SF(exit \(1\);)147 96 Q(})126
|
||||
108 Q(if \(help_flag\) {)126 120 Q
|
||||
(arg_printusage\(args, num_args, progname, "stuff..."\);)147 132 Q
|
||||
(exit \(0\);)147 144 Q(})126 156 Q(if \(destination == NULL\) {)126 168
|
||||
Q(fprintf\(stderr, "%s: must specify destination0, progname\);)147 180 Q
|
||||
(exit\(1\);)147 192 Q(})126 204 Q
|
||||
(if \(strcmp\(source, destination\) == 0\) {)126 216 Q
|
||||
(fprintf\(stderr, "%s: destination must be different from source0\);)147
|
||||
228 Q(exit\(1\);)147 240 Q(})126 252 Q(/)126 264 Q/F2 10/Symbol SF(*)A
|
||||
F1(include more stuff here ...)6 E F2(*)6 E F1(/)A(exit\(2\);)126 276 Q
|
||||
(})102 288 Q F0(The output help output from this program looks lik)102
|
||||
306 Q 2.5(et)-.1 G(his:)-2.5 E F1 6($s)102 324 S(hip++ --help)-6 E
|
||||
(Usage: ship++ [--source=city] [-s city] [--destination=city] [-d city])
|
||||
102 336 Q
|
||||
([--weight=tons] [-w tons] [--no-catalog] [-c] [--help] [-h] stuff...)
|
||||
120 348 Q(-s city, --source=city)102 360 Q(source of shippment)36 E
|
||||
(-d city, --destination=city destination of shippment)102 372 Q
|
||||
(-w tons, --weight=tons)102 384 Q(weight of shippment)36 E
|
||||
(-c, --no-catalog)102 396 Q(include product catalog)72 E/F3 10
|
||||
/Times-Bold@0 SF -.1(BU)72 432 S(GS).1 E F0 .9(It should be more \215e)
|
||||
102 444 R .9(xible, so it w)-.15 F .901
|
||||
(ould be possible to use other more complicated option syntax)-.1 F .901
|
||||
(es, such as)-.15 F(what)102 456 Q F1(ps)3.167 E F0 .667(\(1\), and)B F1
|
||||
(tar)3.167 E F0 .666(\(1\), uses, or the AFS model where you can skip t\
|
||||
he \215ag names as long as the options)B(come in the correct order)102
|
||||
468 Q(.)-.55 E(Options with multiple ar)102 486 Q
|
||||
(guments should be handled better)-.18 E(.)-.55 E(Should be inte)102 504
|
||||
Q(greated with SL.)-.15 E(It')102 522 Q 2.5(sv)-.55 G
|
||||
(ery confusing that the struct you pass in is called getar)-2.65 E(gS.)
|
||||
-.18 E F3 1.666(SEE ALSO)72 546 R F1(getopt)102 558 Q F0(\(3\))A -.4(RO)
|
||||
77 750 S 152.325(KEN September).4 F(24, 1999)2.5 E(4)188.865 E EP
|
||||
%%Trailer
|
||||
end
|
||||
%%EOF
|
File diff suppressed because it is too large
Load diff
|
@ -1,58 +0,0 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly: AssemblyTitle("")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
//
|
||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||
// Microsoft .NET Framework documentation for more information on assembly signing.
|
||||
//
|
||||
// Use the attributes below to control which key is used for signing.
|
||||
//
|
||||
// Notes:
|
||||
// (*) If no key is specified, the assembly is not signed.
|
||||
// (*) KeyName refers to a key that has been installed in the Crypto Service
|
||||
// Provider (CSP) on your machine. KeyFile refers to a file which contains
|
||||
// a key.
|
||||
// (*) If the KeyFile and the KeyName values are both specified, the
|
||||
// following processing occurs:
|
||||
// (1) If the KeyName can be found in the CSP, that key is used.
|
||||
// (2) If the KeyName does not exist and the KeyFile does exist, the key
|
||||
// in the KeyFile is installed into the CSP and used.
|
||||
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
|
||||
// When specifying the KeyFile, the location of the KeyFile should be
|
||||
// relative to the project output directory which is
|
||||
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
|
||||
// located in the project directory, you would specify the AssemblyKeyFile
|
||||
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
|
||||
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
|
||||
// documentation for more information on this.
|
||||
//
|
||||
[assembly: AssemblyDelaySign(false)]
|
||||
[assembly: AssemblyKeyFile("")]
|
||||
[assembly: AssemblyKeyName("")]
|
|
@ -1,159 +0,0 @@
|
|||
VERSION 5.00
|
||||
Begin VB.Form frmSplash
|
||||
BorderStyle = 3 'Fixed Dialog
|
||||
ClientHeight = 4710
|
||||
ClientLeft = 45
|
||||
ClientTop = 45
|
||||
ClientWidth = 7455
|
||||
ControlBox = 0 'False
|
||||
LinkTopic = "Form1"
|
||||
MaxButton = 0 'False
|
||||
MinButton = 0 'False
|
||||
ScaleHeight = 4710
|
||||
ScaleWidth = 7455
|
||||
ShowInTaskbar = 0 'False
|
||||
StartUpPosition = 2 'CenterScreen
|
||||
Visible = 0 'False
|
||||
Begin VB.Frame fraMainFrame
|
||||
Height = 4590
|
||||
Left = 45
|
||||
TabIndex = 0
|
||||
Top = -15
|
||||
Width = 7380
|
||||
Begin VB.PictureBox picLogo
|
||||
Height = 2385
|
||||
Left = 510
|
||||
Picture = "frmSplash.frx":0000
|
||||
ScaleHeight = 2325
|
||||
ScaleWidth = 1755
|
||||
TabIndex = 2
|
||||
Top = 855
|
||||
Width = 1815
|
||||
End
|
||||
Begin VB.Label lblLicenseTo
|
||||
Alignment = 1 'Right Justify
|
||||
Caption = "LicenseTo"
|
||||
Height = 255
|
||||
Left = 270
|
||||
TabIndex = 1
|
||||
Tag = "LicenseTo"
|
||||
Top = 300
|
||||
Width = 6855
|
||||
End
|
||||
Begin VB.Label lblProductName
|
||||
AutoSize = -1 'True
|
||||
Caption = "Product"
|
||||
BeginProperty Font
|
||||
Name = "MS Sans Serif"
|
||||
Size = 29.25
|
||||
Charset = 0
|
||||
Weight = 700
|
||||
Underline = 0 'False
|
||||
Italic = 0 'False
|
||||
Strikethrough = 0 'False
|
||||
EndProperty
|
||||
Height = 720
|
||||
Left = 2670
|
||||
TabIndex = 9
|
||||
Tag = "Product"
|
||||
Top = 1200
|
||||
Width = 2190
|
||||
End
|
||||
Begin VB.Label lblCompanyProduct
|
||||
AutoSize = -1 'True
|
||||
Caption = "CompanyProduct"
|
||||
BeginProperty Font
|
||||
Name = "MS Sans Serif"
|
||||
Size = 18
|
||||
Charset = 0
|
||||
Weight = 700
|
||||
Underline = 0 'False
|
||||
Italic = 0 'False
|
||||
Strikethrough = 0 'False
|
||||
EndProperty
|
||||
Height = 435
|
||||
Left = 2505
|
||||
TabIndex = 8
|
||||
Tag = "CompanyProduct"
|
||||
Top = 765
|
||||
Width = 3000
|
||||
End
|
||||
Begin VB.Label lblPlatform
|
||||
Alignment = 1 'Right Justify
|
||||
AutoSize = -1 'True
|
||||
Caption = "Platform"
|
||||
BeginProperty Font
|
||||
Name = "MS Sans Serif"
|
||||
Size = 13.5
|
||||
Charset = 0
|
||||
Weight = 700
|
||||
Underline = 0 'False
|
||||
Italic = 0 'False
|
||||
Strikethrough = 0 'False
|
||||
EndProperty
|
||||
Height = 360
|
||||
Left = 5865
|
||||
TabIndex = 7
|
||||
Tag = "Platform"
|
||||
Top = 2400
|
||||
Width = 1140
|
||||
End
|
||||
Begin VB.Label lblVersion
|
||||
Alignment = 1 'Right Justify
|
||||
AutoSize = -1 'True
|
||||
Caption = "Version"
|
||||
BeginProperty Font
|
||||
Name = "MS Sans Serif"
|
||||
Size = 12
|
||||
Charset = 0
|
||||
Weight = 700
|
||||
Underline = 0 'False
|
||||
Italic = 0 'False
|
||||
Strikethrough = 0 'False
|
||||
EndProperty
|
||||
Height = 300
|
||||
Left = 6075
|
||||
TabIndex = 6
|
||||
Tag = "Version"
|
||||
Top = 2760
|
||||
Width = 930
|
||||
End
|
||||
Begin VB.Label lblWarning
|
||||
Caption = "Warning"
|
||||
Height = 195
|
||||
Left = 300
|
||||
TabIndex = 3
|
||||
Tag = "Warning"
|
||||
Top = 3720
|
||||
Width = 6855
|
||||
End
|
||||
Begin VB.Label lblCompany
|
||||
Caption = "Company"
|
||||
Height = 255
|
||||
Left = 4710
|
||||
TabIndex = 5
|
||||
Tag = "Company"
|
||||
Top = 3330
|
||||
Width = 2415
|
||||
End
|
||||
Begin VB.Label lblCopyright
|
||||
Caption = "Copyright"
|
||||
Height = 255
|
||||
Left = 4710
|
||||
TabIndex = 4
|
||||
Tag = "Copyright"
|
||||
Top = 3120
|
||||
Width = 2415
|
||||
End
|
||||
End
|
||||
End
|
||||
Attribute VB_Name = "frmSplash"
|
||||
Attribute VB_GlobalNameSpace = False
|
||||
Attribute VB_Creatable = False
|
||||
Attribute VB_PredeclaredId = True
|
||||
Attribute VB_Exposed = False
|
||||
Private Sub Form_Load()
|
||||
lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
|
||||
lblProductName.Caption = App.Title
|
||||
End Sub
|
||||
|
56
ndb/src/external/LINUX.x86/sci/include/list.h
vendored
56
ndb/src/external/LINUX.x86/sci/include/list.h
vendored
|
@ -1,56 +0,0 @@
|
|||
/* $Id: list.h,v 1.1 2002/12/13 12:17:20 hin Exp $ */
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* 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 *
|
||||
* the Free Software Foundation; either version 2 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* 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 *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef _LIST_H
|
||||
#define _LIST_H
|
||||
#include "sci_types.h"
|
||||
|
||||
|
||||
typedef struct ListElement *ListElement_t;
|
||||
typedef struct List *List_t;
|
||||
|
||||
struct ListElement {
|
||||
void *element;
|
||||
u_vkaddr_t key;
|
||||
ListElement_t prev,next;
|
||||
};
|
||||
|
||||
void *Get_Element(ListElement_t el);
|
||||
void Set_Element(ListElement_t el,void *elptr,u_vkaddr_t key);
|
||||
void Create_Element(ListElement_t *el);
|
||||
void Destroy_Element(ListElement_t *el);
|
||||
void Create_List(List_t *list);
|
||||
void Destroy_List(List_t *list);
|
||||
void Add_Element(List_t list,ListElement_t el);
|
||||
void Remove_Element(List_t list,ListElement_t el);
|
||||
ListElement_t Find_Element(List_t list,u_vkaddr_t key);
|
||||
scibool List_Empty(List_t);
|
||||
scibool List_Elements(List_t);
|
||||
ListElement_t First_Element(List_t list);
|
||||
ListElement_t Last_Element(List_t list);
|
||||
ListElement_t Next_Element(ListElement_t el);
|
||||
|
||||
#endif /* _LIST_H */
|
|
@ -1,53 +0,0 @@
|
|||
/* $Id: inttypes.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* 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 *
|
||||
* the Free Software Foundation; either version 2 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* 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 *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#ifndef _SCI_OS_INTTYPES_H_
|
||||
#define _SCI_OS_INTTYPES_H_
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------------------------
|
||||
* Basic types of various sizes.
|
||||
* --------------------------------------------------------------------------------------
|
||||
*/
|
||||
typedef unsigned char unsigned8;
|
||||
typedef unsigned short unsigned16;
|
||||
typedef unsigned int unsigned32;
|
||||
typedef unsigned long long unsigned64;
|
||||
|
||||
typedef signed char signed8;
|
||||
typedef signed short signed16;
|
||||
typedef signed int signed32;
|
||||
typedef signed long long signed64;
|
||||
|
||||
|
||||
#ifdef CPU_WORD_IS_64_BIT
|
||||
typedef unsigned64 uptr_t;
|
||||
typedef signed64 iptr_t;
|
||||
#else
|
||||
typedef unsigned32 uptr_t;
|
||||
typedef signed32 iptr_t;
|
||||
#endif
|
||||
|
||||
#endif /* _SCI_OS_INTTYPES_H_ */
|
212
ndb/src/external/LINUX.x86/sci/include/rmlib.h
vendored
212
ndb/src/external/LINUX.x86/sci/include/rmlib.h
vendored
|
@ -1,212 +0,0 @@
|
|||
/* $Id: rmlib.h,v 1.1 2002/12/13 12:17:20 hin Exp $ */
|
||||
|
||||
/*********************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Lesser General Public License as published by *
|
||||
* the Free Software Foundation; either version 2.1 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Lesser General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*********************************************************************************/
|
||||
|
||||
/********************************************************************************/
|
||||
/* This header file contains the declarations of the SCI Reflective Memory */
|
||||
/* library rmlib. The implementation of the library functions is in rmlib.c. */
|
||||
/* The library contains all the functions that operate on the reflective */
|
||||
/* memory. */
|
||||
/* */
|
||||
/* NB! */
|
||||
/* */
|
||||
/* DOLPHIN'S SCI REFLECTIVE MEMORY FILES ARE UNDER DEVELOPMENT AND MAY CHANGE. */
|
||||
/* PLEASE CONTACT DOLPHIN FOR FURTHER INFORMATION. */
|
||||
/* */
|
||||
/* */
|
||||
/********************************************************************************/
|
||||
|
||||
#include "sisci_error.h"
|
||||
#include "sisci_api.h"
|
||||
#include "sisci_demolib.h"
|
||||
#include "sisci_types.h"
|
||||
|
||||
unsigned int seqerr, syncseqerr;
|
||||
|
||||
#ifndef _RMLIB_H
|
||||
#define _RMLIB_H
|
||||
|
||||
|
||||
#if defined(_REENTRANT)
|
||||
|
||||
#define _RMLIB_EXPAND_NAME(name) _RMLIB_MT_ ## name
|
||||
|
||||
#else
|
||||
|
||||
#define _RMLIB_EXPAND_NAME(name) _RMLIB_ST_ ## name
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __sparc
|
||||
#define CACHE_SIZE 2097152
|
||||
#else
|
||||
#define CACHE_SIZE 8192
|
||||
#endif
|
||||
|
||||
/*********************************************************************************/
|
||||
/* FLAG VALUES */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define REFLECT_ERRCHECK 0x2
|
||||
|
||||
struct ReflectiveMemorySpace {
|
||||
unsigned int localAdapterNo;
|
||||
unsigned int localNodeId;
|
||||
unsigned int remoteNodeId;
|
||||
sci_desc_t sd;
|
||||
sci_desc_t syncsd;
|
||||
sci_map_t localMap;
|
||||
sci_map_t remoteMap;
|
||||
unsigned int localSegmentId;
|
||||
unsigned int remoteSegmentId;
|
||||
unsigned int syncSegmentId;
|
||||
unsigned int sync_rSegmentId;
|
||||
unsigned int segmentSize;
|
||||
unsigned int *localMapAddr;
|
||||
volatile unsigned int *remoteMapAddr;
|
||||
sci_local_segment_t localSegment;
|
||||
sci_remote_segment_t remoteSegment;
|
||||
sci_local_segment_t syncSegment;
|
||||
sci_remote_segment_t sync_rSegment;
|
||||
sci_map_t syncMap;
|
||||
sci_map_t sync_rMap;
|
||||
sci_sequence_t syncsequence;
|
||||
sci_sequence_t sequence;
|
||||
unsigned int protection;
|
||||
unsigned int retry_value;
|
||||
sci_sequence_status_t sequenceStatus, syncsequenceStatus;
|
||||
volatile unsigned int *syncMapAddr;
|
||||
volatile unsigned int *sync_rMapAddr;
|
||||
};
|
||||
|
||||
/*********************************************************************************/
|
||||
/* P R I N T R E F L E C T I V E M E M O R Y S P A C E */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectPrintParameters _RMLIB_EXPAND_NAME(ReflectPrintParameters)
|
||||
void ReflectPrintParameters(FILE *stream, struct ReflectiveMemorySpace RM_space);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T D M A S E T U P */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectDmaSetup _RMLIB_EXPAND_NAME(ReflectDmaSetup)
|
||||
sci_error_t ReflectDmaSetup(struct ReflectiveMemorySpace RM_space, sci_dma_queue_t *dmaQueue);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T D M A R E M O V E */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectDmaRemove _RMLIB_EXPAND_NAME(ReflectDmaRemove)
|
||||
sci_error_t ReflectDmaRemove(sci_dma_queue_t dmaQueue);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T D M A R U N */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectDmaRun _RMLIB_EXPAND_NAME(ReflectDmaRun)
|
||||
sci_error_t ReflectDmaRun(struct ReflectiveMemorySpace RM_space,
|
||||
unsigned int* privateSrc,
|
||||
unsigned int size,
|
||||
unsigned int offset,
|
||||
sci_dma_queue_t dmaQueue);
|
||||
/*********************************************************************************/
|
||||
/* C L O S E R E F L E C T I V E M E M O R Y S P A C E */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectClose _RMLIB_EXPAND_NAME(ReflectClose)
|
||||
sci_error_t ReflectClose(struct ReflectiveMemorySpace RM_space, unsigned int segment_no);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* O P E N R E F L E C T I V E M E M O R Y S P A C E */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectOpen _RMLIB_EXPAND_NAME(ReflectOpen)
|
||||
sci_error_t ReflectOpen(struct ReflectiveMemorySpace *RM_space,
|
||||
unsigned int size,
|
||||
unsigned int segment_no,
|
||||
unsigned int localAdapterNo,
|
||||
unsigned int remoteNodeId,
|
||||
unsigned int protection,
|
||||
unsigned int retry_value);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T G E T A C C E S S */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectGetAccess _RMLIB_EXPAND_NAME(ReflectGetAccess)
|
||||
sci_error_t ReflectGetAccess(struct ReflectiveMemorySpace *RM_space);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T R E L E A S E A C C E S S */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectReleaseAccess _RMLIB_EXPAND_NAME(ReflectReleaseAccess)
|
||||
sci_error_t ReflectReleaseAccess(struct ReflectiveMemorySpace *RM_space);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T D M A */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectDma _RMLIB_EXPAND_NAME(ReflectDma)
|
||||
sci_error_t ReflectDma(struct ReflectiveMemorySpace RM_space,
|
||||
unsigned int* privateSrc,
|
||||
unsigned int size,
|
||||
unsigned int offset);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T M E M C O P Y */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectMemCopy _RMLIB_EXPAND_NAME(ReflectMemCopy)
|
||||
sci_error_t ReflectMemCopy(struct ReflectiveMemorySpace RM_space,
|
||||
unsigned int* privateSrc,
|
||||
unsigned int size,
|
||||
unsigned int offset,
|
||||
unsigned int flags);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T S E T */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectSet _RMLIB_EXPAND_NAME(ReflectSet)
|
||||
sci_error_t ReflectSet(struct ReflectiveMemorySpace RM_space,
|
||||
unsigned int value,
|
||||
unsigned int size,
|
||||
unsigned int offset,
|
||||
unsigned int flags
|
||||
);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T P R I N T */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectPrint _RMLIB_EXPAND_NAME(ReflectPrint)
|
||||
sci_error_t ReflectPrint(FILE *stream,
|
||||
struct ReflectiveMemorySpace RM_space,
|
||||
unsigned int size,
|
||||
unsigned int offset
|
||||
);
|
||||
|
||||
|
||||
#endif
|
216
ndb/src/external/LINUX.x86/sci/include/sci_errno.h
vendored
216
ndb/src/external/LINUX.x86/sci/include/sci_errno.h
vendored
|
@ -1,216 +0,0 @@
|
|||
/* $Id: sci_errno.h,v 1.1 2002/12/13 12:17:20 hin Exp $ */
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* 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 *
|
||||
* the Free Software Foundation; either version 2 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* 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 *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef _SCI_ERRNO_H_
|
||||
#define _SCI_ERRNO_H_
|
||||
|
||||
|
||||
/*
|
||||
* SCI Error return values always have 30 bit set
|
||||
* Remote errors should have bit 0 set
|
||||
*/
|
||||
#define SCI_ERR_MASK 0x40000000
|
||||
#define ESCI_REMOTE_MASK 0x01000000
|
||||
|
||||
#define SCI_ERR(u) ((unsigned32)(u)&0x7FFFFFFF )
|
||||
#define _SCI_ERROR(x) ((x) | SCI_ERR_MASK)
|
||||
#define _SCI_REMOTE_ERROR(x) ( _SCI_ERROR(x) | ESCI_REMOTE_MASK )
|
||||
|
||||
/*
|
||||
* Error codes
|
||||
*/
|
||||
typedef enum {
|
||||
ESCI_OK = 0x000,
|
||||
ESCI_STILL_EXPORTED = _SCI_ERROR(0x800),
|
||||
|
||||
ESCI_BUS_ERR = _SCI_ERROR(0x900),
|
||||
ESCI_PEND_SCIERR = _SCI_ERROR(0x901),
|
||||
ESCI_SCI_ERR = _SCI_ERROR(0x902),
|
||||
|
||||
/*
|
||||
* Specific SCI error responses:
|
||||
*/
|
||||
ESCI_SCI_ERR_DATA = _SCI_ERROR(0x9021),
|
||||
ESCI_SCI_ERR_TYPE = _SCI_ERROR(0x9022),
|
||||
ESCI_SCI_ERR_ADDR = _SCI_ERROR(0x9023),
|
||||
|
||||
ESCI_LINK_TIMEOUT = _SCI_ERROR(0x903),
|
||||
ESCI_EXDEV_TIMEOUT = _SCI_ERROR(0x904),
|
||||
ESCI_REMOTE_ERR = _SCI_ERROR(0x905),
|
||||
ESCI_MBX_BUSY = _SCI_ERROR(0x906),
|
||||
ESCI_DMAERR = _SCI_ERROR(0x907),
|
||||
ESCI_DMA_DISABLED = _SCI_ERROR(0x908),
|
||||
ESCI_SW_MBX_SEND_FAILED = _SCI_ERROR(0x909),
|
||||
ESCI_HW_MBX_SEND_FAILED = _SCI_ERROR(0x90A),
|
||||
ESCI_HAS_NO_SESSION = _SCI_ERROR(0xA00),
|
||||
ESCI_CONNREFUSED_SESSION = _SCI_ERROR(0xA01),
|
||||
ESCI_SESSION_NOT_ESTABLISHED = _SCI_ERROR(0xA11),
|
||||
ESCI_REMOTE_NO_VALID_SESSION = _SCI_ERROR(0xA02),
|
||||
ESCI_SESSION_DISABLED = _SCI_ERROR(0xA03),
|
||||
ESCI_NODE_CLOSED = _SCI_ERROR(0xA04),
|
||||
ESCI_NODE_DISABLED = _SCI_ERROR(0xA05),
|
||||
|
||||
ESCI_LOCAL_MASTER_ERR = _SCI_ERROR(0xA06),
|
||||
ESCI_REMOTE_MASTER_ERR = _SCI_REMOTE_ERROR(0xA06),
|
||||
|
||||
ESCI_ILLEGAL_CMD_RECEIVED = _SCI_ERROR(0xA08),
|
||||
ESCI_ILLEGAL_CMD_SENT = _SCI_ERROR(0xA09),
|
||||
|
||||
/* used above: ESCI_SESSION_NOT_ESTABLISHED = _SCI_ERROR(0xA11), */
|
||||
|
||||
/*
|
||||
* Remote error codes
|
||||
*/
|
||||
ESCI_CONNREFUSED = _SCI_ERROR(0xB00),
|
||||
ESCI_NODE_NOT_RESPONDING = _SCI_ERROR(0xB01),
|
||||
ESCI_ISCONN = _SCI_ERROR(0xB02),
|
||||
ESCI_HOSTUNREACH = _SCI_ERROR(0xB03),
|
||||
ESCI_NO_SUCH_USER_ID = _SCI_ERROR(0xB04),
|
||||
ESCI_REMOTE_NO_SUCH_USER_ID = _SCI_REMOTE_ERROR(0xB04), /* ESCI_NO_SUCH_USER_ID */
|
||||
ESCI_NO_SUCH_KEY = _SCI_ERROR(0xB04), /* ESCI_NO_SUCH_USER_ID */
|
||||
ESCI_REMOTE_NO_SUCH_KEY = _SCI_REMOTE_ERROR(0xB04), /* ESCI_REMOTE_NO_SUCH_USER_ID */
|
||||
ESCI_NODE_ERR = _SCI_ERROR(0xB06),
|
||||
ESCI_REMOTE_NODE_ERR = _SCI_REMOTE_ERROR(0xB06), /* ESCI_NODE_ERR */
|
||||
ESCI_NOSPC = _SCI_ERROR(0xB08),
|
||||
ESCI_REMOTE_NOSPC = _SCI_REMOTE_ERROR(0xB08), /* ESCI_NOSPC */
|
||||
ESCI_NODMASPC = _SCI_ERROR(0xB0A),
|
||||
ESCI_REMOTE_NODMASPC = _SCI_REMOTE_ERROR(0xB0A), /* ESCI_NODMASPC */
|
||||
ESCI_NOTMAP = _SCI_ERROR(0xC00),
|
||||
ESCI_ISMAP = _SCI_ERROR(0xC01),
|
||||
ESCI_NOT_INITIALIZED = _SCI_ERROR(0xD00),
|
||||
ESCI_REMOTE_NOT_INITIALIZED = _SCI_REMOTE_ERROR(ESCI_NOT_INITIALIZED),
|
||||
/*
|
||||
* ???
|
||||
*/
|
||||
ESCI_PARAM_ERR = _SCI_ERROR(0xD01),
|
||||
ESCI_NO_FREE_VC = _SCI_ERROR(0xD02),
|
||||
ESCI_REMOTE_NO_FREE_VC = _SCI_REMOTE_ERROR(0xD02), /* ESCI_NO_FREE_VC */
|
||||
|
||||
/*
|
||||
* Adapter state related error codes:
|
||||
*/
|
||||
ESCI_SUSPENDED = _SCI_ERROR(0xD03),
|
||||
ESCI_NOT_SUSPENDED = _SCI_ERROR(0xD04),
|
||||
ESCI_NOT_READY = _SCI_ERROR(0xD05),
|
||||
ESCI_NOT_CONFIGURED = _SCI_ERROR(0xD06),
|
||||
ESCI_INVALID_ADAPTERID = _SCI_ERROR(0xD07), /* if an adapter-id is out of range */
|
||||
ESCI_NONEXIST_ADAPTERID = _SCI_ERROR(0xD08), /* if adapter-id is valid but no adapter matches */
|
||||
ESCI_ADAPTERID_INUSE = _SCI_ERROR(0xD09),
|
||||
|
||||
ESCI_INVALID_INSTANCE = _SCI_ERROR(0xD0A),
|
||||
ESCI_NONEXIST_INSTANCE = _SCI_ERROR(0xD0B),
|
||||
|
||||
ESCI_ADAPTER_INIT_FAILURE = _SCI_ERROR(0xD0C),
|
||||
|
||||
ESCI_PAUSED = _SCI_ERROR(0xD0D),
|
||||
ESCI_NOT_PAUSED = _SCI_ERROR(0xD0E),
|
||||
ESCI_ADAPTER_NEED_RESET = _SCI_ERROR(0xD0F),
|
||||
|
||||
ESCI_NONEXIST_SERIAL_NUMBER = _SCI_ERROR(0xD10),
|
||||
ESCI_NOT_AVAILABLE = _SCI_ERROR(0xD11),
|
||||
|
||||
ESCI_EACCESS = _SCI_ERROR(0xD12),
|
||||
|
||||
/*
|
||||
* Local error codes
|
||||
*/
|
||||
ESCI_NO_LOCAL_ACCESS = _SCI_ERROR(0xE00),
|
||||
ESCI_LRESOURCE_BUSY = _SCI_ERROR(0xE01),
|
||||
ESCI_LRESOURCE_EXIST = _SCI_ERROR(0xE02),
|
||||
ESCI_NO_LRESOURCE = _SCI_ERROR(0xE03),
|
||||
ESCI_NOTCONN = _SCI_ERROR(0xE04),
|
||||
ESCI_LOCAL_ERR = _SCI_ERROR(0xE05),
|
||||
ESCI_NOVAL_NODEID = _SCI_ERROR(0xE06),
|
||||
ESCI_NOT_SUPPORTED = _SCI_ERROR(0xE07),
|
||||
ESCI_TIMEOUT = _SCI_ERROR(0xE08),
|
||||
ESCI_NO_LOCAL_LC_ACCESS = _SCI_ERROR(0xE0A),
|
||||
ESCI_INVALID_ATT = _SCI_ERROR(0xE0B),
|
||||
ESCI_BAD_CHECKSUM = _SCI_ERROR(0xE0C),
|
||||
ESCI_INTERRUPT_FLAG_DISABLED = _SCI_ERROR(0xE0D),
|
||||
ESCI_COND_INT_RACE_PROBLEM = _SCI_ERROR(0xE0E),
|
||||
ESCI_OVERFLOW = _SCI_ERROR(0xE0F),
|
||||
ESCI_BLINK_PARITY_ERROR = _SCI_ERROR(0xE10),
|
||||
ESCI_FIRMWARE_VERSION_MISMATCH = _SCI_ERROR(0xE11),
|
||||
|
||||
/*
|
||||
* Link error codes
|
||||
*/
|
||||
ESCI_NO_LINK_ACCESS = _SCI_ERROR(0xF00),
|
||||
ESCI_NO_REMOTE_LINK_ACCESS = _SCI_REMOTE_ERROR(0xF00), /* ESCI_NO_LINK_ACCESS */
|
||||
|
||||
ESCI_NO_SUCH_NODE = _SCI_ERROR(0xF02),
|
||||
ESCI_USR_ACCESS_DISABLED = _SCI_ERROR(0xF03),
|
||||
ESCI_HW_AVOID_DEADLOCK = _SCI_ERROR(0xF04),
|
||||
ESCI_POTENTIAL_ERROR = _SCI_ERROR(0xF05),
|
||||
|
||||
ESCI_FENCED = _SCI_ERROR(0xF06),
|
||||
ESCI_SWITCH_HW_FAILURE = _SCI_ERROR(0xF07),
|
||||
ESCI_SWITCH_WRONG_BLINK_ID = _SCI_ERROR(0xF08),
|
||||
ESCI_SWITCH_WRONG_PORT_NUMB = _SCI_ERROR(0xF09),
|
||||
ESCI_SWITCH_WRONG_INIT_TYPE = _SCI_ERROR(0xF0A), /* It is determined that the swith initialization
|
||||
* do not match the local adapter initialization
|
||||
*/
|
||||
ESCI_SWITCH_WRONG_SWITCH_NUMB = _SCI_ERROR(0xF0B), /* It is determined that we are operationg on the
|
||||
* wrong switch port
|
||||
*/
|
||||
ESCI_SWITCH_NOT_CONNECTED = _SCI_ERROR(0xF0C),
|
||||
ESCI_SWITCH_NOT_RECOGNIZED = _SCI_ERROR(0xF0D),
|
||||
ESCI_SWITCH_INIT_IN_PROGRESS = _SCI_ERROR(0xF0E), /* Switch TINI initialization in progress */
|
||||
|
||||
|
||||
ESCI_NO_BACKBONE_LINK_ACCESS = _SCI_ERROR(0xF20),
|
||||
ESCI_BACKBONE_FENCED = _SCI_ERROR(0xF21),
|
||||
ESCI_NO_BACKBONE_ACCESS = _SCI_ERROR(0xF22),
|
||||
ESCI_BACKBONE_CABLE_PROBLEM = _SCI_ERROR(0xF23),
|
||||
ESCI_BACKBONE_BLINK_PROBLEM = _SCI_ERROR(0xF24),
|
||||
ESCI_BACKBONE_HWINIT_PROBLEM = _SCI_ERROR(0xF25),
|
||||
ESCI_BACKBONE_ID_PROBLEM = _SCI_ERROR(0xF26),
|
||||
ESCI_BACKBONE_STATE_PROBLEM = _SCI_ERROR(0xF27),
|
||||
ESCI_BACKBONE_REQ_LINK_PROBLEM = _SCI_ERROR(0xF28),
|
||||
ESCI_BACKBONE_UNFENCING = _SCI_ERROR(0xF29), /* Unfencing in progress */
|
||||
|
||||
/*
|
||||
* added for pci port
|
||||
*/
|
||||
ESCI_AGAIN = _SCI_ERROR(0xF15),
|
||||
ESCI_ORANGE = _SCI_ERROR(0xF16), /* Out of range */
|
||||
ESCI_NOSYS = _SCI_ERROR(0xF17), /* Used instead of ENOSYS. Means function not implemented */
|
||||
ESCI_REMOTE_NOSYS = _SCI_REMOTE_ERROR(ESCI_NOSYS),
|
||||
ESCI_INTR = _SCI_ERROR(0xF18), /* Used instead of EINTR from sys/errno.h */
|
||||
ESCI_IO = _SCI_ERROR(0xF19), /* Used instead of EIO from sys/errno.h */
|
||||
ESCI_FAULT = _SCI_ERROR(0xF1A), /* Used instead of EFAULT from sys/errno.h */
|
||||
ESCI_BUSY = _SCI_ERROR(0xF1B), /* Used instead of EBUST from sys/errno.h */
|
||||
ESCI_INVAL = _SCI_ERROR(0xF1C), /* Used instead of EINVAL from sys/errno.h */
|
||||
ESCI_NXIO = _SCI_ERROR(0xF1D), /* Used instead of ENXIO from sys/errno.h */
|
||||
ESCI_EXIST = _SCI_ERROR(0xF1E) /* Used instead of EEXIST from sys/errno.h */
|
||||
|
||||
} scierror_t;
|
||||
|
||||
#endif /* _SCI_ERRNO_H_ */
|
||||
|
||||
|
||||
|
||||
|
300
ndb/src/external/LINUX.x86/sci/include/sci_types.h
vendored
300
ndb/src/external/LINUX.x86/sci/include/sci_types.h
vendored
|
@ -1,300 +0,0 @@
|
|||
/* $Id: sci_types.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* 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 *
|
||||
* the Free Software Foundation; either version 2 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* 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 *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#ifndef _SCI_TYPES_H_
|
||||
#define _SCI_TYPES_H_
|
||||
|
||||
/*
|
||||
* Remains for the time being for backward compatibility ....
|
||||
*/
|
||||
|
||||
/* #define UNIQUE(type) struct { type x; } * */
|
||||
#ifndef UNIQUE
|
||||
#define UNIQUE(type) type
|
||||
#endif
|
||||
#include "os/inttypes.h"
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(_KERNEL)
|
||||
#include <ntddk.h>
|
||||
#else
|
||||
#include <WTYPES.H>
|
||||
#endif /* _KERNEL */
|
||||
#else
|
||||
#if defined(Linux)
|
||||
#if defined(__KERNEL__)
|
||||
#include <linux/types.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef SUNOS5
|
||||
#include <sys/ddi.h>
|
||||
#include <sys/sunddi.h>
|
||||
#endif
|
||||
#ifdef OS_IS_TRU64
|
||||
#include <io/common/devdriver.h>
|
||||
#endif
|
||||
#ifdef OS_IS_HP_UX11
|
||||
#if defined(_KERNEL)
|
||||
#include <../wsio/wsio.h>
|
||||
#else
|
||||
#include <sys/wsio.h>
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* See comments about "UNCONFIGURED_ADAPTERS" in config.h */
|
||||
#define UNCONFIGURED_ADAPTERS 100
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#ifndef IN
|
||||
#define IN
|
||||
#endif
|
||||
|
||||
#ifndef NOT
|
||||
#define NOT !
|
||||
#endif
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------------------------
|
||||
* Basic types of various sizes.
|
||||
* --------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
typedef signed32 scibool;
|
||||
#ifndef OS_IS_VXWORKS
|
||||
typedef signed32 BOOL;
|
||||
#else
|
||||
/* VXWORKS has already defined BOOL */
|
||||
#endif
|
||||
typedef unsigned32 node_t; /* This is the logical nodeid */
|
||||
typedef unsigned32 sciNodeId_t; /* This is the physical 16 bit SCI nodeid */
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------------------------
|
||||
* Various register types.
|
||||
* --------------------------------------------------------------------------------------
|
||||
*/
|
||||
typedef volatile unsigned32 register32;
|
||||
|
||||
|
||||
/*
|
||||
Temporary for Windows NT, until we use only the above types.
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
typedef unsigned char u_char;
|
||||
typedef unsigned short u_short;
|
||||
typedef unsigned long u_long;
|
||||
typedef unsigned int u_int;
|
||||
typedef char * caddr_t;
|
||||
|
||||
typedef long off_t;
|
||||
typedef unsigned int size_t;
|
||||
|
||||
#endif
|
||||
#ifdef OS_IS_VXWORKS
|
||||
#include <vxWorks.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------------------------
|
||||
* Various address types.
|
||||
*
|
||||
* We are using a struct * instead of unsigned long (int) inorder to enforce strong
|
||||
* type checking
|
||||
*
|
||||
* --------------------------------------------------------------------------------------
|
||||
*/
|
||||
typedef UNIQUE(void *) vkaddr_t; /* Virtual kernel address */
|
||||
typedef UNIQUE(uptr_t) vuaddr_t; /* Virtual user address */
|
||||
|
||||
typedef UNIQUE(unsigned32) remaddr_t; /* Remote IO address (physical address on PCs) */
|
||||
typedef UNIQUE(unsigned32) sciofs_lo_t; /* Lower 32 bits of an SCI offset. */
|
||||
typedef UNIQUE(unsigned32) sciofs_hi_t; /* The upper 16 bits of an SCI offset. */
|
||||
|
||||
typedef UNIQUE(unsigned32) ioaddr_t; /* Local IO address (physical address on PCs) */
|
||||
typedef unsigned32 u_ioaddr_t;
|
||||
typedef unsigned32 iooffset_t;
|
||||
typedef unsigned32 iosize_t;
|
||||
|
||||
typedef uptr_t vkoffset_t;
|
||||
typedef uptr_t u_vkaddr_t;
|
||||
typedef uptr_t u_vuaddr_t;
|
||||
typedef unsigned32 u_sciofs_lo_t;
|
||||
typedef unsigned32 u_sciofs_hi_t;
|
||||
typedef unsigned32 u_remaddr_t;
|
||||
typedef unsigned32 attOffset_t; /* Address displacement from start of ATT entry */
|
||||
|
||||
typedef unsigned32 adapterNo_t;
|
||||
|
||||
typedef enum {
|
||||
NO_NODE = 0,
|
||||
AD_MEM_NODE = 1,
|
||||
AD_ALT_NODE = 2,
|
||||
AD_MBX_NODE = 3,
|
||||
AD_LC_NODE = 4,
|
||||
AD_LC_PORT_0 = 5,
|
||||
AD_LC_PORT_1 = 6,
|
||||
AD_LC_PORT_2 = 7,
|
||||
PHYS_NODE = 8
|
||||
} node_type_t;
|
||||
|
||||
|
||||
/*
|
||||
* Currently we don't support more than 32 bit sizes.
|
||||
*/
|
||||
#define SIZEOF(x) ((unsigned32)sizeof(x))
|
||||
|
||||
#if defined(_KERNEL)
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------------------------
|
||||
* Some small macros intended to ease the transition to more strongly typed address
|
||||
* types. The intention is that they in the long run shall be removed ...
|
||||
* --------------------------------------------------------------------------------------
|
||||
*/
|
||||
#define P2SIZE_T(x) ((size_t)((uptr_t)(x))) /* Pointer to size_t */
|
||||
#define P2U32(x) ((unsigned32)((uptr_t)(x))) /* Pointer to Unsigned 32-bit int */
|
||||
#ifdef WIN32
|
||||
#define PHADDR(x) ((ioaddr_t)(x))
|
||||
#define HASV(x) (x)
|
||||
#endif
|
||||
#if 0
|
||||
static vkaddr_t VKPTR (void * ptr) { return (vkaddr_t)ptr; }
|
||||
static vkaddr_t VKADDR(volatile void * ptr) { return (vkaddr_t)ptr; }
|
||||
#else
|
||||
#define VKPTR(ptr) (vkaddr_t)ptr
|
||||
#define VKADDR(ptr) (vkaddr_t)ptr
|
||||
#endif
|
||||
|
||||
#ifdef KLOG
|
||||
#define KLOG_LOG(n,m,v) ts_log((n),(m),(v))
|
||||
#else
|
||||
#define KLOG_LOG(n,m,v)
|
||||
#endif /* KLOG */
|
||||
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------------------------
|
||||
*
|
||||
* M E M A R E A T
|
||||
*
|
||||
* Memory area descriptor.
|
||||
*
|
||||
* paddr -- Physical address (aligned) of memory area
|
||||
* ual_vaddr -- (Kernel )Virtual address of the unaligned memory area
|
||||
* vaddr -- (Kernel) Virtual address of memory area
|
||||
* rsize -- Real (Physical) Size of memory area
|
||||
* msize -- Mapped (Virtual) Size of memory area (Size of area mapped
|
||||
* into virtual) memory
|
||||
*
|
||||
* --------------------------------------
|
||||
* | | <----- msize ----->| |
|
||||
* |<------|------- rsize ------|------>|
|
||||
* --------------------------------------
|
||||
* /|\ /|\
|
||||
* | |
|
||||
* ual_vaddr vaddr/paddr
|
||||
*
|
||||
* --------------------------------------------------------------------------------------
|
||||
*/
|
||||
struct _memarea_ {
|
||||
ioaddr_t ioaddr;
|
||||
vkaddr_t vaddr;
|
||||
vkaddr_t ual_vaddr;
|
||||
size_t rsize;
|
||||
size_t msize;
|
||||
char *id;
|
||||
unsigned32 cookie;
|
||||
|
||||
|
||||
#ifdef SUNOS5
|
||||
#ifdef _USE_NEW_SOLARIS_DDI_INTERFACE
|
||||
ddi_acc_handle_t mem_handle;
|
||||
ddi_dma_handle_t dma_handle;
|
||||
#else
|
||||
ddi_dma_handle_t handle;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef OS_IS_TRU64
|
||||
dma_handle_t dma_handle;
|
||||
#endif
|
||||
|
||||
#if OS_IS_LINUX
|
||||
unsigned long ph_base_addr;
|
||||
#endif
|
||||
|
||||
#ifdef OS_IS_HP_UX11
|
||||
struct isc_table_type * isc;
|
||||
wsio_shmem_attr_t type;
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct _memarea_ memarea_t;
|
||||
|
||||
#ifdef SCI_MALLOC_DEBUG
|
||||
struct _maddr_ {
|
||||
char *id;
|
||||
size_t size;
|
||||
struct _maddr_ *next;
|
||||
struct _maddr_ **prev;
|
||||
unsigned32 cookie;
|
||||
};
|
||||
|
||||
typedef struct _maddr_ maddr_t;
|
||||
|
||||
#define MALLOC_COOKIE 0xc3c3c3c3
|
||||
|
||||
#else
|
||||
|
||||
typedef struct { void *p; } *maddr_t;
|
||||
|
||||
#endif /* SCI_MALLOC_DEBUG */
|
||||
|
||||
|
||||
typedef struct {
|
||||
scibool disabled;
|
||||
unsigned32 disable_cnt;
|
||||
} disable_info_t;
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif /* _SCI_TYPES_H_ */
|
2170
ndb/src/external/LINUX.x86/sci/include/sisci_api.h
vendored
2170
ndb/src/external/LINUX.x86/sci/include/sisci_api.h
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,226 +0,0 @@
|
|||
/* $Id: sisci_demolib.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* 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 *
|
||||
* the Free Software Foundation; either version 2 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* 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 *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _SISCI_DEMOLIB_H
|
||||
#define _SISCI_DEMOLIB_H
|
||||
|
||||
|
||||
#if defined(_REENTRANT)
|
||||
|
||||
#define _SISCI_DEMOLIB_EXPAND_NAME(name) _SISCI_DEMOLIB_MT_ ## name
|
||||
|
||||
#else
|
||||
|
||||
#define _SISCI_DEMOLIB_EXPAND_NAME(name) _SISCI_DEMOLIB_ST_ ## name
|
||||
|
||||
#endif
|
||||
|
||||
/*********************************************************************************/
|
||||
/* Q U E R Y A D A P T E R */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define QueryAdapter _SISCI_DEMOLIB_EXPAND_NAME(QueryAdapter)
|
||||
|
||||
sci_error_t QueryAdapter(
|
||||
unsigned int subcommand,
|
||||
unsigned int localAdapterNo,
|
||||
unsigned int portNo,
|
||||
unsigned int *data);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* Q U E R Y S Y S T E M */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define QuerySystem _SISCI_DEMOLIB_EXPAND_NAME(QuerySystem)
|
||||
|
||||
sci_error_t QuerySystem(
|
||||
unsigned int subcommand,
|
||||
unsigned int *data);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* D E T E C T F I R S T A D A P T E R C A R D */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define DetectFirstAdapterCard _SISCI_DEMOLIB_EXPAND_NAME(DetectFirstAdapterCard)
|
||||
|
||||
sci_error_t DetectFirstAdapterCard(
|
||||
unsigned int *localAdapterNo,
|
||||
unsigned int *localNodeId);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T A D A P T E R T Y P E */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define GetAdapterType _SISCI_DEMOLIB_EXPAND_NAME(GetAdapterType)
|
||||
|
||||
sci_error_t GetAdapterType(unsigned int localAdapterNo,
|
||||
unsigned int *adapterType);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T L O C A L N O D E I D */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define GetLocalNodeId _SISCI_DEMOLIB_EXPAND_NAME(GetLocalNodeId)
|
||||
|
||||
sci_error_t GetLocalNodeId(
|
||||
unsigned int localAdapterNo,
|
||||
unsigned int *localNodeId);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T A D A P T E R S E R I A L N U M B E R */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define GetAdapterSerialNumber _SISCI_DEMOLIB_EXPAND_NAME(GetAdapterSerialNumber)
|
||||
|
||||
sci_error_t GetAdapterSerialNumber(
|
||||
unsigned int localAdapterNo,
|
||||
unsigned int *serialNo);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T H O S T B R I D G E T Y P E */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define GetHostbridgeType _SISCI_DEMOLIB_EXPAND_NAME(GetHostbridgeType)
|
||||
|
||||
sci_error_t GetHostbridgeType(unsigned int *hostbridgeType);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* P R I N T H O S T B R I D G E T Y P E */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define PrintHostbridgeType _SISCI_DEMOLIB_EXPAND_NAME(PrintHostbridgeType)
|
||||
|
||||
void PrintHostbridgeType(unsigned int hostbridge);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T A P I V E R S I O N S T R I N G */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define GetAPIVersionString _SISCI_DEMOLIB_EXPAND_NAME(GetAPIVersionString)
|
||||
|
||||
sci_error_t GetAPIVersionString(char str[], unsigned int strLength);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T A D A P T E R I O B U S F R E Q U E N C Y */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
sci_error_t GetAdapterIoBusFrequency(unsigned int localAdapterNo,
|
||||
unsigned int *ioBusFrequency);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T A D A P T E R S C I L I N K F R E Q U E N C Y */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
sci_error_t GetAdapterSciLinkFrequency(unsigned int localAdapterNo,
|
||||
unsigned int *sciLinkFrequency);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T A D A P T E R B L I N K F R E Q U E N C Y */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
sci_error_t GetAdapterBlinkFrequency(unsigned int localAdapterNo,
|
||||
unsigned int *bLinkFrequency);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* S E N D I N T E R R U P T */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define SendInterrupt _SISCI_DEMOLIB_EXPAND_NAME(SendInterrupt)
|
||||
|
||||
sci_error_t SendInterrupt(
|
||||
sci_desc_t sd,
|
||||
unsigned int localAdapterNo,
|
||||
unsigned int localNodeId,
|
||||
unsigned int remoteNodeId,
|
||||
unsigned int interruptNo);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E C E I V E I N T E R R U P T */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define ReceiveInterrupt _SISCI_DEMOLIB_EXPAND_NAME(ReceiveInterrupt)
|
||||
|
||||
sci_error_t ReceiveInterrupt(
|
||||
sci_desc_t sd,
|
||||
unsigned int localAdapterNo,
|
||||
unsigned int localNodeId,
|
||||
unsigned int interruptNo);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* E N D I A N S W A P */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define EndianSwap _SISCI_DEMOLIB_EXPAND_NAME(EndianSwap)
|
||||
|
||||
unsigned int EndianSwap (unsigned int value);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* S L E E P M I L L I S E C O N D S */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define SleepMilliseconds _SISCI_DEMOLIB_EXPAND_NAME(SleepMilliseconds)
|
||||
|
||||
void SleepMilliseconds(int milliseconds);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -1,89 +0,0 @@
|
|||
/* $Id: sisci_error.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* 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 *
|
||||
* the Free Software Foundation; either version 2 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* 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 *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef _SISCI_ERROR_H_
|
||||
#define _SISCI_ERROR_H_
|
||||
|
||||
|
||||
/* SCI Error return values always have 30 bit set */
|
||||
#define SCI_ERR_MASK 0x40000000
|
||||
#define SCI_ERR_REMOTE_MASK 0x01 /* Remote errors should have bit 0 set */
|
||||
|
||||
#define SCI_ERR(u) ((unsigned32)(u)&0x7FFFFFFF )
|
||||
|
||||
/* Error codes */
|
||||
typedef enum {
|
||||
SCI_ERR_OK = 0x000,
|
||||
|
||||
|
||||
SCI_ERR_BUSY = (0x900 | SCI_ERR_MASK),
|
||||
SCI_ERR_FLAG_NOT_IMPLEMENTED = (0x901 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_FLAG = (0x902 | SCI_ERR_MASK),
|
||||
SCI_ERR_NOSPC = (0x904 | SCI_ERR_MASK),
|
||||
SCI_ERR_API_NOSPC = (0x905 | SCI_ERR_MASK),
|
||||
SCI_ERR_HW_NOSPC = (0x906 | SCI_ERR_MASK),
|
||||
SCI_ERR_NOT_IMPLEMENTED = (0x907 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_ADAPTERNO = (0x908 | SCI_ERR_MASK),
|
||||
SCI_ERR_NO_SUCH_ADAPTERNO = (0x909 | SCI_ERR_MASK),
|
||||
SCI_ERR_TIMEOUT = (0x90A | SCI_ERR_MASK),
|
||||
SCI_ERR_OUT_OF_RANGE = (0x90B | SCI_ERR_MASK),
|
||||
SCI_ERR_NO_SUCH_SEGMENT = (0x90C | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_NODEID = (0x90D | SCI_ERR_MASK),
|
||||
SCI_ERR_CONNECTION_REFUSED = (0x90E | SCI_ERR_MASK),
|
||||
SCI_ERR_SEGMENT_NOT_CONNECTED = (0x90F | SCI_ERR_MASK),
|
||||
SCI_ERR_SIZE_ALIGNMENT = (0x910 | SCI_ERR_MASK),
|
||||
SCI_ERR_OFFSET_ALIGNMENT = (0x911 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_PARAMETER = (0x912 | SCI_ERR_MASK),
|
||||
SCI_ERR_MAX_ENTRIES = (0x913 | SCI_ERR_MASK),
|
||||
SCI_ERR_SEGMENT_NOT_PREPARED = (0x914 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_ADDRESS = (0x915 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_OPERATION = (0x916 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_QUERY = (0x917 | SCI_ERR_MASK),
|
||||
SCI_ERR_SEGMENTID_USED = (0x918 | SCI_ERR_MASK),
|
||||
SCI_ERR_SYSTEM = (0x919 | SCI_ERR_MASK),
|
||||
SCI_ERR_CANCELLED = (0x91A | SCI_ERR_MASK),
|
||||
SCI_ERR_NOT_CONNECTED = (0x91B | SCI_ERR_MASK),
|
||||
SCI_ERR_NOT_AVAILABLE = (0x91C | SCI_ERR_MASK),
|
||||
SCI_ERR_INCONSISTENT_VERSIONS = (0x91D | SCI_ERR_MASK),
|
||||
SCI_ERR_COND_INT_RACE_PROBLEM = (0x91E | SCI_ERR_MASK),
|
||||
SCI_ERR_OVERFLOW = (0x91F | SCI_ERR_MASK),
|
||||
SCI_ERR_NOT_INITIALIZED = (0x920 | SCI_ERR_MASK),
|
||||
|
||||
SCI_ERR_ACCESS = (0x921 | SCI_ERR_MASK),
|
||||
|
||||
SCI_ERR_NO_SUCH_NODEID = (0xA00 | SCI_ERR_MASK),
|
||||
SCI_ERR_NODE_NOT_RESPONDING = (0xA02 | SCI_ERR_MASK),
|
||||
SCI_ERR_NO_REMOTE_LINK_ACCESS = (0xA04 | SCI_ERR_MASK),
|
||||
SCI_ERR_NO_LINK_ACCESS = (0xA05 | SCI_ERR_MASK),
|
||||
SCI_ERR_TRANSFER_FAILED = (0xA06 | SCI_ERR_MASK)
|
||||
} sci_error_t;
|
||||
|
||||
|
||||
#endif /* _SCI_ERROR_H_ */
|
||||
|
||||
|
||||
|
133
ndb/src/external/LINUX.x86/sci/include/sisci_types.h
vendored
133
ndb/src/external/LINUX.x86/sci/include/sisci_types.h
vendored
|
@ -1,133 +0,0 @@
|
|||
/* $Id: sisci_types.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* 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 *
|
||||
* the Free Software Foundation; either version 2 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* 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 *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#ifndef _SISCI_TYPES_H
|
||||
#define _SISCI_TYPES_H
|
||||
|
||||
#include "sisci_error.h"
|
||||
|
||||
#ifndef IN
|
||||
#define IN
|
||||
#endif
|
||||
|
||||
#ifndef OUT
|
||||
#define OUT
|
||||
#endif
|
||||
|
||||
#ifndef IN_OUT
|
||||
#define IN_OUT
|
||||
#endif
|
||||
|
||||
/* Opaque data types for descriptors/handles */
|
||||
typedef struct sci_desc *sci_desc_t;
|
||||
typedef struct sci_local_segment *sci_local_segment_t;
|
||||
typedef struct sci_remote_segment *sci_remote_segment_t;
|
||||
|
||||
typedef struct sci_map *sci_map_t;
|
||||
typedef struct sci_sequence *sci_sequence_t;
|
||||
#ifndef KERNEL
|
||||
typedef struct sci_dma_queue *sci_dma_queue_t;
|
||||
#endif
|
||||
typedef struct sci_remote_interrupt *sci_remote_interrupt_t;
|
||||
typedef struct sci_local_interrupt *sci_local_interrupt_t;
|
||||
typedef struct sci_block_transfer *sci_block_transfer_t;
|
||||
|
||||
/*
|
||||
* Constants defining reasons for segment callbacks:
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
SCI_CB_CONNECT = 1,
|
||||
SCI_CB_DISCONNECT,
|
||||
SCI_CB_NOT_OPERATIONAL,
|
||||
SCI_CB_OPERATIONAL,
|
||||
SCI_CB_LOST
|
||||
} sci_segment_cb_reason_t;
|
||||
|
||||
#define MAX_CB_REASON SCI_CB_LOST
|
||||
|
||||
/* dma_queue_states is identical to the dma_queue_state_t in genif.h, they must be consistent.*/
|
||||
typedef enum {
|
||||
SCI_DMAQUEUE_IDLE,
|
||||
SCI_DMAQUEUE_GATHER,
|
||||
SCI_DMAQUEUE_POSTED,
|
||||
SCI_DMAQUEUE_DONE,
|
||||
SCI_DMAQUEUE_ABORTED,
|
||||
SCI_DMAQUEUE_ERROR
|
||||
} sci_dma_queue_state_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
SCI_SEQ_OK,
|
||||
SCI_SEQ_RETRIABLE,
|
||||
SCI_SEQ_NOT_RETRIABLE,
|
||||
SCI_SEQ_PENDING
|
||||
} sci_sequence_status_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned short nodeId; /* SCI Address bit 63 - 48 */
|
||||
unsigned short offsHi; /* SCI Address bit 47 - 32 */
|
||||
unsigned int offsLo; /* SCI Address bit 31 - 0 */
|
||||
} sci_address_t;
|
||||
|
||||
|
||||
typedef unsigned int sci_ioaddr_t;
|
||||
|
||||
typedef enum {
|
||||
SCI_CALLBACK_CANCEL = 1,
|
||||
SCI_CALLBACK_CONTINUE
|
||||
} sci_callback_action_t;
|
||||
|
||||
#ifndef KERNEL
|
||||
typedef sci_callback_action_t (*sci_cb_local_segment_t)(void *arg,
|
||||
sci_local_segment_t segment,
|
||||
sci_segment_cb_reason_t reason,
|
||||
unsigned int nodeId,
|
||||
unsigned int localAdapterNo,
|
||||
sci_error_t error);
|
||||
|
||||
typedef sci_callback_action_t (*sci_cb_remote_segment_t)(void *arg,
|
||||
sci_remote_segment_t segment,
|
||||
sci_segment_cb_reason_t reason,
|
||||
sci_error_t status);
|
||||
|
||||
|
||||
typedef sci_callback_action_t (*sci_cb_dma_t)(void IN *arg,
|
||||
sci_dma_queue_t queue,
|
||||
sci_error_t status);
|
||||
|
||||
|
||||
typedef int (*sci_cb_block_transfer_t)(void *arg,
|
||||
sci_block_transfer_t block,
|
||||
sci_error_t status);
|
||||
|
||||
|
||||
typedef sci_callback_action_t (*sci_cb_interrupt_t)(void *arg,
|
||||
sci_local_interrupt_t interrupt,
|
||||
sci_error_t status);
|
||||
|
||||
#endif /* KERNEL */
|
||||
#endif
|
|
@ -1,91 +0,0 @@
|
|||
/* $Id: sisci_version.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Lesser General Public License as published by *
|
||||
* the Free Software Foundation; either version 2.1 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Lesser General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#ifndef SISCI_VERSION_H
|
||||
#define SISCI_VERSION_H
|
||||
|
||||
|
||||
#define SISCI_API_VER_MAJOR 0x01
|
||||
#define SISCI_API_VER_MAJORC "1"
|
||||
|
||||
#define SISCI_API_VER_MINOR 0x010
|
||||
#define SISCI_API_VER_MINORC "10"
|
||||
#define SISCI_API_VER_MICRO 0x005
|
||||
#define SISCI_API_VER_MICROC "5"
|
||||
|
||||
#define SISCI_SIGN_VERSION_MASK 0xfffff000 /* used to mask off API_VER_MICRO */
|
||||
|
||||
#define SISCI_API_VERSION (SISCI_API_VER_MAJOR << 24 | SISCI_API_VER_MINOR << 12 | SISCI_API_VER_MICRO)
|
||||
|
||||
/* the rules are:
|
||||
*
|
||||
* Changes in API_VER_MICRO should be binary compatible, New flags, functions added. No changes to user code
|
||||
* required if new features is not needed.
|
||||
*
|
||||
* Changes in API_VER_MINOR requires recompilation of user code.
|
||||
*
|
||||
* Changes in the API_VER_MAJOR will most likely require changes to user code. This should not happen very
|
||||
* often...
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BUILD_DATE
|
||||
#define BUILD_DATE __DATE__
|
||||
#endif
|
||||
|
||||
#ifndef BUILD_NAME
|
||||
#define BUILD_NAME ""
|
||||
#endif
|
||||
|
||||
#define API_VERSION "SISCI API version " SISCI_API_VER_MAJORC "." SISCI_API_VER_MINORC "."SISCI_API_VER_MICROC " ( "BUILD_NAME" "BUILD_DATE" )"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Version info: */
|
||||
/* */
|
||||
/* 1.5.2 First SISCI version */
|
||||
/* 1.5.3 Some bug fixes */
|
||||
/* 1.5.4 Some bug fixes */
|
||||
/* 1.5.5 No release */
|
||||
/* 1.5.6 Lock flag implemented in function SCIConnectSegment */
|
||||
/* 1.5.7 Expanded query functionality */
|
||||
/* 1.5.8 Updated error checking (sequence) functionality for D320 */
|
||||
/* 1.6.0 Updated error checking (sequence) D320 and IRM 1.9 support */
|
||||
/* 1.9.0 Ported to Solaris_sparc, Solaris_x86 and Linux. IRM 1.9. */
|
||||
/* 1.9.1 Some bug fixes */
|
||||
/* 1.9.2 Added more adapter queries */
|
||||
/* 1.9.3 Bug fix in SCIMapLocalSegment and SCIMapRemoteSegment */
|
||||
/* 1.9.4 NT Release Developers Kit 2.40 */
|
||||
/* 1.9.5 Added flush after data transfer in SCIMemCopy() */
|
||||
/* 1.9.5 NT Release Developers Kit 2.44 */
|
||||
/* 1.10.0:
|
||||
* New SCIInitialize(), SCITerminate() functions.
|
||||
* Support for D330
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
25
ndb/src/external/LINUX.x86/sci/include/version.h
vendored
25
ndb/src/external/LINUX.x86/sci/include/version.h
vendored
|
@ -1,25 +0,0 @@
|
|||
#ifndef _VERSION_H
|
||||
#define _VERSION_H
|
||||
|
||||
|
||||
/*
|
||||
#define DEMO_VER_MAJOR "1"
|
||||
#define DEMO_VER_MINOR "5"
|
||||
#define DEMO_VER_MICRO "0"
|
||||
*/
|
||||
|
||||
#ifndef BUILD_DATE
|
||||
#define BUILD_DATE __DATE__
|
||||
#endif
|
||||
|
||||
#ifndef BUILD_NAME
|
||||
#define BUILD_NAME ""
|
||||
#endif
|
||||
|
||||
/*
|
||||
#define DEMO_VERSION "version " DEMO_VER_MAJOR "." DEMO_VER_MINOR "."DEMO_VER_MICRO " ("BUILD_NAME" "BUILD_DATE" )"
|
||||
*/
|
||||
#define DEMO_VERSION " ("BUILD_NAME" "BUILD_DATE" )"
|
||||
|
||||
|
||||
#endif
|
2148
ndb/src/external/SOLARIS.SPARC/sci/include/sisci_api.h
vendored
2148
ndb/src/external/SOLARIS.SPARC/sci/include/sisci_api.h
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,89 +0,0 @@
|
|||
/* $Id: sisci_error.h,v 1.1 2002/12/13 12:17:22 hin Exp $ */
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* 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 *
|
||||
* the Free Software Foundation; either version 2 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* 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 *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef _SISCI_ERROR_H_
|
||||
#define _SISCI_ERROR_H_
|
||||
|
||||
|
||||
/* SCI Error return values always have 30 bit set */
|
||||
#define SCI_ERR_MASK 0x40000000
|
||||
#define SCI_ERR_REMOTE_MASK 0x01 /* Remote errors should have bit 0 set */
|
||||
|
||||
#define SCI_ERR(u) ((unsigned32)(u)&0x7FFFFFFF )
|
||||
|
||||
/* Error codes */
|
||||
typedef enum {
|
||||
SCI_ERR_OK = 0x000,
|
||||
|
||||
|
||||
SCI_ERR_BUSY = (0x900 | SCI_ERR_MASK),
|
||||
SCI_ERR_FLAG_NOT_IMPLEMENTED = (0x901 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_FLAG = (0x902 | SCI_ERR_MASK),
|
||||
SCI_ERR_NOSPC = (0x904 | SCI_ERR_MASK),
|
||||
SCI_ERR_API_NOSPC = (0x905 | SCI_ERR_MASK),
|
||||
SCI_ERR_HW_NOSPC = (0x906 | SCI_ERR_MASK),
|
||||
SCI_ERR_NOT_IMPLEMENTED = (0x907 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_ADAPTERNO = (0x908 | SCI_ERR_MASK),
|
||||
SCI_ERR_NO_SUCH_ADAPTERNO = (0x909 | SCI_ERR_MASK),
|
||||
SCI_ERR_TIMEOUT = (0x90A | SCI_ERR_MASK),
|
||||
SCI_ERR_OUT_OF_RANGE = (0x90B | SCI_ERR_MASK),
|
||||
SCI_ERR_NO_SUCH_SEGMENT = (0x90C | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_NODEID = (0x90D | SCI_ERR_MASK),
|
||||
SCI_ERR_CONNECTION_REFUSED = (0x90E | SCI_ERR_MASK),
|
||||
SCI_ERR_SEGMENT_NOT_CONNECTED = (0x90F | SCI_ERR_MASK),
|
||||
SCI_ERR_SIZE_ALIGNMENT = (0x910 | SCI_ERR_MASK),
|
||||
SCI_ERR_OFFSET_ALIGNMENT = (0x911 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_PARAMETER = (0x912 | SCI_ERR_MASK),
|
||||
SCI_ERR_MAX_ENTRIES = (0x913 | SCI_ERR_MASK),
|
||||
SCI_ERR_SEGMENT_NOT_PREPARED = (0x914 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_ADDRESS = (0x915 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_OPERATION = (0x916 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_QUERY = (0x917 | SCI_ERR_MASK),
|
||||
SCI_ERR_SEGMENTID_USED = (0x918 | SCI_ERR_MASK),
|
||||
SCI_ERR_SYSTEM = (0x919 | SCI_ERR_MASK),
|
||||
SCI_ERR_CANCELLED = (0x91A | SCI_ERR_MASK),
|
||||
SCI_ERR_NOT_CONNECTED = (0x91B | SCI_ERR_MASK),
|
||||
SCI_ERR_NOT_AVAILABLE = (0x91C | SCI_ERR_MASK),
|
||||
SCI_ERR_INCONSISTENT_VERSIONS = (0x91D | SCI_ERR_MASK),
|
||||
SCI_ERR_COND_INT_RACE_PROBLEM = (0x91E | SCI_ERR_MASK),
|
||||
SCI_ERR_OVERFLOW = (0x91F | SCI_ERR_MASK),
|
||||
SCI_ERR_NOT_INITIALIZED = (0x920 | SCI_ERR_MASK),
|
||||
|
||||
SCI_ERR_ACCESS = (0x921 | SCI_ERR_MASK),
|
||||
|
||||
SCI_ERR_NO_SUCH_NODEID = (0xA00 | SCI_ERR_MASK),
|
||||
SCI_ERR_NODE_NOT_RESPONDING = (0xA02 | SCI_ERR_MASK),
|
||||
SCI_ERR_NO_REMOTE_LINK_ACCESS = (0xA04 | SCI_ERR_MASK),
|
||||
SCI_ERR_NO_LINK_ACCESS = (0xA05 | SCI_ERR_MASK),
|
||||
SCI_ERR_TRANSFER_FAILED = (0xA06 | SCI_ERR_MASK)
|
||||
} sci_error_t;
|
||||
|
||||
|
||||
#endif /* _SCI_ERROR_H_ */
|
||||
|
||||
|
||||
|
|
@ -1,133 +0,0 @@
|
|||
/* $Id: sisci_types.h,v 1.1 2002/12/13 12:17:22 hin Exp $ */
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* 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 *
|
||||
* the Free Software Foundation; either version 2 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* 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 *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#ifndef _SISCI_TYPES_H
|
||||
#define _SISCI_TYPES_H
|
||||
|
||||
#include "sisci_error.h"
|
||||
|
||||
#ifndef IN
|
||||
#define IN
|
||||
#endif
|
||||
|
||||
#ifndef OUT
|
||||
#define OUT
|
||||
#endif
|
||||
|
||||
#ifndef IN_OUT
|
||||
#define IN_OUT
|
||||
#endif
|
||||
|
||||
/* Opaque data types for descriptors/handles */
|
||||
typedef struct sci_desc *sci_desc_t;
|
||||
typedef struct sci_local_segment *sci_local_segment_t;
|
||||
typedef struct sci_remote_segment *sci_remote_segment_t;
|
||||
|
||||
typedef struct sci_map *sci_map_t;
|
||||
typedef struct sci_sequence *sci_sequence_t;
|
||||
#ifndef KERNEL
|
||||
typedef struct sci_dma_queue *sci_dma_queue_t;
|
||||
#endif
|
||||
typedef struct sci_remote_interrupt *sci_remote_interrupt_t;
|
||||
typedef struct sci_local_interrupt *sci_local_interrupt_t;
|
||||
typedef struct sci_block_transfer *sci_block_transfer_t;
|
||||
|
||||
/*
|
||||
* Constants defining reasons for segment callbacks:
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
SCI_CB_CONNECT = 1,
|
||||
SCI_CB_DISCONNECT,
|
||||
SCI_CB_NOT_OPERATIONAL,
|
||||
SCI_CB_OPERATIONAL,
|
||||
SCI_CB_LOST
|
||||
} sci_segment_cb_reason_t;
|
||||
|
||||
#define MAX_CB_REASON SCI_CB_LOST
|
||||
|
||||
/* dma_queue_states is identical to the dma_queue_state_t in genif.h, they must be consistent.*/
|
||||
typedef enum {
|
||||
SCI_DMAQUEUE_IDLE,
|
||||
SCI_DMAQUEUE_GATHER,
|
||||
SCI_DMAQUEUE_POSTED,
|
||||
SCI_DMAQUEUE_DONE,
|
||||
SCI_DMAQUEUE_ABORTED,
|
||||
SCI_DMAQUEUE_ERROR
|
||||
} sci_dma_queue_state_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
SCI_SEQ_OK,
|
||||
SCI_SEQ_RETRIABLE,
|
||||
SCI_SEQ_NOT_RETRIABLE,
|
||||
SCI_SEQ_PENDING
|
||||
} sci_sequence_status_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned short nodeId; /* SCI Address bit 63 - 48 */
|
||||
unsigned short offsHi; /* SCI Address bit 47 - 32 */
|
||||
unsigned int offsLo; /* SCI Address bit 31 - 0 */
|
||||
} sci_address_t;
|
||||
|
||||
|
||||
typedef unsigned int sci_ioaddr_t;
|
||||
|
||||
typedef enum {
|
||||
SCI_CALLBACK_CANCEL = 1,
|
||||
SCI_CALLBACK_CONTINUE
|
||||
} sci_callback_action_t;
|
||||
|
||||
#ifndef KERNEL
|
||||
typedef sci_callback_action_t (*sci_cb_local_segment_t)(void *arg,
|
||||
sci_local_segment_t segment,
|
||||
sci_segment_cb_reason_t reason,
|
||||
unsigned int nodeId,
|
||||
unsigned int localAdapterNo,
|
||||
sci_error_t error);
|
||||
|
||||
typedef sci_callback_action_t (*sci_cb_remote_segment_t)(void *arg,
|
||||
sci_remote_segment_t segment,
|
||||
sci_segment_cb_reason_t reason,
|
||||
sci_error_t status);
|
||||
|
||||
|
||||
typedef sci_callback_action_t (*sci_cb_dma_t)(void IN *arg,
|
||||
sci_dma_queue_t queue,
|
||||
sci_error_t status);
|
||||
|
||||
|
||||
typedef int (*sci_cb_block_transfer_t)(void *arg,
|
||||
sci_block_transfer_t block,
|
||||
sci_error_t status);
|
||||
|
||||
|
||||
typedef sci_callback_action_t (*sci_cb_interrupt_t)(void *arg,
|
||||
sci_local_interrupt_t interrupt,
|
||||
sci_error_t status);
|
||||
|
||||
#endif /* KERNEL */
|
||||
#endif
|
|
@ -1,91 +0,0 @@
|
|||
/* $Id: sisci_version.h,v 1.1 2002/12/13 12:17:22 hin Exp $ */
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Lesser General Public License as published by *
|
||||
* the Free Software Foundation; either version 2.1 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Lesser General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#ifndef SISCI_VERSION_H
|
||||
#define SISCI_VERSION_H
|
||||
|
||||
|
||||
#define SISCI_API_VER_MAJOR 1
|
||||
#define SISCI_API_VER_MAJORC "1"
|
||||
|
||||
#define SISCI_API_VER_MINOR 10
|
||||
#define SISCI_API_VER_MINORC "10"
|
||||
#define SISCI_API_VER_MICRO 4
|
||||
#define SISCI_API_VER_MICROC "4"
|
||||
|
||||
#define SISCI_SIGN_VERSION_MASK 0xfffff000 /* used to mask off API_VER_MICRO */
|
||||
|
||||
#define SISCI_API_VERSION (SISCI_API_VER_MAJOR << 24 | SISCI_API_VER_MINOR << 12 | SISCI_API_VER_MICRO)
|
||||
|
||||
/* the rules are:
|
||||
*
|
||||
* Changes in API_VER_MICRO should be binary compatible, New flags, functions added. No changes to user code
|
||||
* required if new features is not needed.
|
||||
*
|
||||
* Changes in API_VER_MINOR requires recompilation of user code.
|
||||
*
|
||||
* Changes in the API_VER_MAJOR will most likely require changes to user code. This should not happen very
|
||||
* often...
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BUILD_DATE
|
||||
#define BUILD_DATE __DATE__
|
||||
#endif
|
||||
|
||||
#ifndef BUILD_NAME
|
||||
#define BUILD_NAME ""
|
||||
#endif
|
||||
|
||||
#define API_VERSION "SISCI API version " SISCI_API_VER_MAJORC "." SISCI_API_VER_MINORC "."SISCI_API_VER_MICROC " ( "BUILD_NAME" "BUILD_DATE" )"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Version info: */
|
||||
/* */
|
||||
/* 1.5.2 First SISCI version */
|
||||
/* 1.5.3 Some bug fixes */
|
||||
/* 1.5.4 Some bug fixes */
|
||||
/* 1.5.5 No release */
|
||||
/* 1.5.6 Lock flag implemented in function SCIConnectSegment */
|
||||
/* 1.5.7 Expanded query functionality */
|
||||
/* 1.5.8 Updated error checking (sequence) functionality for D320 */
|
||||
/* 1.6.0 Updated error checking (sequence) D320 and IRM 1.9 support */
|
||||
/* 1.9.0 Ported to Solaris_sparc, Solaris_x86 and Linux. IRM 1.9. */
|
||||
/* 1.9.1 Some bug fixes */
|
||||
/* 1.9.2 Added more adapter queries */
|
||||
/* 1.9.3 Bug fix in SCIMapLocalSegment and SCIMapRemoteSegment */
|
||||
/* 1.9.4 NT Release Developers Kit 2.40 */
|
||||
/* 1.9.5 Added flush after data transfer in SCIMemCopy() */
|
||||
/* 1.9.5 NT Release Developers Kit 2.44 */
|
||||
/* 1.10.0:
|
||||
* New SCIInitialize(), SCITerminate() functions.
|
||||
* Support for D330
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
212
ndb/src/external/WIN32.x86/sci/include/rmlib.h
vendored
212
ndb/src/external/WIN32.x86/sci/include/rmlib.h
vendored
|
@ -1,212 +0,0 @@
|
|||
/* $Id: rmlib.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */
|
||||
|
||||
/*********************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Lesser General Public License as published by *
|
||||
* the Free Software Foundation; either version 2.1 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Lesser General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*********************************************************************************/
|
||||
|
||||
/********************************************************************************/
|
||||
/* This header file contains the declarations of the SCI Reflective Memory */
|
||||
/* library rmlib. The implementation of the library functions is in rmlib.c. */
|
||||
/* The library contains all the functions that operate on the reflective */
|
||||
/* memory. */
|
||||
/* */
|
||||
/* NB! */
|
||||
/* */
|
||||
/* DOLPHIN'S SCI REFLECTIVE MEMORY FILES ARE UNDER DEVELOPMENT AND MAY CHANGE. */
|
||||
/* PLEASE CONTACT DOLPHIN FOR FURTHER INFORMATION. */
|
||||
/* */
|
||||
/* */
|
||||
/********************************************************************************/
|
||||
|
||||
#include "sisci_error.h"
|
||||
#include "sisci_api.h"
|
||||
#include "sisci_demolib.h"
|
||||
#include "sisci_types.h"
|
||||
|
||||
unsigned int seqerr, syncseqerr;
|
||||
|
||||
#ifndef _RMLIB_H
|
||||
#define _RMLIB_H
|
||||
|
||||
|
||||
#if defined(_REENTRANT)
|
||||
|
||||
#define _RMLIB_EXPAND_NAME(name) _RMLIB_MT_ ## name
|
||||
|
||||
#else
|
||||
|
||||
#define _RMLIB_EXPAND_NAME(name) _RMLIB_ST_ ## name
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __sparc
|
||||
#define CACHE_SIZE 2097152
|
||||
#else
|
||||
#define CACHE_SIZE 8192
|
||||
#endif
|
||||
|
||||
/*********************************************************************************/
|
||||
/* FLAG VALUES */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define REFLECT_ERRCHECK 0x2
|
||||
|
||||
struct ReflectiveMemorySpace {
|
||||
unsigned int localAdapterNo;
|
||||
unsigned int localNodeId;
|
||||
unsigned int remoteNodeId;
|
||||
sci_desc_t sd;
|
||||
sci_desc_t syncsd;
|
||||
sci_map_t localMap;
|
||||
sci_map_t remoteMap;
|
||||
unsigned int localSegmentId;
|
||||
unsigned int remoteSegmentId;
|
||||
unsigned int syncSegmentId;
|
||||
unsigned int sync_rSegmentId;
|
||||
unsigned int segmentSize;
|
||||
unsigned int *localMapAddr;
|
||||
volatile unsigned int *remoteMapAddr;
|
||||
sci_local_segment_t localSegment;
|
||||
sci_remote_segment_t remoteSegment;
|
||||
sci_local_segment_t syncSegment;
|
||||
sci_remote_segment_t sync_rSegment;
|
||||
sci_map_t syncMap;
|
||||
sci_map_t sync_rMap;
|
||||
sci_sequence_t syncsequence;
|
||||
sci_sequence_t sequence;
|
||||
unsigned int protection;
|
||||
unsigned int retry_value;
|
||||
sci_sequence_status_t sequenceStatus, syncsequenceStatus;
|
||||
volatile unsigned int *syncMapAddr;
|
||||
volatile unsigned int *sync_rMapAddr;
|
||||
};
|
||||
|
||||
/*********************************************************************************/
|
||||
/* P R I N T R E F L E C T I V E M E M O R Y S P A C E */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectPrintParameters _RMLIB_EXPAND_NAME(ReflectPrintParameters)
|
||||
void ReflectPrintParameters(FILE *stream, struct ReflectiveMemorySpace RM_space);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T D M A S E T U P */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectDmaSetup _RMLIB_EXPAND_NAME(ReflectDmaSetup)
|
||||
sci_error_t ReflectDmaSetup(struct ReflectiveMemorySpace RM_space, sci_dma_queue_t *dmaQueue);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T D M A R E M O V E */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectDmaRemove _RMLIB_EXPAND_NAME(ReflectDmaRemove)
|
||||
sci_error_t ReflectDmaRemove(sci_dma_queue_t dmaQueue);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T D M A R U N */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectDmaRun _RMLIB_EXPAND_NAME(ReflectDmaRun)
|
||||
sci_error_t ReflectDmaRun(struct ReflectiveMemorySpace RM_space,
|
||||
unsigned int* privateSrc,
|
||||
unsigned int size,
|
||||
unsigned int offset,
|
||||
sci_dma_queue_t dmaQueue);
|
||||
/*********************************************************************************/
|
||||
/* C L O S E R E F L E C T I V E M E M O R Y S P A C E */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectClose _RMLIB_EXPAND_NAME(ReflectClose)
|
||||
sci_error_t ReflectClose(struct ReflectiveMemorySpace RM_space, unsigned int segment_no);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* O P E N R E F L E C T I V E M E M O R Y S P A C E */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectOpen _RMLIB_EXPAND_NAME(ReflectOpen)
|
||||
sci_error_t ReflectOpen(struct ReflectiveMemorySpace *RM_space,
|
||||
unsigned int size,
|
||||
unsigned int segment_no,
|
||||
unsigned int localAdapterNo,
|
||||
unsigned int remoteNodeId,
|
||||
unsigned int protection,
|
||||
unsigned int retry_value);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T G E T A C C E S S */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectGetAccess _RMLIB_EXPAND_NAME(ReflectGetAccess)
|
||||
sci_error_t ReflectGetAccess(struct ReflectiveMemorySpace *RM_space);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T R E L E A S E A C C E S S */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectReleaseAccess _RMLIB_EXPAND_NAME(ReflectReleaseAccess)
|
||||
sci_error_t ReflectReleaseAccess(struct ReflectiveMemorySpace *RM_space);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T D M A */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectDma _RMLIB_EXPAND_NAME(ReflectDma)
|
||||
sci_error_t ReflectDma(struct ReflectiveMemorySpace RM_space,
|
||||
unsigned int* privateSrc,
|
||||
unsigned int size,
|
||||
unsigned int offset);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T M E M C O P Y */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectMemCopy _RMLIB_EXPAND_NAME(ReflectMemCopy)
|
||||
sci_error_t ReflectMemCopy(struct ReflectiveMemorySpace RM_space,
|
||||
unsigned int* privateSrc,
|
||||
unsigned int size,
|
||||
unsigned int offset,
|
||||
unsigned int flags);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T S E T */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectSet _RMLIB_EXPAND_NAME(ReflectSet)
|
||||
sci_error_t ReflectSet(struct ReflectiveMemorySpace RM_space,
|
||||
unsigned int value,
|
||||
unsigned int size,
|
||||
unsigned int offset,
|
||||
unsigned int flags
|
||||
);
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E F L E C T P R I N T */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
#define ReflectPrint _RMLIB_EXPAND_NAME(ReflectPrint)
|
||||
sci_error_t ReflectPrint(FILE *stream,
|
||||
struct ReflectiveMemorySpace RM_space,
|
||||
unsigned int size,
|
||||
unsigned int offset
|
||||
);
|
||||
|
||||
|
||||
#endif
|
330
ndb/src/external/WIN32.x86/sci/include/scilib.h
vendored
330
ndb/src/external/WIN32.x86/sci/include/scilib.h
vendored
|
@ -1,330 +0,0 @@
|
|||
/* $Id: scilib.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 2002 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#if defined(_REENTRANT)
|
||||
#define _SCIL_EXPANDE_FUNCTION_NAME(name) _SCIL_PUBLIC_FUNC_MT_ ## name
|
||||
#define _SCIL_EXPANDE_VARIABLE_NAME(name) _SCIL_PUBLIC_VAR_MT_ ## name
|
||||
#else
|
||||
#define _SCIL_EXPANDE_FUNCTION_NAME(name) _SCIL_PUBLIC_FUNC_ST_ ## name
|
||||
#define _SCIL_EXPANDE_VARIABLE_NAME(name) _SCIL_PUBLIC_VAR_ST_ ## name
|
||||
#endif
|
||||
#define _SCIL_EXPANDE_CONSTANT_NAME(name) _SCIL_PUBLIC_CONST_ ## name
|
||||
|
||||
#include "sisci_api.h"
|
||||
|
||||
#if defined(CPLUSPLUS) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* SISCI segment id pollution:
|
||||
* ===========================
|
||||
* The SISCI library uses regular SISCI segmens internally.
|
||||
* The MSG_QUEUE_LIB_IDENTIFIER_MASK is a mask which is used by the SISCI
|
||||
* library to identify internal SISCI segments ids, from segments used directly
|
||||
* by the user.
|
||||
*
|
||||
* Future versions of the library may have its own namespace.
|
||||
*
|
||||
*/
|
||||
|
||||
#define MSG_QUEUE_LIB_IDENTIFIER_MASK 0x10000000
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* FLAG VALUES */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define SCIL_FLAG_ERROR_CHECK_DATA _SCIL_EXPANDE_CONSTANT_NAME(SCIL_FLAG_ERROR_CHECK_DATA)
|
||||
extern const unsigned int SCIL_FLAG_ERROR_CHECK_DATA;
|
||||
|
||||
#define SCIL_FLAG_ERROR_CHECK_PROT _SCIL_EXPANDE_CONSTANT_NAME(SCIL_FLAG_ERROR_CHECK_PROT)
|
||||
extern const unsigned int SCIL_FLAG_ERROR_CHECK_PROT;
|
||||
|
||||
#define SCIL_FLAG_FULL_ERROR_CHECK _SCIL_EXPANDE_CONSTANT_NAME(SCIL_FLAG_FULL_ERROR_CHECK)
|
||||
extern const unsigned int SCIL_FLAG_FULL_ERROR_CHECK;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct sci_msq_queue *sci_msq_queue_t;
|
||||
|
||||
|
||||
/*********************************************************************************
|
||||
* *
|
||||
* S C I L C r e a t e M s g Q u e u e *
|
||||
* *
|
||||
* Parameters: *
|
||||
* *
|
||||
* Creates a message queue. The message queue identifier object will be allocated*
|
||||
* if the sci_msq_queue_t * msg pointer is NULL. The function will create a *
|
||||
* remote connection. If this connection times out, the function shoud be *
|
||||
* repeated until connection is established. SCILRemoveMsgQueue() must be called *
|
||||
* to remove the connection and deallocate the message queue identifier. *
|
||||
* *
|
||||
* sci_msq_queue_t *msq : Message queue identifier *
|
||||
* The function must be called with a null pointer *
|
||||
* the first time. *
|
||||
* unsigned int localAdapterNo: Local Adapter Number *
|
||||
* unsigned int remoteNodeId : Remote nodeId *
|
||||
* unsigned int msqId : Message queue number *
|
||||
* unsigned int maxMsgCount : The maximum count of messages in queue *
|
||||
* unsigned int maxMsgSize, : The maximum size of each messages in queue *
|
||||
* unsigned int timeout : Time to wait for successful connection *
|
||||
* unsigned int flags : Flags. *
|
||||
* *
|
||||
* Flags *
|
||||
* *
|
||||
* None *
|
||||
* *
|
||||
* Specific error codes for this function: *
|
||||
* *
|
||||
* None. Normal SISIC error codes. *
|
||||
* *
|
||||
*********************************************************************************/
|
||||
#define SCILCreateMsgQueue _SCIL_EXPANDE_FUNCTION_NAME(SCILCreateMsgQueue)
|
||||
DLL sci_error_t SCILCreateMsgQueue(sci_msq_queue_t *msq,
|
||||
unsigned int localAdapterNo,
|
||||
unsigned int remoteNodeId,
|
||||
unsigned int msqId,
|
||||
unsigned int maxMsgCount,
|
||||
unsigned int maxMsgSize,
|
||||
unsigned int timeout,
|
||||
unsigned int flags);
|
||||
|
||||
|
||||
/*********************************************************************************
|
||||
* *
|
||||
* S C I L R e c e i v e M s g *
|
||||
* *
|
||||
* *
|
||||
* Receives a message from the queue. *
|
||||
* *
|
||||
* Paremeters *
|
||||
* *
|
||||
* sci_msq_queue_t msq : message queue identifier *
|
||||
* void *msg : Location to store received data *
|
||||
* unsigned int size : Size of message to read *
|
||||
* unsigned int *sizeLeft: Bytes left in buffer, after current receive. This is *
|
||||
* just a hint. There may be more. *
|
||||
* *
|
||||
* Flags *
|
||||
* *
|
||||
* SCIL_FLAG_ERROR_CHECK_PROT: The internal buffer management is done using full*
|
||||
* error checking.
|
||||
* *
|
||||
* Specific error codes for this function: *
|
||||
* *
|
||||
* SCI_ERR_EWOULD_BLOCK : There is not enough data in the message buffer *
|
||||
* to read the specified number of bytes. *
|
||||
* . *
|
||||
* SCI_ERR_NOT_CONNECTED : The connection is not established. *
|
||||
* *
|
||||
*********************************************************************************/
|
||||
#define SCILReceiveMsg _SCIL_EXPANDE_FUNCTION_NAME(SCILReceiveMsg)
|
||||
DLL sci_error_t SCILReceiveMsg(
|
||||
sci_msq_queue_t msq,
|
||||
void *msg,
|
||||
unsigned int size,
|
||||
unsigned int *sizeLeft,
|
||||
unsigned int flags);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************
|
||||
* *
|
||||
* S C I L S e n d M s g *
|
||||
* *
|
||||
* *
|
||||
* Sends a message to the queue. *
|
||||
* *
|
||||
* Paremeters *
|
||||
* *
|
||||
* sci_msq_queue_t msq : Message queue identifier *
|
||||
* void *msg : Send data *
|
||||
* unsigned int size : Size of message to send *
|
||||
* unsigned int *sizeFree: Bytes free in buffer, after current send. This is *
|
||||
* just a hint. There may be more. *
|
||||
* *
|
||||
* Flags *
|
||||
* *
|
||||
* SCIL_FLAG_ERROR_CHECK_DATA: The data is transmitted using full error checking*
|
||||
* SCIL_FLAG_ERROR_CHECK_PROT: The internal buffer management is done using full*
|
||||
* error checking. *
|
||||
* SCIL_FLSG_FULL_ERROR_CHECK: This flag is an combination of both above. *
|
||||
* *
|
||||
* Specific error codes for this function: *
|
||||
* *
|
||||
* SCI_ERR_EWOULD_BLOCK : There is not enough data in the message buffer *
|
||||
* to send the specified number of bytes. *
|
||||
* . *
|
||||
* SCI_ERR_NOT_CONNECTED : The connection is not established. *
|
||||
* *
|
||||
*********************************************************************************/
|
||||
#define SCILSendMsg _SCIL_EXPANDE_FUNCTION_NAME(SCILSendMsg)
|
||||
DLL sci_error_t SCILSendMsg(
|
||||
sci_msq_queue_t msq,
|
||||
void *msg,
|
||||
unsigned int size,
|
||||
unsigned int *sizeFree,
|
||||
unsigned int flags);
|
||||
|
||||
|
||||
/*********************************************************************************
|
||||
* *
|
||||
* S C I L R e m o v e M s g Q u e ue *
|
||||
* *
|
||||
* *
|
||||
* Removes a message queue. *
|
||||
* *
|
||||
* sci_msq_queue_t msq : Message queue identifier *
|
||||
* *
|
||||
* Flags *
|
||||
* *
|
||||
* None *
|
||||
* *
|
||||
* Specific error codes for this function: *
|
||||
* *
|
||||
* None *
|
||||
* *
|
||||
*********************************************************************************/
|
||||
#define SCILRemoveMsgQueue _SCIL_EXPANDE_FUNCTION_NAME(SCILRemoveMsgQueue)
|
||||
DLL sci_error_t SCILRemoveMsgQueue(
|
||||
sci_msq_queue_t *msq,
|
||||
unsigned int flags);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************
|
||||
* *
|
||||
* S C I L I n i t *
|
||||
* *
|
||||
* *
|
||||
* Initializes the SCI library. This function must be called before any other *
|
||||
* function in the library. *
|
||||
* *
|
||||
* Flags *
|
||||
* *
|
||||
* None *
|
||||
* *
|
||||
* Specific error codes for this function: *
|
||||
* *
|
||||
* None *
|
||||
* . *
|
||||
*********************************************************************************/
|
||||
#define SCILInit _SCIL_EXPANDE_FUNCTION_NAME(SCILInit)
|
||||
DLL sci_error_t SCILInit(unsigned int flags);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************
|
||||
* *
|
||||
* S C I L D e s t r o y *
|
||||
* *
|
||||
* *
|
||||
* Removes internal resources allocated by the SCI Library. No other library *
|
||||
* function should be called after this function. *
|
||||
* *
|
||||
* Flags *
|
||||
* *
|
||||
* None *
|
||||
* *
|
||||
* Specific error codes for this function: *
|
||||
* *
|
||||
* None *
|
||||
* *
|
||||
*********************************************************************************/
|
||||
#define SCILDestroy _SCIL_EXPANDE_FUNCTION_NAME(SCILDestroy)
|
||||
DLL sci_error_t SCILDestroy(unsigned int flags);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************
|
||||
* *
|
||||
* S C I L C o n n e c t M s g Q u e u e *
|
||||
* *
|
||||
* *
|
||||
* Makes a connection to a remote message queue. This must be done before *
|
||||
* SCILSendMsg() is called. *
|
||||
* *
|
||||
* Parameters: *
|
||||
* *
|
||||
* sci_msq_queue_t *msq : Message queue identifier *
|
||||
* unsigned int localAdapterNo: Local Adapter Number *
|
||||
* unsigned int remoteNodeId : Remote nodeId *
|
||||
* unsigned int msqId : Message queue number *
|
||||
* unsigned int maxMsgCount : The maximum count of messages in queue *
|
||||
* unsigned int maxMsgSize, : The maximum size of each messages in queue *
|
||||
* unsigned int timeout : Time to wait for successful connection *
|
||||
* unsigned int flags : Flags. *
|
||||
* *
|
||||
* Flags *
|
||||
* *
|
||||
* None *
|
||||
* *
|
||||
* Specific error codes for this function: *
|
||||
* *
|
||||
* None. Normal SISIC error codes. *
|
||||
* *
|
||||
*********************************************************************************/
|
||||
#define SCILConnectMsgQueue _SCIL_EXPANDE_FUNCTION_NAME(SCILConnectMsgQueue)
|
||||
DLL sci_error_t SCILConnectMsgQueue(sci_msq_queue_t *msq,
|
||||
unsigned int localAdapterNo,
|
||||
unsigned int remoteNodeId,
|
||||
unsigned int rmsgId,
|
||||
unsigned int maxMsgCount,
|
||||
unsigned int maxMsgSize,
|
||||
unsigned int timeout,
|
||||
unsigned int flags);
|
||||
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************
|
||||
* *
|
||||
* S C I L D i s c o n n e c t M s g Q u e u e *
|
||||
* *
|
||||
* *
|
||||
* Disconnects from a remote message queue. *
|
||||
* *
|
||||
* Parameters: *
|
||||
* *
|
||||
* sci_msq_queue_t *msq : Message queue identifier *
|
||||
* *
|
||||
* Flags *
|
||||
* *
|
||||
* None *
|
||||
* *
|
||||
* Specific error codes for this function: *
|
||||
* *
|
||||
* None *
|
||||
* *
|
||||
*********************************************************************************/
|
||||
#define SCILDisconnectMsgQueue _SCIL_EXPANDE_FUNCTION_NAME(SCILDisconnectMsgQueue)
|
||||
DLL sci_error_t SCILDisconnectMsgQueue(sci_msq_queue_t *msq,
|
||||
unsigned int flags);
|
||||
|
||||
|
||||
|
||||
#if defined(CPLUSPLUS) || defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
2217
ndb/src/external/WIN32.x86/sci/include/sisci_api.h
vendored
2217
ndb/src/external/WIN32.x86/sci/include/sisci_api.h
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,226 +0,0 @@
|
|||
/* $Id: sisci_demolib.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* 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 *
|
||||
* the Free Software Foundation; either version 2 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* 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 *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _SISCI_DEMOLIB_H
|
||||
#define _SISCI_DEMOLIB_H
|
||||
|
||||
|
||||
#if defined(_REENTRANT)
|
||||
|
||||
#define _SISCI_DEMOLIB_EXPAND_NAME(name) _SISCI_DEMOLIB_MT_ ## name
|
||||
|
||||
#else
|
||||
|
||||
#define _SISCI_DEMOLIB_EXPAND_NAME(name) _SISCI_DEMOLIB_ST_ ## name
|
||||
|
||||
#endif
|
||||
|
||||
/*********************************************************************************/
|
||||
/* Q U E R Y A D A P T E R */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define QueryAdapter _SISCI_DEMOLIB_EXPAND_NAME(QueryAdapter)
|
||||
|
||||
sci_error_t QueryAdapter(
|
||||
unsigned int subcommand,
|
||||
unsigned int localAdapterNo,
|
||||
unsigned int portNo,
|
||||
unsigned int *data);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* Q U E R Y S Y S T E M */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define QuerySystem _SISCI_DEMOLIB_EXPAND_NAME(QuerySystem)
|
||||
|
||||
sci_error_t QuerySystem(
|
||||
unsigned int subcommand,
|
||||
unsigned int *data);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* D E T E C T F I R S T A D A P T E R C A R D */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define DetectFirstAdapterCard _SISCI_DEMOLIB_EXPAND_NAME(DetectFirstAdapterCard)
|
||||
|
||||
sci_error_t DetectFirstAdapterCard(
|
||||
unsigned int *localAdapterNo,
|
||||
unsigned int *localNodeId);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T A D A P T E R T Y P E */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define GetAdapterType _SISCI_DEMOLIB_EXPAND_NAME(GetAdapterType)
|
||||
|
||||
sci_error_t GetAdapterType(unsigned int localAdapterNo,
|
||||
unsigned int *adapterType);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T L O C A L N O D E I D */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define GetLocalNodeId _SISCI_DEMOLIB_EXPAND_NAME(GetLocalNodeId)
|
||||
|
||||
sci_error_t GetLocalNodeId(
|
||||
unsigned int localAdapterNo,
|
||||
unsigned int *localNodeId);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T A D A P T E R S E R I A L N U M B E R */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define GetAdapterSerialNumber _SISCI_DEMOLIB_EXPAND_NAME(GetAdapterSerialNumber)
|
||||
|
||||
sci_error_t GetAdapterSerialNumber(
|
||||
unsigned int localAdapterNo,
|
||||
unsigned int *serialNo);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T H O S T B R I D G E T Y P E */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define GetHostbridgeType _SISCI_DEMOLIB_EXPAND_NAME(GetHostbridgeType)
|
||||
|
||||
sci_error_t GetHostbridgeType(unsigned int *hostbridgeType);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* P R I N T H O S T B R I D G E T Y P E */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define PrintHostbridgeType _SISCI_DEMOLIB_EXPAND_NAME(PrintHostbridgeType)
|
||||
|
||||
void PrintHostbridgeType(unsigned int hostbridge);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T A P I V E R S I O N S T R I N G */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define GetAPIVersionString _SISCI_DEMOLIB_EXPAND_NAME(GetAPIVersionString)
|
||||
|
||||
sci_error_t GetAPIVersionString(char str[], unsigned int strLength);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T A D A P T E R I O B U S F R E Q U E N C Y */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
sci_error_t GetAdapterIoBusFrequency(unsigned int localAdapterNo,
|
||||
unsigned int *ioBusFrequency);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T A D A P T E R S C I L I N K F R E Q U E N C Y */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
sci_error_t GetAdapterSciLinkFrequency(unsigned int localAdapterNo,
|
||||
unsigned int *sciLinkFrequency);
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* G E T A D A P T E R B L I N K F R E Q U E N C Y */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
sci_error_t GetAdapterBlinkFrequency(unsigned int localAdapterNo,
|
||||
unsigned int *bLinkFrequency);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* S E N D I N T E R R U P T */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define SendInterrupt _SISCI_DEMOLIB_EXPAND_NAME(SendInterrupt)
|
||||
|
||||
sci_error_t SendInterrupt(
|
||||
sci_desc_t sd,
|
||||
unsigned int localAdapterNo,
|
||||
unsigned int localNodeId,
|
||||
unsigned int remoteNodeId,
|
||||
unsigned int interruptNo);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* R E C E I V E I N T E R R U P T */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define ReceiveInterrupt _SISCI_DEMOLIB_EXPAND_NAME(ReceiveInterrupt)
|
||||
|
||||
sci_error_t ReceiveInterrupt(
|
||||
sci_desc_t sd,
|
||||
unsigned int localAdapterNo,
|
||||
unsigned int localNodeId,
|
||||
unsigned int interruptNo);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* E N D I A N S W A P */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define EndianSwap _SISCI_DEMOLIB_EXPAND_NAME(EndianSwap)
|
||||
|
||||
unsigned int EndianSwap (unsigned int value);
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
/* S L E E P M I L L I S E C O N D S */
|
||||
/* */
|
||||
/*********************************************************************************/
|
||||
|
||||
#define SleepMilliseconds _SISCI_DEMOLIB_EXPAND_NAME(SleepMilliseconds)
|
||||
|
||||
void SleepMilliseconds(int milliseconds);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -1,94 +0,0 @@
|
|||
/* $Id: sisci_error.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* 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 *
|
||||
* the Free Software Foundation; either version 2 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* 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 *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef _SISCI_ERROR_H_
|
||||
#define _SISCI_ERROR_H_
|
||||
|
||||
|
||||
/* SCI Error return values always have 30 bit set */
|
||||
#define SCI_ERR_MASK 0x40000000
|
||||
#define SCI_ERR_REMOTE_MASK 0x01 /* Remote errors should have bit 0 set */
|
||||
|
||||
#define SCI_ERR(u) ((unsigned32)(u)&0x7FFFFFFF )
|
||||
|
||||
/* Error codes */
|
||||
typedef enum {
|
||||
SCI_ERR_OK = 0x000,
|
||||
|
||||
|
||||
SCI_ERR_BUSY = (0x900 | SCI_ERR_MASK),
|
||||
SCI_ERR_FLAG_NOT_IMPLEMENTED = (0x901 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_FLAG = (0x902 | SCI_ERR_MASK),
|
||||
SCI_ERR_NOSPC = (0x904 | SCI_ERR_MASK),
|
||||
SCI_ERR_API_NOSPC = (0x905 | SCI_ERR_MASK),
|
||||
SCI_ERR_HW_NOSPC = (0x906 | SCI_ERR_MASK),
|
||||
SCI_ERR_NOT_IMPLEMENTED = (0x907 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_ADAPTERNO = (0x908 | SCI_ERR_MASK),
|
||||
SCI_ERR_NO_SUCH_ADAPTERNO = (0x909 | SCI_ERR_MASK),
|
||||
SCI_ERR_TIMEOUT = (0x90A | SCI_ERR_MASK),
|
||||
SCI_ERR_OUT_OF_RANGE = (0x90B | SCI_ERR_MASK),
|
||||
SCI_ERR_NO_SUCH_SEGMENT = (0x90C | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_NODEID = (0x90D | SCI_ERR_MASK),
|
||||
SCI_ERR_CONNECTION_REFUSED = (0x90E | SCI_ERR_MASK),
|
||||
SCI_ERR_SEGMENT_NOT_CONNECTED = (0x90F | SCI_ERR_MASK),
|
||||
SCI_ERR_SIZE_ALIGNMENT = (0x910 | SCI_ERR_MASK),
|
||||
SCI_ERR_OFFSET_ALIGNMENT = (0x911 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_PARAMETER = (0x912 | SCI_ERR_MASK),
|
||||
SCI_ERR_MAX_ENTRIES = (0x913 | SCI_ERR_MASK),
|
||||
SCI_ERR_SEGMENT_NOT_PREPARED = (0x914 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_ADDRESS = (0x915 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_OPERATION = (0x916 | SCI_ERR_MASK),
|
||||
SCI_ERR_ILLEGAL_QUERY = (0x917 | SCI_ERR_MASK),
|
||||
SCI_ERR_SEGMENTID_USED = (0x918 | SCI_ERR_MASK),
|
||||
SCI_ERR_SYSTEM = (0x919 | SCI_ERR_MASK),
|
||||
SCI_ERR_CANCELLED = (0x91A | SCI_ERR_MASK),
|
||||
SCI_ERR_NOT_CONNECTED = (0x91B | SCI_ERR_MASK),
|
||||
SCI_ERR_NOT_AVAILABLE = (0x91C | SCI_ERR_MASK),
|
||||
SCI_ERR_INCONSISTENT_VERSIONS = (0x91D | SCI_ERR_MASK),
|
||||
SCI_ERR_COND_INT_RACE_PROBLEM = (0x91E | SCI_ERR_MASK),
|
||||
SCI_ERR_OVERFLOW = (0x91F | SCI_ERR_MASK),
|
||||
SCI_ERR_NOT_INITIALIZED = (0x920 | SCI_ERR_MASK),
|
||||
|
||||
SCI_ERR_ACCESS = (0x921 | SCI_ERR_MASK),
|
||||
|
||||
SCI_ERR_NO_SUCH_NODEID = (0xA00 | SCI_ERR_MASK),
|
||||
SCI_ERR_NODE_NOT_RESPONDING = (0xA02 | SCI_ERR_MASK),
|
||||
SCI_ERR_NO_REMOTE_LINK_ACCESS = (0xA04 | SCI_ERR_MASK),
|
||||
SCI_ERR_NO_LINK_ACCESS = (0xA05 | SCI_ERR_MASK),
|
||||
SCI_ERR_TRANSFER_FAILED = (0xA06 | SCI_ERR_MASK),
|
||||
|
||||
SCI_ERR_EWOULD_BLOCK = ( 0xB00 | SCI_ERR_MASK),
|
||||
SCI_ERR_SEMAPHORE_COUNT_EXCEEDED = ( 0xB01 | SCI_ERR_MASK),
|
||||
SCI_ERR_IRQL_ILLEGAL = ( 0xB02 | SCI_ERR_MASK)
|
||||
|
||||
} sci_error_t;
|
||||
|
||||
|
||||
#endif /* _SCI_ERROR_H_ */
|
||||
|
||||
|
||||
|
133
ndb/src/external/WIN32.x86/sci/include/sisci_types.h
vendored
133
ndb/src/external/WIN32.x86/sci/include/sisci_types.h
vendored
|
@ -1,133 +0,0 @@
|
|||
/* $Id: sisci_types.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1993 - 2000 *
|
||||
* Dolphin Interconnect Solutions AS *
|
||||
* *
|
||||
* 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 *
|
||||
* the Free Software Foundation; either version 2 of the License, *
|
||||
* or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* 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 *
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#ifndef _SISCI_TYPES_H
|
||||
#define _SISCI_TYPES_H
|
||||
|
||||
#include "sisci_error.h"
|
||||
|
||||
#ifndef IN
|
||||
#define IN
|
||||
#endif
|
||||
|
||||
#ifndef OUT
|
||||
#define OUT
|
||||
#endif
|
||||
|
||||
#ifndef IN_OUT
|
||||
#define IN_OUT
|
||||
#endif
|
||||
|
||||
/* Opaque data types for descriptors/handles */
|
||||
typedef struct sci_desc *sci_desc_t;
|
||||
typedef struct sci_local_segment *sci_local_segment_t;
|
||||
typedef struct sci_remote_segment *sci_remote_segment_t;
|
||||
|
||||
typedef struct sci_map *sci_map_t;
|
||||
typedef struct sci_sequence *sci_sequence_t;
|
||||
#ifndef KERNEL
|
||||
typedef struct sci_dma_queue *sci_dma_queue_t;
|
||||
#endif
|
||||
typedef struct sci_remote_interrupt *sci_remote_interrupt_t;
|
||||
typedef struct sci_local_interrupt *sci_local_interrupt_t;
|
||||
typedef struct sci_block_transfer *sci_block_transfer_t;
|
||||
|
||||
/*
|
||||
* Constants defining reasons for segment callbacks:
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
SCI_CB_CONNECT = 1,
|
||||
SCI_CB_DISCONNECT,
|
||||
SCI_CB_NOT_OPERATIONAL,
|
||||
SCI_CB_OPERATIONAL,
|
||||
SCI_CB_LOST
|
||||
} sci_segment_cb_reason_t;
|
||||
|
||||
#define MAX_CB_REASON SCI_CB_LOST
|
||||
|
||||
/* dma_queue_states is identical to the dma_queue_state_t in genif.h, they must be consistent.*/
|
||||
typedef enum {
|
||||
SCI_DMAQUEUE_IDLE,
|
||||
SCI_DMAQUEUE_GATHER,
|
||||
SCI_DMAQUEUE_POSTED,
|
||||
SCI_DMAQUEUE_DONE,
|
||||
SCI_DMAQUEUE_ABORTED,
|
||||
SCI_DMAQUEUE_ERROR
|
||||
} sci_dma_queue_state_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
SCI_SEQ_OK,
|
||||
SCI_SEQ_RETRIABLE,
|
||||
SCI_SEQ_NOT_RETRIABLE,
|
||||
SCI_SEQ_PENDING
|
||||
} sci_sequence_status_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned short nodeId; /* SCI Address bit 63 - 48 */
|
||||
unsigned short offsHi; /* SCI Address bit 47 - 32 */
|
||||
unsigned int offsLo; /* SCI Address bit 31 - 0 */
|
||||
} sci_address_t;
|
||||
|
||||
|
||||
typedef unsigned int sci_ioaddr_t;
|
||||
|
||||
typedef enum {
|
||||
SCI_CALLBACK_CANCEL = 1,
|
||||
SCI_CALLBACK_CONTINUE
|
||||
} sci_callback_action_t;
|
||||
|
||||
#ifndef KERNEL
|
||||
typedef sci_callback_action_t (*sci_cb_local_segment_t)(void *arg,
|
||||
sci_local_segment_t segment,
|
||||
sci_segment_cb_reason_t reason,
|
||||
unsigned int nodeId,
|
||||
unsigned int localAdapterNo,
|
||||
sci_error_t error);
|
||||
|
||||
typedef sci_callback_action_t (*sci_cb_remote_segment_t)(void *arg,
|
||||
sci_remote_segment_t segment,
|
||||
sci_segment_cb_reason_t reason,
|
||||
sci_error_t status);
|
||||
|
||||
|
||||
typedef sci_callback_action_t (*sci_cb_dma_t)(void IN *arg,
|
||||
sci_dma_queue_t queue,
|
||||
sci_error_t status);
|
||||
|
||||
|
||||
typedef int (*sci_cb_block_transfer_t)(void *arg,
|
||||
sci_block_transfer_t block,
|
||||
sci_error_t status);
|
||||
|
||||
|
||||
typedef sci_callback_action_t (*sci_cb_interrupt_t)(void *arg,
|
||||
sci_local_interrupt_t interrupt,
|
||||
sci_error_t status);
|
||||
|
||||
#endif /* KERNEL */
|
||||
#endif
|
|
@ -4501,6 +4501,17 @@ void Dbacc::getdirindex(Signal* signal)
|
|||
/* BUCKET, AND SERCH FOR ELEMENT.THE PRIMARY KEYS WHICH IS SAVED */
|
||||
/* IN THE OPERATION REC ARE THE CHECK ITEMS IN THE SEARCHING. */
|
||||
/* --------------------------------------------------------------------------------- */
|
||||
|
||||
#if __ia64 == 1
|
||||
#if __INTEL_COMPILER == 810
|
||||
int ndb_acc_ia64_icc810_dummy_var = 0;
|
||||
void ndb_acc_ia64_icc810_dummy_func()
|
||||
{
|
||||
ndb_acc_ia64_icc810_dummy_var++;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void Dbacc::getElement(Signal* signal)
|
||||
{
|
||||
DirRangePtr geOverflowrangeptr;
|
||||
|
@ -4595,6 +4606,12 @@ void Dbacc::getElement(Signal* signal)
|
|||
/* WE HAVE FOUND THE ELEMENT. GET THE LOCK INDICATOR AND RETURN FOUND. */
|
||||
/* --------------------------------------------------------------------------------- */
|
||||
jam();
|
||||
#if __ia64 == 1
|
||||
#if __INTEL_COMPILER == 810
|
||||
// prevents SIGSEGV under icc -O1
|
||||
ndb_acc_ia64_icc810_dummy_func();
|
||||
#endif
|
||||
#endif
|
||||
tgeLocked = ElementHeader::getLocked(gePageptr.p->word32[tgeElementptr]);
|
||||
tgeResult = ZTRUE;
|
||||
TdataIndex = tgeElementptr + tgeForward;
|
||||
|
|
|
@ -8725,7 +8725,7 @@ void Dblqh::sendKeyinfo20(Signal* signal,
|
|||
sendSignal(ref, GSN_KEYINFO20, signal, 25, JBB);
|
||||
src += KeyInfo20::DataLength;;
|
||||
keyLen -= KeyInfo20::DataLength;
|
||||
} while(keyLen >= KeyInfo20::DataLength);
|
||||
}
|
||||
|
||||
MEMCOPY_NO_WORDS(keyInfo->keyData, src, keyLen);
|
||||
sendSignal(ref, GSN_KEYINFO20, signal,
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
include .defs.mk
|
||||
|
||||
TYPE = *
|
||||
|
||||
BIN_TARGET = tpcb
|
||||
|
||||
SOURCES = ttTime.c tpcb.cpp
|
||||
|
||||
CCFLAGS_LOC += \
|
||||
-I$(NDB_TOP)/include \
|
||||
-I$(NDB_TOP)/include/ndbapi \
|
||||
-I$(NDB_TOP)/include/portlib \
|
||||
-I$(NDB_TOP)/include/util \
|
||||
-I$(NDB_TOP)/test/include \
|
||||
-I/usr/local/include
|
||||
|
||||
CCFLAGS_WARNINGS += -Wno-unused -Wno-sign-compare -Wformat
|
||||
|
||||
CCFLAGS_TOP += -DndbODBC
|
||||
|
||||
BIN_TARGET_LIBS = NDB_API_pic NDB_ODBC_pic NDBT
|
||||
|
||||
ifeq ($(NDB_OS),SOLARIS)
|
||||
BIN_TARGET_LIBS += dmallocthcxx
|
||||
CCFLAGS_TOP += -DDMALLOC
|
||||
endif
|
||||
|
||||
include $(NDB_TOP)/Epilogue.mk
|
||||
|
||||
$(BIN_DIR)$(BIN_TARGET): Makefile
|
|
@ -1,33 +0,0 @@
|
|||
include $(NDB_TOP)/Defs.mk
|
||||
|
||||
TYPE = odbcclient
|
||||
|
||||
BIN_TARGET = tpcb
|
||||
|
||||
SOURCES = ttTime.c tpcb.cpp
|
||||
|
||||
CCFLAGS_LOC += -I/usr/local/include \
|
||||
-I$(NDB_TOP)/test/include \
|
||||
-I$(NDB_TOP)/include \
|
||||
-I$(NDB_TOP)/include/util \
|
||||
-I$(NDB_TOP)/src/client/odbc/common
|
||||
|
||||
|
||||
|
||||
|
||||
#CCFLAGS_WARNINGS += -Wno-unused
|
||||
|
||||
LIBS_LOC += -L/usr/local/lib
|
||||
BIN_TARGET_LIBS_DIRS += /usr/local/lib
|
||||
BIN_TARGET_LIBS += odbc odbcinst
|
||||
|
||||
#LIBS_SPEC += -pg
|
||||
# -lNDBT \
|
||||
# -lodbc \
|
||||
# -lodbcinst \
|
||||
# -lportlib
|
||||
|
||||
|
||||
|
||||
include $(NDB_TOP)/Epilogue.mk
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
include $(NDB_TOP)/Defs.mk
|
||||
|
||||
TYPE = *
|
||||
|
||||
BIN_TARGET = tpcb
|
||||
|
||||
SOURCES = ttTime.c tpcb.cpp
|
||||
|
||||
CCFLAGS_LOC += \
|
||||
-I$(NDB_TOP)/include \
|
||||
-I$(NDB_TOP)/include/ndbapi \
|
||||
-I$(NDB_TOP)/include/portlib \
|
||||
-I$(NDB_TOP)/include/util \
|
||||
-I$(NDB_TOP)/test/include \
|
||||
-I/usr/local/include
|
||||
|
||||
CCFLAGS_WARNINGS += -Wno-unused -Wno-sign-compare -Wformat
|
||||
|
||||
CCFLAGS_TOP += -DndbODBC
|
||||
|
||||
BIN_TARGET_LIBS = NDB_API_pic NDB_ODBC_pic NDBT
|
||||
|
||||
ifeq ($(NDB_OS),SOLARIS)
|
||||
BIN_TARGET_LIBS += dmallocthcxx
|
||||
CCFLAGS_TOP += -DDMALLOC
|
||||
endif
|
||||
|
||||
include $(NDB_TOP)/Epilogue.mk
|
||||
|
||||
$(BIN_DIR)$(BIN_TARGET): Makefile
|
|
@ -1,15 +0,0 @@
|
|||
'tpcb' requires an .odbc.ini file in
|
||||
/etc/
|
||||
or in
|
||||
/home/user/
|
||||
|
||||
The .odbc.ini file must contain a DSN entry called ndb:
|
||||
|
||||
#--------- .odbc.ini example --------------------
|
||||
|
||||
[ndb]
|
||||
Driver = /path_to_installation/lib/libNDB_ODBC.so
|
||||
|
||||
#--------- End of example -----------------------
|
||||
|
||||
|
|
@ -1,188 +0,0 @@
|
|||
/* Copyright (C) 2003 MySQL AB
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/*
|
||||
* $Revision: 1.1 $
|
||||
* (c) Copyright 1997-2003, TimesTen, Inc.
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef TIMESTEN_H_INCLUDED
|
||||
#define TIMESTEN_H_INCLUDED
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <sql.h>
|
||||
#include <sqltypes.h>
|
||||
#include <sqlext.h>
|
||||
/*
|
||||
* TimesTen extension to application data types; only usable
|
||||
* when application directly linked to the TimesTen driver.
|
||||
*/
|
||||
#define SQL_C_ADDR 100
|
||||
|
||||
#ifndef SQL_C_SBIGINT
|
||||
#if (ODBCVER < 0x0300)
|
||||
#define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET)
|
||||
#define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define SQL_C_BIGINT SQL_C_SBIGINT
|
||||
|
||||
#if (ODBCVER < 0x0300)
|
||||
#ifdef _WIN32
|
||||
typedef __int64 SQLBIGINT;
|
||||
/* On Unix platforms SQLBIGINT is defined in odbcinclude directory*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define BIGINT SQLBIGINT
|
||||
|
||||
#ifdef _WIN32
|
||||
#define UBIGINT unsigned __int64
|
||||
#else
|
||||
#define UBIGINT unsigned long long
|
||||
#endif
|
||||
|
||||
|
||||
#define SQL_WCHAR (-8)
|
||||
#define SQL_WVARCHAR (-9)
|
||||
#define SQL_WLONGVARCHAR (-10)
|
||||
#define SQL_C_WCHAR SQL_WCHAR
|
||||
|
||||
/* SQLGetInfo() InfoTypes */
|
||||
#define SQL_CONVERT_WCHAR 122
|
||||
#define SQL_CONVERT_WLONGVARCHAR 125
|
||||
#define SQL_CONVERT_WVARCHAR 126
|
||||
|
||||
/* TimesTen specific SQLGetInfo types */
|
||||
#define TT_REPLICATION_INVALID (SQL_INFO_DRIVER_START + 2000)
|
||||
|
||||
/* SQLGetInfo() return value bitmasks */
|
||||
#ifndef SQL_CVT_WCHAR
|
||||
/*
|
||||
** These definitions differ from Microsoft in that they are not
|
||||
** specified as long (e.g. 0x00200000L), hence they are protected
|
||||
** by the ifndef above.
|
||||
*/
|
||||
#define SQL_CVT_WCHAR 0x00200000
|
||||
#define SQL_CVT_WLONGVARCHAR 0x00400000
|
||||
#define SQL_CVT_WVARCHAR 0x00800000
|
||||
#endif
|
||||
|
||||
/*
|
||||
** The Microsoft Driver Manager SQLBindParameter() will not pass SQL_WCHAR
|
||||
** through. Use this hack to get around it.
|
||||
*/
|
||||
#define SQL_WCHAR_DM_SQLBINDPARAMETER_BYPASS -888
|
||||
|
||||
/* This is an extension to ODBC's isolation levels. It reflects an
|
||||
* earlier implementation of read-committed that released locks on
|
||||
* next fetch, rather than releasing locks before returning value to
|
||||
* application. */
|
||||
#define SQL_TXN_CURSOR_STABILITY 0x00001000
|
||||
#define SQL_TXN_NOBLOCK_DELETE 0x00002000
|
||||
|
||||
/* TimesTen-specific connection option */
|
||||
#define TT_PREFETCH_CLOSE 10001
|
||||
#define TT_PREFETCH_CLOSE_OFF 0
|
||||
#define TT_PREFETCH_CLOSE_ON 1
|
||||
|
||||
/* Adding a new sql connection option */
|
||||
#define TT_PREFETCH_COUNT 10003
|
||||
#define TT_PREFETCH_COUNT_MAX 128
|
||||
|
||||
/*
|
||||
* Platform specific data types for integers that scale
|
||||
* with pointer size
|
||||
*/
|
||||
|
||||
#ifdef _IA64_
|
||||
typedef signed __int64 tt_ptrint;
|
||||
typedef unsigned __int64 tt_uptrint;
|
||||
#else
|
||||
#ifdef _WIN32
|
||||
typedef signed long tt_ptrint;
|
||||
typedef unsigned long tt_uptrint;
|
||||
#else
|
||||
typedef signed long tt_ptrint;
|
||||
typedef unsigned long tt_uptrint;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef signed __int64 tt_int8;
|
||||
typedef unsigned __int64 tt_uint8;
|
||||
#else
|
||||
typedef signed long long tt_int8;
|
||||
typedef unsigned long long tt_uint8;
|
||||
#endif
|
||||
|
||||
/* printf formats for pointer-sized integers */
|
||||
#ifdef _IA64_ /* 64-bit NT */
|
||||
#define PTRINT_FMT "I64d"
|
||||
#define UPTRINT_FMT "I64u"
|
||||
#define xPTRINT_FMT "I64x"
|
||||
#define XPTRINT_FMT "I64X"
|
||||
#else
|
||||
#ifdef _WIN32 /* 32-bit NT */
|
||||
#define PTRINT_FMT "ld"
|
||||
#define UPTRINT_FMT "lu"
|
||||
#define xPTRINT_FMT "lx"
|
||||
#define XPTRINT_FMT "lX"
|
||||
#else /* 32 and 64-bit UNIX */
|
||||
#define PTRINT_FMT "ld"
|
||||
#define UPTRINT_FMT "lu"
|
||||
#define xPTRINT_FMT "lx"
|
||||
#define XPTRINT_FMT "lX"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* printf formats for 8-byte integers */
|
||||
#ifndef INT8_FMT_DEFINED
|
||||
#ifdef _WIN32 /* 32 and 64-bit NT */
|
||||
#define INT8_FMT "I64d"
|
||||
#define UINT8_FMT "I64u"
|
||||
#define xINT8_FMT "I64x"
|
||||
#define XINT8_FMT "I64X"
|
||||
#else /* 32 and 64-bit UNIX */
|
||||
#define INT8_FMT "lld"
|
||||
#define UINT8_FMT "llu"
|
||||
#define xINT8_FMT "llx"
|
||||
#define XINT8_FMT "llX"
|
||||
#endif
|
||||
#define INT8_FMT_DEFINED 1
|
||||
#endif
|
||||
|
||||
/* The following types are defined in the newer odbc include files
|
||||
from Microsoft
|
||||
*/
|
||||
#if defined (_WIN32) && !defined (_IA64_)
|
||||
#ifndef SQLROWSETSIZE
|
||||
#define SQLROWSETSIZE SQLUINTEGER
|
||||
#define SQLLEN SQLINTEGER
|
||||
#define SQLROWOFFSET SQLINTEGER
|
||||
#define SQLROWCOUNT SQLUINTEGER
|
||||
#define SQLULEN SQLUINTEGER
|
||||
#define SQLSETPOSIROW SQLUSMALLINT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load diff
|
@ -1,366 +0,0 @@
|
|||
/* Copyright (C) 2003 MySQL AB
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
static const volatile char cvsid[] = "$Id: ttTime.c,v 1.1 2003/09/23 12:43:46 johan Exp $";
|
||||
/*
|
||||
* $Revision: 1.1 $
|
||||
* (c) Copyright 1996-2003, TimesTen, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* Contains functions for performing elapsed-time calculations
|
||||
in a portable manner */
|
||||
|
||||
#include "ttTime.h"
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
#include <stdio.h>
|
||||
#include <mapiutil.h>
|
||||
|
||||
/*------------*/
|
||||
/* NT VERSION */
|
||||
/*------------*/
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* FUNCTION: ttGetThreadTimes
|
||||
*
|
||||
* DESCRIPTION: This function sets the supplied parameter's
|
||||
* user and kernel time for the current thread.
|
||||
*
|
||||
* PARAMETERS: ttThreadTimes* timesP thread time structure
|
||||
*
|
||||
* RETURNS: void
|
||||
*
|
||||
* NOTES: NONE
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
void
|
||||
ttGetThreadTimes(ttThreadTimes* timesP)
|
||||
{
|
||||
BOOL rc;
|
||||
HANDLE curThread;
|
||||
FILETIME creationTime;
|
||||
FILETIME exitTime;
|
||||
FILETIME kTime;
|
||||
FILETIME uTime;
|
||||
|
||||
memset (&kTime, 0, sizeof (FILETIME));
|
||||
memset (&uTime, 0, sizeof (FILETIME));
|
||||
|
||||
curThread = GetCurrentThread();
|
||||
rc = GetThreadTimes(curThread,
|
||||
&creationTime,
|
||||
&exitTime,
|
||||
&kTime,
|
||||
&uTime);
|
||||
|
||||
timesP->kernelTime = kTime;
|
||||
timesP->userTime = uTime;
|
||||
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* FUNCTION: ttCalcElapsedThreadTimes
|
||||
*
|
||||
* DESCRIPTION: This function calculates the user and kernel
|
||||
* time deltas.
|
||||
*
|
||||
* PARAMETERS: ttThreadTimes* beforeP beginning timestamp (IN)
|
||||
* ttThreadTimes* afterP ending timestamp (IN)
|
||||
* double* kernelDeltaP kernel time delta (OUT)
|
||||
* double* userDeltaP user time delta (OUT)
|
||||
*
|
||||
* RETURNS: void
|
||||
*
|
||||
* NOTES: NONE
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
void
|
||||
ttCalcElapsedThreadTimes(ttThreadTimes* beforeP,
|
||||
ttThreadTimes* afterP,
|
||||
double* kernelDeltaP,
|
||||
double* userDeltaP)
|
||||
{
|
||||
static const double secPerHi = (double) 4.294967296; /* 2**32 * 10**-9 */
|
||||
FILETIME *before, *after;
|
||||
|
||||
before = &beforeP->kernelTime;
|
||||
after = &afterP->kernelTime;
|
||||
*kernelDeltaP = (double) ((after->dwHighDateTime - before->dwHighDateTime) * secPerHi
|
||||
+ (after->dwLowDateTime - before->dwLowDateTime) * 100e-9);
|
||||
before = &beforeP->userTime;
|
||||
after = &afterP->userTime;
|
||||
*userDeltaP = (double) ((after->dwHighDateTime - before->dwHighDateTime) * secPerHi
|
||||
+ (after->dwLowDateTime - before->dwLowDateTime) * 100e-9);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* FUNCTION: ttGetWallClockTime
|
||||
*
|
||||
* DESCRIPTION: This function gets the current wall-clock time.
|
||||
*
|
||||
* PARAMETERS: ttWallClockTime* timeP tms time structure (OUT)
|
||||
*
|
||||
* RETURNS: void
|
||||
*
|
||||
* NOTES: NONE
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
void
|
||||
ttGetWallClockTime(ttWallClockTime* timeP)
|
||||
{
|
||||
LARGE_INTEGER frequency;
|
||||
if ( QueryPerformanceFrequency(&frequency) ) {
|
||||
QueryPerformanceCounter(&(timeP->time64));
|
||||
}
|
||||
else {
|
||||
_ftime(&(timeP->notSoLargeTime));
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* FUNCTION: ttCalcElapsedWallClockTime
|
||||
*
|
||||
* DESCRIPTION: This function calculates the elapsed wall-clock
|
||||
* time in msec.
|
||||
*
|
||||
* PARAMETERS: ttWallClockTime* beforeP starting timestamp
|
||||
* ttWallClockTime* afterP ending timestamp
|
||||
* double* nmillisecondsP elapsed time (OUT)
|
||||
*
|
||||
* RETURNS: void
|
||||
*
|
||||
* NOTES: NONE
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
void
|
||||
ttCalcElapsedWallClockTime(ttWallClockTime* beforeP,
|
||||
ttWallClockTime* afterP,
|
||||
double* nmillisecondsP)
|
||||
{
|
||||
LARGE_INTEGER frequency;
|
||||
|
||||
if ( QueryPerformanceFrequency(&frequency) ) {
|
||||
*nmillisecondsP = 1000 * ((double) (afterP->time64.QuadPart
|
||||
- beforeP->time64.QuadPart))
|
||||
/ frequency.QuadPart;
|
||||
|
||||
}
|
||||
else {
|
||||
double start;
|
||||
double end;
|
||||
|
||||
start = (double) beforeP->notSoLargeTime.time * 1000. +
|
||||
(double) beforeP->notSoLargeTime.millitm;
|
||||
end = (double) afterP->notSoLargeTime.time * 1000. +
|
||||
(double) afterP->notSoLargeTime.millitm;
|
||||
|
||||
*nmillisecondsP = (double) (end - start);
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined (RTSYS_VXWORKS)
|
||||
|
||||
/*-----------------*/
|
||||
/* VxWorks VERSION */
|
||||
/*-----------------*/
|
||||
|
||||
/*
|
||||
* The TimeBase registers have a period of 60ns, i.e.
|
||||
* 0.00000006 or (6e-8) seconds.
|
||||
*/
|
||||
#define TIMER_MSEC_PER_CYC (6e-5)
|
||||
|
||||
void
|
||||
ttGetWallClockTime(ttWallClockTime* timeP)
|
||||
{
|
||||
vxTimeBaseGet(&timeP->sep.upper32, &timeP->sep.lower32);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ttCalcElapsedWallClockTime(ttWallClockTime* beforeP,
|
||||
ttWallClockTime* afterP,
|
||||
double* nmillisecondsP)
|
||||
{
|
||||
*nmillisecondsP = (double)(afterP->val - beforeP->val) * TIMER_MSEC_PER_CYC;
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
/*--------------*/
|
||||
/* UNIX VERSION */
|
||||
/*--------------*/
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* FUNCTION: ttGetThreadTimes
|
||||
*
|
||||
* DESCRIPTION: This function sets the supplied parameter's
|
||||
* tms structure.
|
||||
*
|
||||
* PARAMETERS: ttThreadTimes* timesP tms time structure
|
||||
*
|
||||
* RETURNS: void
|
||||
*
|
||||
* NOTES: NONE
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
#ifdef SB_P_OS_CHORUS
|
||||
void ttGetThreadTimes(ttThreadTimes* timesP)
|
||||
{
|
||||
KnCap actorCap;
|
||||
|
||||
if (acap (agetId(), &actorCap) == -1) {
|
||||
timesP->ins.tmSec = 0;
|
||||
timesP->ins.tmNSec = 0;
|
||||
timesP->ext.tmSec = 0;
|
||||
timesP->ext.tmNSec = 0;
|
||||
}
|
||||
else {
|
||||
(void) threadTimes (&actorCap, K_ALLACTORTHREADS,
|
||||
×P->ins, ×P->ext);
|
||||
}
|
||||
}
|
||||
#else
|
||||
void ttGetThreadTimes(ttThreadTimes* timesP)
|
||||
{
|
||||
(void) times(timesP);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* FUNCTION: ttCalcElapsedThreadTimes
|
||||
*
|
||||
* DESCRIPTION: This function calculates the user and kernel
|
||||
* time deltas.
|
||||
*
|
||||
* PARAMETERS: ttThreadTimes* beforeP beginning timestamp (IN)
|
||||
* ttThreadTimes* afterP ending timestamp (IN)
|
||||
* double* kernelDeltaP kernel time delta (OUT)
|
||||
* double* userDeltaP user time delta (OUT)
|
||||
*
|
||||
* RETURNS: void
|
||||
*
|
||||
* NOTES: NONE
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
#ifdef SB_P_OS_CHORUS
|
||||
void
|
||||
ttCalcElapsedThreadTimes(ttThreadTimes* beforeP,
|
||||
ttThreadTimes* afterP,
|
||||
double* kernelDeltaP,
|
||||
double* userDeltaP)
|
||||
{
|
||||
double kernelBefore;
|
||||
double kernelAfter;
|
||||
double userBefore;
|
||||
double userAfter;
|
||||
|
||||
kernelBefore = (beforeP->ext.tmSec) + (beforeP->ext.tmNSec / 1e9);
|
||||
kernelAfter = (afterP->ext.tmSec) + (afterP->ext.tmNSec / 1e9);
|
||||
*kernelDeltaP = kernelAfter - kernelBefore;
|
||||
|
||||
userBefore = (beforeP->ins.tmSec) + (beforeP->ins.tmNSec / 1e9);
|
||||
userAfter = (afterP->ins.tmSec) + (afterP->ins.tmNSec / 1e9);
|
||||
*userDeltaP = userAfter - userBefore;
|
||||
|
||||
}
|
||||
#else
|
||||
void
|
||||
ttCalcElapsedThreadTimes(ttThreadTimes* beforeP,
|
||||
ttThreadTimes* afterP,
|
||||
double* kernelDeltaP,
|
||||
double* userDeltaP)
|
||||
{
|
||||
double ticks = (double)sysconf(_SC_CLK_TCK);
|
||||
|
||||
*kernelDeltaP = (afterP->tms_stime - beforeP->tms_stime) / ticks;
|
||||
*userDeltaP = (afterP->tms_utime - beforeP->tms_utime) / ticks;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* FUNCTION: ttGetWallClockTime
|
||||
*
|
||||
* DESCRIPTION: This function gets the current wall-clock time.
|
||||
*
|
||||
* PARAMETERS: ttWallClockTime* timeP tms time structure (OUT)
|
||||
*
|
||||
* RETURNS: void
|
||||
*
|
||||
* NOTES: NONE
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
void
|
||||
ttGetWallClockTime(ttWallClockTime* timeP)
|
||||
{
|
||||
gettimeofday(timeP, NULL);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* FUNCTION: ttCalcElapsedWallClockTime
|
||||
*
|
||||
* DESCRIPTION: This function calculates the elapsed wall-clock
|
||||
* time is msec.
|
||||
*
|
||||
* PARAMETERS: ttWallClockTime* beforeP starting timestamp
|
||||
* ttWallClockTime* afterP ending timestamp
|
||||
* double* nmillisecondsP elapsed time (OUT)
|
||||
*
|
||||
* RETURNS: void
|
||||
*
|
||||
* NOTES: NONE
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
void
|
||||
ttCalcElapsedWallClockTime(ttWallClockTime* beforeP,
|
||||
ttWallClockTime* afterP,
|
||||
double* nmillisP)
|
||||
{
|
||||
*nmillisP = (afterP->tv_sec - beforeP->tv_sec)*1000.0 +
|
||||
(afterP->tv_usec - beforeP->tv_usec)/1000.0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Emacs variable settings */
|
||||
/* Local Variables: */
|
||||
/* tab-width:8 */
|
||||
/* indent-tabs-mode:nil */
|
||||
/* c-basic-offset:2 */
|
||||
/* End: */
|
|
@ -1,125 +0,0 @@
|
|||
/* Copyright (C) 2003 MySQL AB
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
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
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/*
|
||||
* $Revision: 1.1 $
|
||||
* (c) Copyright 1996-2003, TimesTen, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __TT_TIME
|
||||
#define __TT_TIME
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
#include <windows.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/timeb.h>
|
||||
|
||||
typedef struct {
|
||||
FILETIME kernelTime;
|
||||
FILETIME userTime;
|
||||
} ttThreadTimes;
|
||||
|
||||
|
||||
typedef union {
|
||||
LARGE_INTEGER time64;
|
||||
struct _timeb notSoLargeTime;
|
||||
} ttWallClockTime;
|
||||
|
||||
#elif defined(RTSYS_VXWORKS)
|
||||
|
||||
#define srand48(x) sb_srand48((x))
|
||||
#define drand48() sb_drand48()
|
||||
|
||||
#ifdef SB_P_OS_VXPPC
|
||||
/* For little-endian switch the lower, upper fields */
|
||||
typedef union {
|
||||
struct {
|
||||
unsigned int upper32;
|
||||
unsigned int lower32;
|
||||
} sep;
|
||||
long long val;
|
||||
} ttWallClockTime;
|
||||
|
||||
/*
|
||||
* This is a VxWorks private function to read the PPC's 64 bit Time Base
|
||||
* Register. This is the assembler dump of this function.
|
||||
001126e4 7cad42e6 mftb r5, TBU
|
||||
001126e8 7ccc42e6 mftb r6, TBL
|
||||
001126ec 7ced42e6 mftb r7, TBU
|
||||
001126f0 7c053800 cmp crf0, 0, r5, r7
|
||||
001126f4 4082fff0 bc 0x4, 0x2, vxTimeBaseGet
|
||||
001126f8 90a30000 stw r5, 0x0(r3)
|
||||
001126fc 90c40000 stw r6, 0x0(r4)
|
||||
00112700 4e800020 blr
|
||||
* This is a fine grained timer with a period of 60ns.
|
||||
*/
|
||||
void vxTimeBaseGet(unsigned int* pUpper32, unsigned int* pLower32);
|
||||
#endif /* SB_P_OS_VXPPC */
|
||||
|
||||
#elif defined(SB_P_OS_CHORUS)
|
||||
#include <sys/types.h>
|
||||
#include <sys/times.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <vtimer/chVtimer.h>
|
||||
|
||||
struct chrTimes {
|
||||
KnTimeVal ins;
|
||||
KnTimeVal ext;
|
||||
};
|
||||
typedef struct chrTimes ttThreadTimes;
|
||||
|
||||
typedef struct timeval ttWallClockTime;
|
||||
|
||||
#else
|
||||
/* UNIX version */
|
||||
|
||||
#include <sys/times.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
typedef struct tms ttThreadTimes;
|
||||
|
||||
typedef struct timeval ttWallClockTime;
|
||||
|
||||
#endif /* NT, VxWorks, Chorus, Unix */
|
||||
|
||||
|
||||
#ifndef RTSYS_VXWORKS
|
||||
void ttGetThreadTimes(ttThreadTimes* timesP);
|
||||
void ttCalcElapsedThreadTimes(ttThreadTimes* beforeP, ttThreadTimes* afterP,
|
||||
double* kernelDeltaP, double* userDeltaP);
|
||||
#endif /* ! VXWORKS */
|
||||
void ttGetWallClockTime(ttWallClockTime* timeP);
|
||||
void ttCalcElapsedWallClockTime(ttWallClockTime* beforeP,
|
||||
ttWallClockTime* afterP,
|
||||
double* nmillisecondsP);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __TT_TIME */
|
||||
|
||||
/* Emacs variable settings */
|
||||
/* Local Variables: */
|
||||
/* tab-width:8 */
|
||||
/* indent-tabs-mode:nil */
|
||||
/* c-basic-offset:2 */
|
||||
/* End: */
|
|
@ -459,7 +459,7 @@ setup_config(atrt_config& config){
|
|||
proc.m_type = atrt_process::NDB_MGM;
|
||||
proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_mgmd");
|
||||
proc.m_proc.m_path.assign(dir).append("/libexec/ndb_mgmd");
|
||||
proc.m_proc.m_args = "--nodaemon -c initconfig.txt";
|
||||
proc.m_proc.m_args = "--nodaemon -f config.ini";
|
||||
proc.m_proc.m_cwd.appfmt("%d.ndb_mgmd", index);
|
||||
connect_string.appfmt("host=%s:%d;",
|
||||
proc.m_hostname.c_str(), proc.m_ndb_mgm_port);
|
||||
|
|
|
@ -234,13 +234,13 @@ int berkeley_show_logs(Protocol *protocol)
|
|||
{
|
||||
char **all_logs, **free_logs, **a, **f;
|
||||
int error=1;
|
||||
MEM_ROOT show_logs_root;
|
||||
MEM_ROOT *old_root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC);
|
||||
MEM_ROOT **root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**,THR_MALLOC);
|
||||
MEM_ROOT show_logs_root, *old_mem_root= *root_ptr;
|
||||
DBUG_ENTER("berkeley_show_logs");
|
||||
|
||||
init_sql_alloc(&show_logs_root, BDB_LOG_ALLOC_BLOCK_SIZE,
|
||||
BDB_LOG_ALLOC_BLOCK_SIZE);
|
||||
my_pthread_setspecific_ptr(THR_MALLOC,&show_logs_root);
|
||||
*root_ptr= &show_logs_root;
|
||||
|
||||
if ((error= db_env->log_archive(db_env, &all_logs,
|
||||
DB_ARCH_ABS | DB_ARCH_LOG)) ||
|
||||
|
@ -277,15 +277,17 @@ int berkeley_show_logs(Protocol *protocol)
|
|||
}
|
||||
err:
|
||||
free_root(&show_logs_root,MYF(0));
|
||||
my_pthread_setspecific_ptr(THR_MALLOC,old_root);
|
||||
*root_ptr= old_mem_root;
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
||||
static void berkeley_print_error(const char *db_errpfx, char *buffer)
|
||||
{
|
||||
sql_print_error("%s: %s",db_errpfx,buffer); /* purecov: tested */
|
||||
}
|
||||
|
||||
|
||||
static void berkeley_noticecall(DB_ENV *db_env, db_notices notice)
|
||||
{
|
||||
switch (notice)
|
||||
|
|
|
@ -2318,6 +2318,34 @@ ha_innobase::write_row(
|
|||
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
|
||||
table->timestamp_field->set_time();
|
||||
|
||||
if (user_thd->lex->sql_command == SQLCOM_ALTER_TABLE
|
||||
&& num_write_row >= 10000) {
|
||||
/* ALTER TABLE is COMMITted at every 10000 copied rows.
|
||||
The IX table lock for the original table has to be re-issued.
|
||||
As this method will be called on a temporary table where the
|
||||
contents of the original table is being copied to, it is
|
||||
a bit tricky to determine the source table. The cursor
|
||||
position in the source table need not be adjusted after the
|
||||
intermediate COMMIT, since writes by other transactions are
|
||||
being blocked by a MySQL table lock TL_WRITE_ALLOW_READ. */
|
||||
ut_a(prebuilt->trx->mysql_n_tables_locked == 2);
|
||||
ut_a(UT_LIST_GET_LEN(prebuilt->trx->trx_locks) >= 2);
|
||||
dict_table_t* table = lock_get_ix_table(
|
||||
UT_LIST_GET_FIRST(prebuilt->trx->trx_locks));
|
||||
num_write_row = 0;
|
||||
/* Commit the transaction. This will release the table
|
||||
locks, so they have to be acquired again. */
|
||||
innobase_commit(user_thd, prebuilt->trx);
|
||||
/* Note that this transaction is still active. */
|
||||
user_thd->transaction.all.innodb_active_trans = 1;
|
||||
/* Re-acquire the IX table lock on the source table. */
|
||||
row_lock_table_for_mysql(prebuilt, table);
|
||||
/* We will need an IX lock on the destination table. */
|
||||
prebuilt->sql_stat_start = TRUE;
|
||||
}
|
||||
|
||||
num_write_row++;
|
||||
|
||||
if (last_query_id != user_thd->query_id) {
|
||||
prebuilt->sql_stat_start = TRUE;
|
||||
last_query_id = user_thd->query_id;
|
||||
|
@ -4913,7 +4941,7 @@ ha_innobase::external_lock(
|
|||
if (thd->in_lock_tables &&
|
||||
thd->variables.innodb_table_locks) {
|
||||
ulint error;
|
||||
error = row_lock_table_for_mysql(prebuilt);
|
||||
error = row_lock_table_for_mysql(prebuilt, 0);
|
||||
|
||||
if (error != DB_SUCCESS) {
|
||||
error = convert_error_code_to_mysql(
|
||||
|
|
|
@ -64,6 +64,7 @@ class ha_innobase: public handler
|
|||
uint last_match_mode;/* match mode of the latest search:
|
||||
ROW_SEL_EXACT, ROW_SEL_EXACT_PREFIX,
|
||||
or undefined */
|
||||
uint num_write_row; /* number of write_row() calls */
|
||||
longlong auto_inc_counter_for_this_stat;
|
||||
ulong max_supported_row_length(const byte *buf);
|
||||
|
||||
|
@ -85,7 +86,8 @@ class ha_innobase: public handler
|
|||
HA_PRIMARY_KEY_IN_READ_INDEX |
|
||||
HA_TABLE_SCAN_ON_INDEX),
|
||||
last_dup_key((uint) -1),
|
||||
start_of_scan(0)
|
||||
start_of_scan(0),
|
||||
num_write_row(0)
|
||||
{
|
||||
}
|
||||
~ha_innobase() {}
|
||||
|
|
|
@ -324,7 +324,7 @@ int ha_ndbcluster::ndb_err(NdbConnection *trans)
|
|||
DBUG_PRINT("info", ("transformed ndbcluster error %d to mysql error %d",
|
||||
err.code, res));
|
||||
if (res == HA_ERR_FOUND_DUPP_KEY)
|
||||
dupkey= table->primary_key;
|
||||
m_dupkey= table->primary_key;
|
||||
|
||||
DBUG_RETURN(res);
|
||||
}
|
||||
|
@ -551,7 +551,7 @@ int ha_ndbcluster::get_ndb_blobs_value(NdbBlob *last_ndb_blob)
|
|||
blob_size+= 8 - blob_size % 8;
|
||||
if (loop == 1)
|
||||
{
|
||||
char *buf= blobs_buffer + offset;
|
||||
char *buf= m_blobs_buffer + offset;
|
||||
uint32 len= 0xffffffff; // Max uint32
|
||||
DBUG_PRINT("value", ("read blob ptr=%x len=%u",
|
||||
(uint)buf, (uint)blob_len));
|
||||
|
@ -563,15 +563,15 @@ int ha_ndbcluster::get_ndb_blobs_value(NdbBlob *last_ndb_blob)
|
|||
offset+= blob_size;
|
||||
}
|
||||
}
|
||||
if (loop == 0 && offset > blobs_buffer_size)
|
||||
if (loop == 0 && offset > m_blobs_buffer_size)
|
||||
{
|
||||
my_free(blobs_buffer, MYF(MY_ALLOW_ZERO_PTR));
|
||||
blobs_buffer_size= 0;
|
||||
my_free(m_blobs_buffer, MYF(MY_ALLOW_ZERO_PTR));
|
||||
m_blobs_buffer_size= 0;
|
||||
DBUG_PRINT("value", ("allocate blobs buffer size %u", offset));
|
||||
blobs_buffer= my_malloc(offset, MYF(MY_WME));
|
||||
if (blobs_buffer == NULL)
|
||||
m_blobs_buffer= my_malloc(offset, MYF(MY_WME));
|
||||
if (m_blobs_buffer == NULL)
|
||||
DBUG_RETURN(-1);
|
||||
blobs_buffer_size= offset;
|
||||
m_blobs_buffer_size= offset;
|
||||
}
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
|
@ -854,7 +854,7 @@ int ha_ndbcluster::get_ndb_lock_type(enum thr_lock_type type)
|
|||
{
|
||||
if (type >= TL_WRITE_ALLOW_WRITE)
|
||||
return NdbOperation::LM_Exclusive;
|
||||
else if (uses_blob_value(retrieve_all_fields))
|
||||
else if (uses_blob_value(m_retrieve_all_fields))
|
||||
return NdbOperation::LM_Read;
|
||||
else
|
||||
return NdbOperation::LM_CommittedRead;
|
||||
|
@ -1018,7 +1018,7 @@ int ha_ndbcluster::pk_read(const byte *key, uint key_len, byte *buf)
|
|||
{
|
||||
Field *field= table->field[i];
|
||||
if ((thd->query_id == field->query_id) ||
|
||||
retrieve_all_fields)
|
||||
m_retrieve_all_fields)
|
||||
{
|
||||
if (get_ndb_value(op, field, i, buf))
|
||||
ERR_RETURN(trans->getNdbError());
|
||||
|
@ -1055,7 +1055,7 @@ int ha_ndbcluster::complemented_pk_read(const byte *old_data, byte *new_data)
|
|||
THD *thd= current_thd;
|
||||
DBUG_ENTER("complemented_pk_read");
|
||||
|
||||
if (retrieve_all_fields)
|
||||
if (m_retrieve_all_fields)
|
||||
// We have allready retrieved all fields, nothing to complement
|
||||
DBUG_RETURN(0);
|
||||
|
||||
|
@ -1192,12 +1192,12 @@ inline int ha_ndbcluster::next_result(byte *buf)
|
|||
/*
|
||||
We can only handle one tuple with blobs at a time.
|
||||
*/
|
||||
if (ops_pending && blobs_pending)
|
||||
if (m_ops_pending && m_blobs_pending)
|
||||
{
|
||||
if (execute_no_commit(this,trans) != 0)
|
||||
DBUG_RETURN(ndb_err(trans));
|
||||
ops_pending= 0;
|
||||
blobs_pending= FALSE;
|
||||
m_ops_pending= 0;
|
||||
m_blobs_pending= FALSE;
|
||||
}
|
||||
check= cursor->nextResult(contact_ndb);
|
||||
if (check == 0)
|
||||
|
@ -1219,8 +1219,8 @@ inline int ha_ndbcluster::next_result(byte *buf)
|
|||
all pending update or delete operations should
|
||||
be sent to NDB
|
||||
*/
|
||||
DBUG_PRINT("info", ("ops_pending: %d", ops_pending));
|
||||
if (ops_pending)
|
||||
DBUG_PRINT("info", ("ops_pending: %d", m_ops_pending));
|
||||
if (m_ops_pending)
|
||||
{
|
||||
if (current_thd->transaction.on)
|
||||
{
|
||||
|
@ -1234,7 +1234,7 @@ inline int ha_ndbcluster::next_result(byte *buf)
|
|||
int res= trans->restart();
|
||||
DBUG_ASSERT(res == 0);
|
||||
}
|
||||
ops_pending= 0;
|
||||
m_ops_pending= 0;
|
||||
}
|
||||
|
||||
contact_ndb= (check == 2);
|
||||
|
@ -1423,7 +1423,7 @@ int ha_ndbcluster::define_read_attrs(byte* buf, NdbOperation* op)
|
|||
Field *field= table->field[i];
|
||||
if ((thd->query_id == field->query_id) ||
|
||||
(field->flags & PRI_KEY_FLAG) ||
|
||||
retrieve_all_fields)
|
||||
m_retrieve_all_fields)
|
||||
{
|
||||
if (get_ndb_value(op, field, i, buf))
|
||||
ERR_RETURN(op->getNdbError());
|
||||
|
@ -1668,9 +1668,9 @@ int ha_ndbcluster::write_row(byte *record)
|
|||
|
||||
if (has_auto_increment)
|
||||
{
|
||||
skip_auto_increment= FALSE;
|
||||
m_skip_auto_increment= FALSE;
|
||||
update_auto_increment();
|
||||
skip_auto_increment= !auto_increment_column_changed;
|
||||
m_skip_auto_increment= !auto_increment_column_changed;
|
||||
}
|
||||
|
||||
if ((res= set_primary_key(op)))
|
||||
|
@ -1685,7 +1685,7 @@ int ha_ndbcluster::write_row(byte *record)
|
|||
if (!(field->flags & PRI_KEY_FLAG) &&
|
||||
set_ndb_value(op, field, i, &set_blob_value))
|
||||
{
|
||||
skip_auto_increment= TRUE;
|
||||
m_skip_auto_increment= TRUE;
|
||||
ERR_RETURN(op->getNdbError());
|
||||
}
|
||||
}
|
||||
|
@ -1697,25 +1697,25 @@ int ha_ndbcluster::write_row(byte *record)
|
|||
to NoCommit the transaction between each row.
|
||||
Find out how this is detected!
|
||||
*/
|
||||
rows_inserted++;
|
||||
m_rows_inserted++;
|
||||
no_uncommitted_rows_update(1);
|
||||
bulk_insert_not_flushed= TRUE;
|
||||
if ((rows_to_insert == 1) ||
|
||||
((rows_inserted % bulk_insert_rows) == 0) ||
|
||||
m_bulk_insert_not_flushed= TRUE;
|
||||
if ((m_rows_to_insert == 1) ||
|
||||
((m_rows_inserted % m_bulk_insert_rows) == 0) ||
|
||||
set_blob_value)
|
||||
{
|
||||
THD *thd= current_thd;
|
||||
// Send rows to NDB
|
||||
DBUG_PRINT("info", ("Sending inserts to NDB, "\
|
||||
"rows_inserted:%d, bulk_insert_rows: %d",
|
||||
(int)rows_inserted, (int)bulk_insert_rows));
|
||||
(int)m_rows_inserted, (int)m_bulk_insert_rows));
|
||||
|
||||
bulk_insert_not_flushed= FALSE;
|
||||
m_bulk_insert_not_flushed= FALSE;
|
||||
if (thd->transaction.on)
|
||||
{
|
||||
if (execute_no_commit(this,trans) != 0)
|
||||
{
|
||||
skip_auto_increment= TRUE;
|
||||
m_skip_auto_increment= TRUE;
|
||||
no_uncommitted_rows_execute_failure();
|
||||
DBUG_RETURN(ndb_err(trans));
|
||||
}
|
||||
|
@ -1724,7 +1724,7 @@ int ha_ndbcluster::write_row(byte *record)
|
|||
{
|
||||
if (execute_commit(this,trans) != 0)
|
||||
{
|
||||
skip_auto_increment= TRUE;
|
||||
m_skip_auto_increment= TRUE;
|
||||
no_uncommitted_rows_execute_failure();
|
||||
DBUG_RETURN(ndb_err(trans));
|
||||
}
|
||||
|
@ -1732,7 +1732,7 @@ int ha_ndbcluster::write_row(byte *record)
|
|||
DBUG_ASSERT(res == 0);
|
||||
}
|
||||
}
|
||||
if ((has_auto_increment) && (skip_auto_increment))
|
||||
if ((has_auto_increment) && (m_skip_auto_increment))
|
||||
{
|
||||
Uint64 next_val= (Uint64) table->next_number_field->val_int() + 1;
|
||||
DBUG_PRINT("info",
|
||||
|
@ -1742,7 +1742,7 @@ int ha_ndbcluster::write_row(byte *record)
|
|||
DBUG_PRINT("info",
|
||||
("Setting next auto increment value to %u", next_val));
|
||||
}
|
||||
skip_auto_increment= TRUE;
|
||||
m_skip_auto_increment= TRUE;
|
||||
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
@ -1822,7 +1822,9 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
|
|||
}
|
||||
// Delete old row
|
||||
DBUG_PRINT("info", ("insert succeded"));
|
||||
m_primary_key_update= TRUE;
|
||||
delete_res= delete_row(old_data);
|
||||
m_primary_key_update= FALSE;
|
||||
if (delete_res)
|
||||
{
|
||||
DBUG_PRINT("info", ("delete failed"));
|
||||
|
@ -1845,9 +1847,9 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
|
|||
DBUG_PRINT("info", ("Calling updateTuple on cursor"));
|
||||
if (!(op= cursor->updateTuple()))
|
||||
ERR_RETURN(trans->getNdbError());
|
||||
ops_pending++;
|
||||
m_ops_pending++;
|
||||
if (uses_blob_value(FALSE))
|
||||
blobs_pending= TRUE;
|
||||
m_blobs_pending= TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1924,7 +1926,7 @@ int ha_ndbcluster::delete_row(const byte *record)
|
|||
DBUG_PRINT("info", ("Calling deleteTuple on cursor"));
|
||||
if (cursor->deleteTuple() != 0)
|
||||
ERR_RETURN(trans->getNdbError());
|
||||
ops_pending++;
|
||||
m_ops_pending++;
|
||||
|
||||
no_uncommitted_rows_update(-1);
|
||||
|
||||
|
@ -1954,8 +1956,10 @@ int ha_ndbcluster::delete_row(const byte *record)
|
|||
else
|
||||
{
|
||||
int res;
|
||||
if ((res= set_primary_key(op)))
|
||||
return res;
|
||||
if ((res= (m_primary_key_update ?
|
||||
set_primary_key_from_old_data(op, record)
|
||||
: set_primary_key(op))))
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2417,18 +2421,18 @@ int ha_ndbcluster::close_scan()
|
|||
DBUG_RETURN(1);
|
||||
|
||||
|
||||
if (ops_pending)
|
||||
if (m_ops_pending)
|
||||
{
|
||||
/*
|
||||
Take over any pending transactions to the
|
||||
deleteing/updating transaction before closing the scan
|
||||
*/
|
||||
DBUG_PRINT("info", ("ops_pending: %d", ops_pending));
|
||||
DBUG_PRINT("info", ("ops_pending: %d", m_ops_pending));
|
||||
if (execute_no_commit(this,trans) != 0) {
|
||||
no_uncommitted_rows_execute_failure();
|
||||
DBUG_RETURN(ndb_err(trans));
|
||||
}
|
||||
ops_pending= 0;
|
||||
m_ops_pending= 0;
|
||||
}
|
||||
|
||||
cursor->close();
|
||||
|
@ -2563,7 +2567,7 @@ void ha_ndbcluster::info(uint flag)
|
|||
if (flag & HA_STATUS_ERRKEY)
|
||||
{
|
||||
DBUG_PRINT("info", ("HA_STATUS_ERRKEY"));
|
||||
errkey= dupkey;
|
||||
errkey= m_dupkey;
|
||||
}
|
||||
if (flag & HA_STATUS_AUTO)
|
||||
DBUG_PRINT("info", ("HA_STATUS_AUTO"));
|
||||
|
@ -2672,7 +2676,7 @@ int ha_ndbcluster::extra(enum ha_extra_function operation)
|
|||
where field->query_id is the same as
|
||||
the current query id */
|
||||
DBUG_PRINT("info", ("HA_EXTRA_RETRIEVE_ALL_COLS"));
|
||||
retrieve_all_fields= TRUE;
|
||||
m_retrieve_all_fields= TRUE;
|
||||
break;
|
||||
case HA_EXTRA_PREPARE_FOR_DELETE:
|
||||
DBUG_PRINT("info", ("HA_EXTRA_PREPARE_FOR_DELETE"));
|
||||
|
@ -2718,8 +2722,8 @@ void ha_ndbcluster::start_bulk_insert(ha_rows rows)
|
|||
DBUG_ENTER("start_bulk_insert");
|
||||
DBUG_PRINT("enter", ("rows: %d", (int)rows));
|
||||
|
||||
rows_inserted= 0;
|
||||
rows_to_insert= rows;
|
||||
m_rows_inserted= 0;
|
||||
m_rows_to_insert= rows;
|
||||
|
||||
/*
|
||||
Calculate how many rows that should be inserted
|
||||
|
@ -2733,7 +2737,7 @@ void ha_ndbcluster::start_bulk_insert(ha_rows rows)
|
|||
batch= bytesperbatch/bytes;
|
||||
batch= batch == 0 ? 1 : batch;
|
||||
DBUG_PRINT("info", ("batch: %d, bytes: %d", batch, bytes));
|
||||
bulk_insert_rows= batch;
|
||||
m_bulk_insert_rows= batch;
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
@ -2747,22 +2751,22 @@ int ha_ndbcluster::end_bulk_insert()
|
|||
|
||||
DBUG_ENTER("end_bulk_insert");
|
||||
// Check if last inserts need to be flushed
|
||||
if (bulk_insert_not_flushed)
|
||||
if (m_bulk_insert_not_flushed)
|
||||
{
|
||||
NdbConnection *trans= m_active_trans;
|
||||
// Send rows to NDB
|
||||
DBUG_PRINT("info", ("Sending inserts to NDB, "\
|
||||
"rows_inserted:%d, bulk_insert_rows: %d",
|
||||
rows_inserted, bulk_insert_rows));
|
||||
bulk_insert_not_flushed= FALSE;
|
||||
m_rows_inserted, m_bulk_insert_rows));
|
||||
m_bulk_insert_not_flushed= FALSE;
|
||||
if (execute_no_commit(this,trans) != 0) {
|
||||
no_uncommitted_rows_execute_failure();
|
||||
my_errno= error= ndb_err(trans);
|
||||
}
|
||||
}
|
||||
|
||||
rows_inserted= 0;
|
||||
rows_to_insert= 1;
|
||||
m_rows_inserted= 0;
|
||||
m_rows_to_insert= 1;
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
@ -2948,8 +2952,8 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
|
|||
(NdbConnection*)thd->transaction.stmt.ndb_tid;
|
||||
DBUG_ASSERT(m_active_trans);
|
||||
// Start of transaction
|
||||
retrieve_all_fields= FALSE;
|
||||
ops_pending= 0;
|
||||
m_retrieve_all_fields= FALSE;
|
||||
m_ops_pending= 0;
|
||||
{
|
||||
NDBDICT *dict= m_ndb->getDictionary();
|
||||
const NDBTAB *tab;
|
||||
|
@ -2997,13 +3001,13 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
|
|||
DBUG_PRINT("warning", ("m_active_cursor != NULL"));
|
||||
m_active_cursor= NULL;
|
||||
|
||||
if (blobs_pending)
|
||||
if (m_blobs_pending)
|
||||
DBUG_PRINT("warning", ("blobs_pending != 0"));
|
||||
blobs_pending= 0;
|
||||
m_blobs_pending= 0;
|
||||
|
||||
if (ops_pending)
|
||||
if (m_ops_pending)
|
||||
DBUG_PRINT("warning", ("ops_pending != 0L"));
|
||||
ops_pending= 0;
|
||||
m_ops_pending= 0;
|
||||
}
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
@ -3040,8 +3044,8 @@ int ha_ndbcluster::start_stmt(THD *thd)
|
|||
m_active_trans= trans;
|
||||
|
||||
// Start of statement
|
||||
retrieve_all_fields= FALSE;
|
||||
ops_pending= 0;
|
||||
m_retrieve_all_fields= FALSE;
|
||||
m_ops_pending= 0;
|
||||
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
@ -3583,10 +3587,10 @@ ulonglong ha_ndbcluster::get_auto_increment()
|
|||
Uint64 auto_value;
|
||||
DBUG_ENTER("get_auto_increment");
|
||||
DBUG_PRINT("enter", ("m_tabname: %s", m_tabname));
|
||||
cache_size= ((rows_to_insert - rows_inserted < autoincrement_prefetch) ?
|
||||
rows_to_insert - rows_inserted :
|
||||
max(rows_to_insert, autoincrement_prefetch));
|
||||
auto_value= ((skip_auto_increment) ?
|
||||
cache_size= ((m_rows_to_insert - m_rows_inserted < autoincrement_prefetch) ?
|
||||
m_rows_to_insert - m_rows_inserted :
|
||||
max(m_rows_to_insert, autoincrement_prefetch));
|
||||
auto_value= ((m_skip_auto_increment) ?
|
||||
m_ndb->readAutoIncrementValue((const NDBTAB *) m_table) :
|
||||
m_ndb->getAutoIncrementValue((const NDBTAB *) m_table, cache_size));
|
||||
DBUG_RETURN((ulonglong) auto_value);
|
||||
|
@ -3611,17 +3615,18 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg):
|
|||
m_share(0),
|
||||
m_use_write(FALSE),
|
||||
m_ignore_dup_key_not_supported(FALSE),
|
||||
retrieve_all_fields(FALSE),
|
||||
rows_to_insert(1),
|
||||
rows_inserted(0),
|
||||
bulk_insert_rows(1024),
|
||||
bulk_insert_not_flushed(FALSE),
|
||||
ops_pending(0),
|
||||
skip_auto_increment(TRUE),
|
||||
blobs_pending(0),
|
||||
blobs_buffer(0),
|
||||
blobs_buffer_size(0),
|
||||
dupkey((uint) -1)
|
||||
m_primary_key_update(FALSE),
|
||||
m_retrieve_all_fields(FALSE),
|
||||
m_rows_to_insert(1),
|
||||
m_rows_inserted(0),
|
||||
m_bulk_insert_rows(1024),
|
||||
m_bulk_insert_not_flushed(FALSE),
|
||||
m_ops_pending(0),
|
||||
m_skip_auto_increment(TRUE),
|
||||
m_blobs_pending(0),
|
||||
m_blobs_buffer(0),
|
||||
m_blobs_buffer_size(0),
|
||||
m_dupkey((uint) -1)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -3655,8 +3660,8 @@ ha_ndbcluster::~ha_ndbcluster()
|
|||
if (m_share)
|
||||
free_share(m_share);
|
||||
release_metadata();
|
||||
my_free(blobs_buffer, MYF(MY_ALLOW_ZERO_PTR));
|
||||
blobs_buffer= 0;
|
||||
my_free(m_blobs_buffer, MYF(MY_ALLOW_ZERO_PTR));
|
||||
m_blobs_buffer= 0;
|
||||
|
||||
// Check for open cursor/transaction
|
||||
if (m_active_cursor) {
|
||||
|
|
|
@ -243,18 +243,19 @@ class ha_ndbcluster: public handler
|
|||
NdbValue m_value[NDB_MAX_ATTRIBUTES_IN_TABLE];
|
||||
bool m_use_write;
|
||||
bool m_ignore_dup_key_not_supported;
|
||||
bool retrieve_all_fields;
|
||||
ha_rows rows_to_insert;
|
||||
ha_rows rows_inserted;
|
||||
ha_rows bulk_insert_rows;
|
||||
bool bulk_insert_not_flushed;
|
||||
ha_rows ops_pending;
|
||||
bool skip_auto_increment;
|
||||
bool blobs_pending;
|
||||
bool m_primary_key_update;
|
||||
bool m_retrieve_all_fields;
|
||||
ha_rows m_rows_to_insert;
|
||||
ha_rows m_rows_inserted;
|
||||
ha_rows m_bulk_insert_rows;
|
||||
bool m_bulk_insert_not_flushed;
|
||||
ha_rows m_ops_pending;
|
||||
bool m_skip_auto_increment;
|
||||
bool m_blobs_pending;
|
||||
// memory for blobs in one tuple
|
||||
char *blobs_buffer;
|
||||
uint32 blobs_buffer_size;
|
||||
uint dupkey;
|
||||
char *m_blobs_buffer;
|
||||
uint32 m_blobs_buffer_size;
|
||||
uint m_dupkey;
|
||||
|
||||
void set_rec_per_key();
|
||||
void records_update();
|
||||
|
|
|
@ -1370,6 +1370,10 @@ bool Item_param::convert_str_value(THD *thd)
|
|||
value.cs_info.character_set_client,
|
||||
value.cs_info.final_character_set_of_str_value);
|
||||
}
|
||||
else
|
||||
str_value.set_charset(value.cs_info.final_character_set_of_str_value);
|
||||
/* Here str_value is guaranteed to be in final_character_set_of_str_value */
|
||||
|
||||
max_length= str_value.length();
|
||||
decimals= 0;
|
||||
/*
|
||||
|
|
|
@ -1771,12 +1771,13 @@ void Item_func_in::fix_length_and_dec()
|
|||
Conversion is possible:
|
||||
All IN arguments are constants.
|
||||
*/
|
||||
Item_arena *arena= thd->current_arena, backup;
|
||||
if (arena->is_stmt_prepare())
|
||||
thd->set_n_backup_item_arena(arena, &backup);
|
||||
Item_arena *arena, backup;
|
||||
arena= thd->change_arena_if_needed(&backup);
|
||||
|
||||
for (arg= args+1, arg_end= args+arg_count; arg < arg_end; arg++)
|
||||
{
|
||||
if (!my_charset_same(cmp_collation.collation,
|
||||
if (!arg[0]->null_value &&
|
||||
!my_charset_same(cmp_collation.collation,
|
||||
arg[0]->collation.collation))
|
||||
{
|
||||
Item_string *conv;
|
||||
|
@ -1790,7 +1791,7 @@ void Item_func_in::fix_length_and_dec()
|
|||
arg[0]= conv;
|
||||
}
|
||||
}
|
||||
if (arena->is_stmt_prepare())
|
||||
if (arena)
|
||||
thd->restore_backup_item_arena(arena, &backup);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,14 +163,13 @@ bool Item_func::agg_arg_charsets(DTCollation &coll,
|
|||
}
|
||||
|
||||
THD *thd= current_thd;
|
||||
Item_arena *arena= thd->current_arena, backup;
|
||||
Item_arena *arena, backup;
|
||||
bool res= FALSE;
|
||||
/*
|
||||
In case we're in statement prepare, create conversion item
|
||||
in its memory: it will be reused on each execute.
|
||||
*/
|
||||
if (arena->is_stmt_prepare())
|
||||
thd->set_n_backup_item_arena(arena, &backup);
|
||||
arena= thd->change_arena_if_needed(&backup);
|
||||
|
||||
for (arg= args, last= args + nargs; arg < last; arg++)
|
||||
{
|
||||
|
@ -198,7 +197,7 @@ bool Item_func::agg_arg_charsets(DTCollation &coll,
|
|||
conv->fix_fields(thd, 0, &conv);
|
||||
*arg= conv;
|
||||
}
|
||||
if (arena->is_stmt_prepare())
|
||||
if (arena)
|
||||
thd->restore_backup_item_arena(arena, &backup);
|
||||
return res;
|
||||
}
|
||||
|
@ -2429,6 +2428,7 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name,
|
|||
entry->value=0;
|
||||
entry->length=0;
|
||||
entry->update_query_id=0;
|
||||
entry->collation.set(NULL, DERIVATION_NONE);
|
||||
/*
|
||||
If we are here, we were called from a SET or a query which sets a
|
||||
variable. Imagine it is this:
|
||||
|
@ -2470,7 +2470,24 @@ bool Item_func_set_user_var::fix_fields(THD *thd, TABLE_LIST *tables,
|
|||
is different from query_id).
|
||||
*/
|
||||
entry->update_query_id= thd->query_id;
|
||||
entry->collation.set(args[0]->collation);
|
||||
/*
|
||||
As it is wrong and confusing to associate any
|
||||
character set with NULL, @a should be latin2
|
||||
after this query sequence:
|
||||
|
||||
SET @a=_latin2'string';
|
||||
SET @a=NULL;
|
||||
|
||||
I.e. the second query should not change the charset
|
||||
to the current default value, but should keep the
|
||||
original value assigned during the first query.
|
||||
In order to do it, we don't copy charset
|
||||
from the argument if the argument is NULL
|
||||
and the variable has previously been initialized.
|
||||
*/
|
||||
if (!entry->collation.collation || !args[0]->null_value)
|
||||
entry->collation.set(args[0]->collation);
|
||||
collation.set(entry->collation);
|
||||
cached_result_type= args[0]->result_type();
|
||||
return 0;
|
||||
}
|
||||
|
@ -2498,7 +2515,6 @@ bool Item_func_set_user_var::update_hash(void *ptr, uint length,
|
|||
my_free(entry->value,MYF(0));
|
||||
entry->value=0;
|
||||
entry->length=0;
|
||||
entry->collation.set(cs, dv);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -190,15 +190,16 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref)
|
|||
bool Item_subselect::exec()
|
||||
{
|
||||
int res;
|
||||
MEM_ROOT *old_root= my_pthread_getspecific_ptr(MEM_ROOT*, THR_MALLOC);
|
||||
if (&thd->mem_root != old_root)
|
||||
{
|
||||
my_pthread_setspecific_ptr(THR_MALLOC, &thd->mem_root);
|
||||
res= engine->exec();
|
||||
my_pthread_setspecific_ptr(THR_MALLOC, old_root);
|
||||
}
|
||||
else
|
||||
res= engine->exec();
|
||||
MEM_ROOT *old_root= thd->mem_root;
|
||||
|
||||
/*
|
||||
As this is execution, all objects should be allocated through the main
|
||||
mem root
|
||||
*/
|
||||
thd->mem_root= &thd->main_mem_root;
|
||||
res= engine->exec();
|
||||
thd->mem_root= old_root;
|
||||
|
||||
if (engine_changed)
|
||||
{
|
||||
engine_changed= 0;
|
||||
|
@ -661,15 +662,10 @@ Item_in_subselect::single_value_transformer(JOIN *join,
|
|||
}
|
||||
|
||||
SELECT_LEX *select_lex= join->select_lex;
|
||||
Item_arena *arena= thd->current_arena, backup;
|
||||
|
||||
Item_arena *arena, backup;
|
||||
arena= thd->change_arena_if_needed(&backup);
|
||||
thd->where= "scalar IN/ALL/ANY subquery";
|
||||
|
||||
if (arena->is_conventional())
|
||||
arena= 0; // For easier test
|
||||
else
|
||||
thd->set_n_backup_item_arena(arena, &backup);
|
||||
|
||||
/*
|
||||
Check that the right part of the subselect contains no more than one
|
||||
column. E.g. in SELECT 1 IN (SELECT * ..) the right part is (SELECT * ...)
|
||||
|
@ -928,11 +924,8 @@ Item_in_subselect::row_value_transformer(JOIN *join)
|
|||
}
|
||||
thd->where= "row IN/ALL/ANY subquery";
|
||||
|
||||
Item_arena *arena= thd->current_arena, backup;
|
||||
if (arena->is_conventional())
|
||||
arena= 0;
|
||||
else
|
||||
thd->set_n_backup_item_arena(arena, &backup);
|
||||
Item_arena *arena, backup;
|
||||
arena= thd->change_arena_if_needed(&backup);
|
||||
|
||||
if (select_lex->item_list.elements != left_expr->cols())
|
||||
{
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue