Commit e42eca1e authored by sasha@mysql.sashanet.com's avatar sasha@mysql.sashanet.com

Merge work:/home/bk/mysql

into mysql.sashanet.com:/home/sasha/src/bk/mysql
parents 3d26fc50 cb1d79f1
This diff is collapsed.
...@@ -47,7 +47,7 @@ __os_rename(dbenv, old, new) ...@@ -47,7 +47,7 @@ __os_rename(dbenv, old, new)
*/ */
if (MoveFileEx(old, new, MOVEFILE_REPLACE_EXISTING) != TRUE) if (MoveFileEx(old, new, MOVEFILE_REPLACE_EXISTING) != TRUE)
ret = __os_win32_errno(); ret = __os_win32_errno();
if (ret == ENOENT && MoveFile(old, new) == TRUE) if ((ret == ENOENT || ret == EIO) && MoveFile(old, new) == TRUE)
ret = 0; ret = 0;
} }
if (ret != 0) if (ret != 0)
......
...@@ -797,10 +797,8 @@ case $SYSTEM_TYPE in ...@@ -797,10 +797,8 @@ case $SYSTEM_TYPE in
*darwin*) *darwin*)
if test "$ac_cv_prog_gcc" = "yes" if test "$ac_cv_prog_gcc" = "yes"
then then
CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS" CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ"
CXXFLAGS="$CXXFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS" CXXFLAGS="$CXXFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ"
CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE"
CXXFLAGS="$CXXFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE"
MAX_C_OPTIMIZE="-O" MAX_C_OPTIMIZE="-O"
with_named_curses="" with_named_curses=""
fi fi
......
...@@ -66,7 +66,7 @@ extern void _db_unlock_file(); ...@@ -66,7 +66,7 @@ extern void _db_unlock_file();
#define DEBUGGER_ON _no_db_=0 #define DEBUGGER_ON _no_db_=0
#define DBUG_LOCK_FILE { _db_lock_file(); } #define DBUG_LOCK_FILE { _db_lock_file(); }
#define DBUG_UNLOCK_FILE { _db_unlock_file(); } #define DBUG_UNLOCK_FILE { _db_unlock_file(); }
#define DBUG_ASSERT(A) A #define DBUG_ASSERT(A) assert(A)
#else /* No debugger */ #else /* No debugger */
#define DBUG_ENTER(a1) #define DBUG_ENTER(a1)
......
...@@ -146,6 +146,7 @@ int pthread_mutex_destroy (pthread_mutex_t *); ...@@ -146,6 +146,7 @@ int pthread_mutex_destroy (pthread_mutex_t *);
#define pthread_mutex_destroy(A) DeleteCriticalSection(A) #define pthread_mutex_destroy(A) DeleteCriticalSection(A)
#define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B)) #define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B))
#define pthread_kill(A,B) pthread_dummy(0) #define pthread_kill(A,B) pthread_dummy(0)
#define pthread_exit(A) pthread_dummy()
#endif /* OS2 */ #endif /* OS2 */
/* Dummy defines for easier code */ /* Dummy defines for easier code */
......
...@@ -33,7 +33,7 @@ const char *my_raid_type(int raid_type); ...@@ -33,7 +33,7 @@ const char *my_raid_type(int raid_type);
} }
#endif #endif
#ifdef USE_RAID #if defined(USE_RAID) && !defined(DONT_USE_RAID)
#ifdef __GNUC__ #ifdef __GNUC__
#pragma interface /* gcc class implementation */ #pragma interface /* gcc class implementation */
......
...@@ -470,7 +470,8 @@ dtuple_convert_big_rec( ...@@ -470,7 +470,8 @@ dtuple_convert_big_rec(
} }
} }
if (longest < BTR_EXTERN_FIELD_REF_SIZE + 10) { if (longest < BTR_EXTERN_FIELD_REF_SIZE + 10
+ REC_1BYTE_OFFS_LIMIT) {
/* Cannot shorten more */ /* Cannot shorten more */
...@@ -479,26 +480,18 @@ dtuple_convert_big_rec( ...@@ -479,26 +480,18 @@ dtuple_convert_big_rec(
return(NULL); return(NULL);
} }
/* Move data from field longest_i to big rec vector, /* Move data from field longest_i to big rec vector;
but do not let data size of the remaining entry we do not let data size of the remaining entry
drop below 128 which is the limit for the 2-byte drop below 128 which is the limit for the 2-byte
offset storage format in a physical record */ offset storage format in a physical record. This
we accomplish by storing 128 bytes of data in entry
itself, and only the remaining part to big rec vec. */
dfield = dtuple_get_nth_field(entry, longest_i); dfield = dtuple_get_nth_field(entry, longest_i);
vector->fields[n_fields].field_no = longest_i; vector->fields[n_fields].field_no = longest_i;
if (dtuple_get_data_size(entry) - dfield->len vector->fields[n_fields].len = dfield->len
<= REC_1BYTE_OFFS_LIMIT) {
vector->fields[n_fields].len =
dtuple_get_data_size(entry)
- REC_1BYTE_OFFS_LIMIT; - REC_1BYTE_OFFS_LIMIT;
/* Since dfield will contain at least
a 20-byte reference to the extern storage,
we know that the data size of entry will be
> REC_1BYTE_OFFS_LIMIT */
} else {
vector->fields[n_fields].len = dfield->len;
}
vector->fields[n_fields].data = mem_heap_alloc(heap, vector->fields[n_fields].data = mem_heap_alloc(heap,
vector->fields[n_fields].len); vector->fields[n_fields].len);
......
...@@ -397,6 +397,8 @@ struct trx_struct{ ...@@ -397,6 +397,8 @@ struct trx_struct{
wait_thrs; /* query threads belonging to this wait_thrs; /* query threads belonging to this
trx that are in the QUE_THR_LOCK_WAIT trx that are in the QUE_THR_LOCK_WAIT
state */ state */
ulint deadlock_mark; /* a mark field used in deadlock
checking algorithm */
/*------------------------------*/ /*------------------------------*/
mem_heap_t* lock_heap; /* memory heap for the locks of the mem_heap_t* lock_heap; /* memory heap for the locks of the
transaction; protected by transaction; protected by
......
...@@ -15,6 +15,10 @@ Created 5/7/1996 Heikki Tuuri ...@@ -15,6 +15,10 @@ Created 5/7/1996 Heikki Tuuri
#include "usr0sess.h" #include "usr0sess.h"
#include "trx0purge.h" #include "trx0purge.h"
/* Restricts the length of search we will do in the waits-for
graph of transactions */
#define LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK 1000000
/* When releasing transaction locks, this specifies how often we release /* When releasing transaction locks, this specifies how often we release
the kernel mutex for a moment to give also others access to it */ the kernel mutex for a moment to give also others access to it */
...@@ -312,11 +316,14 @@ static ...@@ -312,11 +316,14 @@ static
ibool ibool
lock_deadlock_recursive( lock_deadlock_recursive(
/*====================*/ /*====================*/
/* out: TRUE if a deadlock was detected */ /* out: TRUE if a deadlock was detected
or the calculation took too long */
trx_t* start, /* in: recursion starting point */ trx_t* start, /* in: recursion starting point */
trx_t* trx, /* in: a transaction waiting for a lock */ trx_t* trx, /* in: a transaction waiting for a lock */
lock_t* wait_lock); /* in: the lock trx is waiting to be granted */ lock_t* wait_lock, /* in: the lock trx is waiting to be granted */
ulint* cost); /* in/out: number of calculation steps thus
far: if this exceeds LOCK_MAX_N_STEPS_...
we return TRUE */
/************************************************************************* /*************************************************************************
Reserves the kernel mutex. This function is used in this module to allow Reserves the kernel mutex. This function is used in this module to allow
monitoring the contention degree on the kernel mutex caused by the lock monitoring the contention degree on the kernel mutex caused by the lock
...@@ -2655,12 +2662,25 @@ lock_deadlock_occurs( ...@@ -2655,12 +2662,25 @@ lock_deadlock_occurs(
{ {
dict_table_t* table; dict_table_t* table;
dict_index_t* index; dict_index_t* index;
trx_t* mark_trx;
ibool ret; ibool ret;
ulint cost = 0;
ut_ad(trx && lock); ut_ad(trx && lock);
ut_ad(mutex_own(&kernel_mutex)); ut_ad(mutex_own(&kernel_mutex));
ret = lock_deadlock_recursive(trx, trx, lock); /* We check that adding this trx to the waits-for graph
does not produce a cycle. First mark all active transactions
with 0: */
mark_trx = UT_LIST_GET_FIRST(trx_sys->trx_list);
while (mark_trx) {
mark_trx->deadlock_mark = 0;
mark_trx = UT_LIST_GET_NEXT(trx_list, mark_trx);
}
ret = lock_deadlock_recursive(trx, trx, lock, &cost);
if (ret) { if (ret) {
if (lock_get_type(lock) == LOCK_TABLE) { if (lock_get_type(lock) == LOCK_TABLE) {
...@@ -2685,10 +2705,14 @@ static ...@@ -2685,10 +2705,14 @@ static
ibool ibool
lock_deadlock_recursive( lock_deadlock_recursive(
/*====================*/ /*====================*/
/* out: TRUE if a deadlock was detected */ /* out: TRUE if a deadlock was detected
or the calculation took too long */
trx_t* start, /* in: recursion starting point */ trx_t* start, /* in: recursion starting point */
trx_t* trx, /* in: a transaction waiting for a lock */ trx_t* trx, /* in: a transaction waiting for a lock */
lock_t* wait_lock) /* in: the lock trx is waiting to be granted */ lock_t* wait_lock, /* in: the lock trx is waiting to be granted */
ulint* cost) /* in/out: number of calculation steps thus
far: if this exceeds LOCK_MAX_N_STEPS_...
we return TRUE */
{ {
lock_t* lock; lock_t* lock;
ulint bit_no; ulint bit_no;
...@@ -2697,6 +2721,20 @@ lock_deadlock_recursive( ...@@ -2697,6 +2721,20 @@ lock_deadlock_recursive(
ut_a(trx && start && wait_lock); ut_a(trx && start && wait_lock);
ut_ad(mutex_own(&kernel_mutex)); ut_ad(mutex_own(&kernel_mutex));
if (trx->deadlock_mark == 1) {
/* We have already exhaustively searched the subtree starting
from this trx */
return(FALSE);
}
*cost = *cost + 1;
if (*cost > LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK) {
return(TRUE);
}
lock = wait_lock; lock = wait_lock;
if (lock_get_type(wait_lock) == LOCK_REC) { if (lock_get_type(wait_lock) == LOCK_REC) {
...@@ -2719,6 +2757,8 @@ lock_deadlock_recursive( ...@@ -2719,6 +2757,8 @@ lock_deadlock_recursive(
} }
if (lock == NULL) { if (lock == NULL) {
/* We can mark this subtree as searched */
trx->deadlock_mark = 1;
return(FALSE); return(FALSE);
} }
...@@ -2742,7 +2782,7 @@ lock_deadlock_recursive( ...@@ -2742,7 +2782,7 @@ lock_deadlock_recursive(
a lock */ a lock */
if (lock_deadlock_recursive(start, lock_trx, if (lock_deadlock_recursive(start, lock_trx,
lock_trx->wait_lock)) { lock_trx->wait_lock, cost)) {
return(TRUE); return(TRUE);
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
# This file is public domain and comes with NO WARRANTY of any kind # This file is public domain and comes with NO WARRANTY of any kind
target = libmysqlclient.la target = libmysqlclient.la
target_defs = -DUNDEF_THREADS_HACK target_defs = -DUNDEF_THREADS_HACK -DDONT_USE_RAID
LIBS = @CLIENT_LIBS@ LIBS = @CLIENT_LIBS@
INCLUDES = -I$(srcdir)/../include -I../include \ INCLUDES = -I$(srcdir)/../include -I../include \
-I$(srcdir)/.. -I$(top_srcdir) -I.. -I$(srcdir)/.. -I$(top_srcdir) -I..
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */ MA 02111-1307, USA */
#define DONT_USE_RAID
#include <global.h> #include <global.h>
#if defined(__WIN__) || defined(_WIN32) || defined(_WIN64) #if defined(__WIN__) || defined(_WIN32) || defined(_WIN64)
#include <winsock.h> #include <winsock.h>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
target = libmysqlclient_r.la target = libmysqlclient_r.la
target_defs = target_defs = -DDONT_USE_RAID
## LIBS = @LIBS@ ## LIBS = @LIBS@
INCLUDES = @MT_INCLUDES@ -I$(srcdir)/../include -I../include \ INCLUDES = @MT_INCLUDES@ -I$(srcdir)/../include -I../include \
......
...@@ -2480,7 +2480,7 @@ int sort_write_record(SORT_INFO *sort_info) ...@@ -2480,7 +2480,7 @@ int sort_write_record(SORT_INFO *sort_info)
info->checksum=mi_checksum(info,sort_info->record); info->checksum=mi_checksum(info,sort_info->record);
reclength=_mi_rec_pack(info,from,sort_info->record); reclength=_mi_rec_pack(info,from,sort_info->record);
info->s->state.checksum+=info->checksum; info->s->state.checksum+=info->checksum;
block_length=reclength+ 3 +test(reclength > 65532L); block_length=reclength+ 3 + test(reclength >= (65520-3));
if (block_length < share->base.min_block_length) if (block_length < share->base.min_block_length)
block_length=share->base.min_block_length; block_length=share->base.min_block_length;
flag=0; flag=0;
......
...@@ -178,7 +178,7 @@ static int _mi_find_writepos(MI_INFO *info, ...@@ -178,7 +178,7 @@ static int _mi_find_writepos(MI_INFO *info,
{ {
/* No deleted blocks; Allocate a new block */ /* No deleted blocks; Allocate a new block */
*filepos=info->state->data_file_length; *filepos=info->state->data_file_length;
if ((*length=reclength+3 + test(reclength > 65520)) < if ((*length=reclength+3 + test(reclength >= (65520-3))) <
info->s->base.min_block_length) info->s->base.min_block_length)
*length=info->s->base.min_block_length; *length=info->s->base.min_block_length;
else else
......
...@@ -524,3 +524,6 @@ a b a b ...@@ -524,3 +524,6 @@ a b a b
a b a b
1 1 1 1
1 2 1 2
id id2 id3 dummy1
id id2 id3 dummy1
NULL NULL NULL NULL
Table Op Msg_type Msg_text
test.t1 check status OK
Table Op Msg_type Msg_text
test.t1 repair status OK
Table Op Msg_type Msg_text
test.t1 check status OK
Table Op Msg_type Msg_text
test.t1 repair status OK
Table Op Msg_type Msg_text
test.t1 check status OK
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
Table Op Msg_type Msg_text
test.t1 check status OK
Table Op Msg_type Msg_text
test.t1 repair status OK
Table Op Msg_type Msg_text
test.t1 check status OK
Table Op Msg_type Msg_text
test.t1 repair status OK
Table Op Msg_type Msg_text
test.t1 check status OK
...@@ -727,13 +727,24 @@ DROP TABLE t1,t2; ...@@ -727,13 +727,24 @@ DROP TABLE t1,t2;
# Test problem with joining table to itself on a multi-part unique key # Test problem with joining table to itself on a multi-part unique key
# #
drop table if exists t; drop table if exists t1;
create table t (a int(11) not null, b int(11) not null, unique (a,b)) type=bdb; create table t1 (a int(11) not null, b int(11) not null, unique (a,b)) type=bdb;
insert into t1 values (1,1), (1,2);
insert into t values (1,1), (1,2); select * from t1 where a = 1;
select t1.*, t2.* from t1, t1 t2 where t1.a = t2.a and t2.a = 1;
select * from t1 where a = 1;
drop table t1;
select * from t where a = 1; #
select t1.*, t2.* from t t1, t t2 where t1.a = t2.a and t2.a = 1; # This caused a deadlock in BDB internal locks
select * from t where a = 1; #
drop table t; create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) type=bdb;
insert into t1 values (0,0,0,'ABCDEFGHIJ');
create table t2 (id int NOT NULL,primary key (id)) type=bdb;
LOCK TABLES t1 WRITE, t2 WRITE;
insert into t2 values(1);
SELECT t1.* FROM t1 WHERE id IN (1);
SELECT t1.* FROM t2 left outer join t1 on (t1.id=t2.id);
delete from t1 where id3 >= 0 and id3 <= 0;
drop table t1,t2;
#
# Test possible problem with rows that are about 65535 bytes long
#
create table t1 (a tinyint not null auto_increment, b blob not null, primary key (a));
let $1=100;
while ($1)
{
eval insert into t1 (b) values(repeat(char(65+$1),65540-$1));
dec $1;
}
check table t1;
repair table t1;
delete from t1 where (a & 1);
check table t1;
repair table t1;
check table t1;
drop table t1;
...@@ -16,3 +16,23 @@ INSERT INTO t1 VALUES ('HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH ...@@ -16,3 +16,23 @@ INSERT INTO t1 VALUES ('HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
INSERT INTO t1 VALUES ('WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW'); INSERT INTO t1 VALUES ('WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW');
CHECK TABLE t1; CHECK TABLE t1;
drop table t1; drop table t1;
#
# Test problem with rows that are 65517-65520 bytes long
#
create table t1 (a tinyint not null auto_increment, b blob not null, primary key (a));
let $1=100;
while ($1)
{
eval insert into t1 (b) values(repeat(char(65+$1),65550-$1));
dec $1;
}
check table t1;
repair table t1;
delete from t1 where (a & 1);
check table t1;
repair table t1;
check table t1;
drop table t1;
...@@ -736,7 +736,7 @@ void thr_unlock(THR_LOCK_DATA *data) ...@@ -736,7 +736,7 @@ void thr_unlock(THR_LOCK_DATA *data)
data->type == TL_WRITE_ALLOW_WRITE)); data->type == TL_WRITE_ALLOW_WRITE));
else else
{ {
DBUG_PRINT("lock",("No locks to free")); DBUG_PRINT("lock",("No waiting read locks to free"));
} }
} }
else if (data && else if (data &&
......
...@@ -39,13 +39,21 @@ $opt_loop_count=10000; # Change this to make test harder/easier ...@@ -39,13 +39,21 @@ $opt_loop_count=10000; # Change this to make test harder/easier
chomp($pwd = `pwd`); $pwd = "." if ($pwd eq ''); chomp($pwd = `pwd`); $pwd = "." if ($pwd eq '');
require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n"; require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
$create_loop_count=$opt_loop_count;
if ($opt_small_test) if ($opt_small_test)
{ {
$opt_loop_count/=100; $opt_loop_count/=100;
$create_loop_count/=1000;
} }
$max_tables=min($limits->{'max_tables'},$opt_loop_count); $max_tables=min($limits->{'max_tables'},$opt_loop_count);
if ($opt_small_test)
{
$max_tables=10;
}
print "Testing the speed of creating and droping tables\n"; print "Testing the speed of creating and droping tables\n";
print "Testing with $max_tables tables and $opt_loop_count loop count\n\n"; print "Testing with $max_tables tables and $opt_loop_count loop count\n\n";
...@@ -177,7 +185,7 @@ print "Testing create+drop\n"; ...@@ -177,7 +185,7 @@ print "Testing create+drop\n";
$loop_time=new Benchmark; $loop_time=new Benchmark;
for ($i=1 ; $i <= $opt_loop_count ; $i++) for ($i=1 ; $i <= $create_loop_count ; $i++)
{ {
do_many($dbh,$server->create("bench_$i", do_many($dbh,$server->create("bench_$i",
["i int NOT NULL", ["i int NOT NULL",
...@@ -190,7 +198,7 @@ for ($i=1 ; $i <= $opt_loop_count ; $i++) ...@@ -190,7 +198,7 @@ for ($i=1 ; $i <= $opt_loop_count ; $i++)
} }
$end_time=new Benchmark; $end_time=new Benchmark;
print "Time for create+drop ($opt_loop_count): " . print "Time for create+drop ($create_loop_count): " .
timestr(timediff($end_time, $loop_time),"all") . "\n"; timestr(timediff($end_time, $loop_time),"all") . "\n";
if ($opt_fast && defined($server->{vacuum})) if ($opt_fast && defined($server->{vacuum}))
......
...@@ -1181,9 +1181,11 @@ int ha_berkeley::remove_key(DB_TXN *trans, uint keynr, const byte *record, ...@@ -1181,9 +1181,11 @@ int ha_berkeley::remove_key(DB_TXN *trans, uint keynr, const byte *record,
DBUG_ENTER("remove_key"); DBUG_ENTER("remove_key");
DBUG_PRINT("enter",("index: %d",keynr)); DBUG_PRINT("enter",("index: %d",keynr));
if (keynr == primary_key || if (keynr == active_index && cursor)
((table->key_info[keynr].flags & (HA_NOSAME | HA_NULL_PART_KEY)) == error=cursor->c_del(cursor,0);
HA_NOSAME)) else if (keynr == primary_key ||
((table->key_info[keynr].flags & (HA_NOSAME | HA_NULL_PART_KEY)) ==
HA_NOSAME))
{ // Unique key { // Unique key
dbug_assert(keynr == primary_key || prim_key->data != key_buff2); dbug_assert(keynr == primary_key || prim_key->data != key_buff2);
error=key_file[keynr]->del(key_file[keynr], trans, error=key_file[keynr]->del(key_file[keynr], trans,
...@@ -1304,7 +1306,7 @@ int ha_berkeley::delete_row(const byte * record) ...@@ -1304,7 +1306,7 @@ int ha_berkeley::delete_row(const byte * record)
int ha_berkeley::index_init(uint keynr) int ha_berkeley::index_init(uint keynr)
{ {
int error; int error;
DBUG_ENTER("index_init"); DBUG_ENTER("ha_berkeley::index_init");
DBUG_PRINT("enter",("table: '%s' key: %d", table->real_name, keynr)); DBUG_PRINT("enter",("table: '%s' key: %d", table->real_name, keynr));
/* /*
...@@ -1312,7 +1314,10 @@ int ha_berkeley::index_init(uint keynr) ...@@ -1312,7 +1314,10 @@ int ha_berkeley::index_init(uint keynr)
an active cursor at this point an active cursor at this point
*/ */
if (cursor) if (cursor)
{
DBUG_PRINT("note",("Closing active cursor"));
cursor->c_close(cursor); cursor->c_close(cursor);
}
active_index=keynr; active_index=keynr;
if ((error=key_file[keynr]->cursor(key_file[keynr], transaction, &cursor, if ((error=key_file[keynr]->cursor(key_file[keynr], transaction, &cursor,
table->reginfo.lock_type > table->reginfo.lock_type >
...@@ -1342,7 +1347,7 @@ int ha_berkeley::index_end() ...@@ -1342,7 +1347,7 @@ int ha_berkeley::index_end()
int ha_berkeley::read_row(int error, char *buf, uint keynr, DBT *row, int ha_berkeley::read_row(int error, char *buf, uint keynr, DBT *row,
DBT *found_key, bool read_next) DBT *found_key, bool read_next)
{ {
DBUG_ENTER("read_row"); DBUG_ENTER("ha_berkeley::read_row");
if (error) if (error)
{ {
if (error == DB_NOTFOUND || error == DB_KEYEMPTY) if (error == DB_NOTFOUND || error == DB_KEYEMPTY)
...@@ -1394,6 +1399,7 @@ int ha_berkeley::index_read_idx(byte * buf, uint keynr, const byte * key, ...@@ -1394,6 +1399,7 @@ int ha_berkeley::index_read_idx(byte * buf, uint keynr, const byte * key,
statistic_increment(ha_read_key_count,&LOCK_status); statistic_increment(ha_read_key_count,&LOCK_status);
DBUG_ENTER("index_read_idx"); DBUG_ENTER("index_read_idx");
current_row.flags=DB_DBT_REALLOC; current_row.flags=DB_DBT_REALLOC;
active_index= -1;
DBUG_RETURN(read_row(key_file[keynr]->get(key_file[keynr], transaction, DBUG_RETURN(read_row(key_file[keynr]->get(key_file[keynr], transaction,
pack_key(&last_key, keynr, key_buff, key, pack_key(&last_key, keynr, key_buff, key,
key_len), key_len),
...@@ -1408,7 +1414,7 @@ int ha_berkeley::index_read(byte * buf, const byte * key, ...@@ -1408,7 +1414,7 @@ int ha_berkeley::index_read(byte * buf, const byte * key,
DBT row; DBT row;
int error; int error;
KEY *key_info= &table->key_info[active_index]; KEY *key_info= &table->key_info[active_index];
DBUG_ENTER("index_read"); DBUG_ENTER("ha_berkeley::index_read");
statistic_increment(ha_read_key_count,&LOCK_status); statistic_increment(ha_read_key_count,&LOCK_status);
bzero((char*) &row,sizeof(row)); bzero((char*) &row,sizeof(row));
...@@ -1513,8 +1519,9 @@ int ha_berkeley::index_last(byte * buf) ...@@ -1513,8 +1519,9 @@ int ha_berkeley::index_last(byte * buf)
int ha_berkeley::rnd_init(bool scan) int ha_berkeley::rnd_init(bool scan)
{ {
DBUG_ENTER("rnd_init");
current_row.flags=DB_DBT_REALLOC; current_row.flags=DB_DBT_REALLOC;
return index_init(primary_key); DBUG_RETURN(index_init(primary_key));
} }
int ha_berkeley::rnd_end() int ha_berkeley::rnd_end()
...@@ -1529,7 +1536,7 @@ int ha_berkeley::rnd_next(byte *buf) ...@@ -1529,7 +1536,7 @@ int ha_berkeley::rnd_next(byte *buf)
statistic_increment(ha_read_rnd_next_count,&LOCK_status); statistic_increment(ha_read_rnd_next_count,&LOCK_status);
bzero((char*) &row,sizeof(row)); bzero((char*) &row,sizeof(row));
DBUG_RETURN(read_row(cursor->c_get(cursor, &last_key, &row, DB_NEXT), DBUG_RETURN(read_row(cursor->c_get(cursor, &last_key, &row, DB_NEXT),
(char*) buf, active_index, &row, &last_key, 1)); (char*) buf, primary_key, &row, &last_key, 1));
} }
...@@ -1559,10 +1566,11 @@ int ha_berkeley::rnd_pos(byte * buf, byte *pos) ...@@ -1559,10 +1566,11 @@ int ha_berkeley::rnd_pos(byte * buf, byte *pos)
DBT db_pos; DBT db_pos;
statistic_increment(ha_read_rnd_count,&LOCK_status); statistic_increment(ha_read_rnd_count,&LOCK_status);
active_index= (uint) -1; // Don't delete via cursor
return read_row(file->get(file, transaction, return read_row(file->get(file, transaction,
get_pos(&db_pos, pos), get_pos(&db_pos, pos),
&current_row, 0), &current_row, 0),
(char*) buf, active_index, &current_row, (DBT*) 0, 0); (char*) buf, primary_key, &current_row, (DBT*) 0, 0);
} }
void ha_berkeley::position(const byte *record) void ha_berkeley::position(const byte *record)
...@@ -1577,10 +1585,10 @@ void ha_berkeley::position(const byte *record) ...@@ -1577,10 +1585,10 @@ void ha_berkeley::position(const byte *record)
void ha_berkeley::info(uint flag) void ha_berkeley::info(uint flag)
{ {
DBUG_ENTER("info"); DBUG_ENTER("ha_berkeley::info");
if (flag & HA_STATUS_VARIABLE) if (flag & HA_STATUS_VARIABLE)
{ {
records = share->rows; // Just to get optimisations right records = share->rows + changed_rows; // Just to get optimisations right
deleted = 0; deleted = 0;
} }
if ((flag & HA_STATUS_CONST) || version != share->version) if ((flag & HA_STATUS_CONST) || version != share->version)
...@@ -1658,12 +1666,15 @@ int ha_berkeley::external_lock(THD *thd, int lock_type) ...@@ -1658,12 +1666,15 @@ int ha_berkeley::external_lock(THD *thd, int lock_type)
{ {
if (!thd->transaction.bdb_lock_count++) if (!thd->transaction.bdb_lock_count++)
{ {
DBUG_ASSERT(thd->transaction.stmt.bdb_tid == 0);
transaction=0; // Safety
/* First table lock, start transaction */ /* First table lock, start transaction */
if ((thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN)) && if ((thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN |
OPTION_TABLE_LOCK)) &&
!thd->transaction.all.bdb_tid) !thd->transaction.all.bdb_tid)
{ {
/* We have to start a master transaction */ /* We have to start a master transaction */
DBUG_PRINT("trans",("starting transaction")); DBUG_PRINT("trans",("starting transaction all"));
if ((error=txn_begin(db_env, 0, if ((error=txn_begin(db_env, 0,
(DB_TXN**) &thd->transaction.all.bdb_tid, (DB_TXN**) &thd->transaction.all.bdb_tid,
0))) 0)))
...@@ -1671,8 +1682,10 @@ int ha_berkeley::external_lock(THD *thd, int lock_type) ...@@ -1671,8 +1682,10 @@ int ha_berkeley::external_lock(THD *thd, int lock_type)
thd->transaction.bdb_lock_count--; // We didn't get the lock /* purecov: inspected */ thd->transaction.bdb_lock_count--; // We didn't get the lock /* purecov: inspected */
DBUG_RETURN(error); /* purecov: inspected */ DBUG_RETURN(error); /* purecov: inspected */
} }
if (thd->in_lock_tables)
DBUG_RETURN(0); // Don't create stmt trans
} }
DBUG_PRINT("trans",("starting transaction for statement")); DBUG_PRINT("trans",("starting transaction stmt"));
if ((error=txn_begin(db_env, if ((error=txn_begin(db_env,
(DB_TXN*) thd->transaction.all.bdb_tid, (DB_TXN*) thd->transaction.all.bdb_tid,
(DB_TXN**) &thd->transaction.stmt.bdb_tid, (DB_TXN**) &thd->transaction.stmt.bdb_tid,
...@@ -1684,12 +1697,12 @@ int ha_berkeley::external_lock(THD *thd, int lock_type) ...@@ -1684,12 +1697,12 @@ int ha_berkeley::external_lock(THD *thd, int lock_type)
} }
} }
transaction= (DB_TXN*) thd->transaction.stmt.bdb_tid; transaction= (DB_TXN*) thd->transaction.stmt.bdb_tid;
changed_rows=0;
} }
else else
{ {
lock.type=TL_UNLOCK; // Unlocked lock.type=TL_UNLOCK; // Unlocked
thread_safe_add(share->rows, changed_rows, &share->mutex); thread_safe_add(share->rows, changed_rows, &share->mutex);
changed_rows=0;
if (!--thd->transaction.bdb_lock_count) if (!--thd->transaction.bdb_lock_count)
{ {
if (thd->transaction.stmt.bdb_tid) if (thd->transaction.stmt.bdb_tid)
...@@ -1722,11 +1735,12 @@ int ha_berkeley::start_stmt(THD *thd) ...@@ -1722,11 +1735,12 @@ int ha_berkeley::start_stmt(THD *thd)
DBUG_ENTER("ha_berkeley::start_stmt"); DBUG_ENTER("ha_berkeley::start_stmt");
if (!thd->transaction.stmt.bdb_tid) if (!thd->transaction.stmt.bdb_tid)
{ {
DBUG_PRINT("trans",("starting transaction stmt"));
error=txn_begin(db_env, (DB_TXN*) thd->transaction.all.bdb_tid, error=txn_begin(db_env, (DB_TXN*) thd->transaction.all.bdb_tid,
(DB_TXN**) &thd->transaction.stmt.bdb_tid, (DB_TXN**) &thd->transaction.stmt.bdb_tid,
0); 0);
transaction= (DB_TXN*) thd->transaction.stmt.bdb_tid;
} }
transaction= (DB_TXN*) thd->transaction.stmt.bdb_tid;
DBUG_RETURN(error); DBUG_RETURN(error);
} }
...@@ -1931,6 +1945,8 @@ longlong ha_berkeley::get_auto_increment() ...@@ -1931,6 +1945,8 @@ longlong ha_berkeley::get_auto_increment()
longlong nr=1; // Default if error or new key longlong nr=1; // Default if error or new key
int error; int error;
(void) ha_berkeley::extra(HA_EXTRA_KEYREAD); (void) ha_berkeley::extra(HA_EXTRA_KEYREAD);
/* Set 'active_index' */
ha_berkeley::index_init(table->next_number_index); ha_berkeley::index_init(table->next_number_index);
if (!table->next_number_key_offset) if (!table->next_number_key_offset)
......
...@@ -93,7 +93,7 @@ class ha_berkeley: public handler ...@@ -93,7 +93,7 @@ class ha_berkeley: public handler
HA_BLOB_KEY | HA_NOT_EXACT_COUNT | HA_BLOB_KEY | HA_NOT_EXACT_COUNT |
HA_PRIMARY_KEY_IN_READ_INDEX | HA_DROP_BEFORE_CREATE | HA_PRIMARY_KEY_IN_READ_INDEX | HA_DROP_BEFORE_CREATE |
HA_AUTO_PART_KEY), HA_AUTO_PART_KEY),
last_dup_key((uint) -1),version(0),using_ignore(0) changed_rows(0),last_dup_key((uint) -1),version(0),using_ignore(0)
{ {
} }
~ha_berkeley() {} ~ha_berkeley() {}
......
...@@ -21,7 +21,7 @@ InnoDB */ ...@@ -21,7 +21,7 @@ InnoDB */
- Ask Monty if strings of different languages can exist in the same - Ask Monty if strings of different languages can exist in the same
database. Answer: in near future yes, but not yet. database. Answer: in near future yes, but not yet.
*/ */
#ifdef __GNUC__ #ifdef __GNUC__
#pragma implementation // gcc: Class implementation #pragma implementation // gcc: Class implementation
#endif #endif
...@@ -2844,7 +2844,7 @@ ha_innobase::info( ...@@ -2844,7 +2844,7 @@ ha_innobase::info(
if (records == 0) { if (records == 0) {
mean_rec_length = 0; mean_rec_length = 0;
} else { } else {
mean_rec_length = (ulong) data_file_length / records; mean_rec_length = (ulong) (data_file_length / records);
} }
} }
......
...@@ -52,7 +52,7 @@ ulong ha_read_count, ha_write_count, ha_delete_count, ha_update_count, ...@@ -52,7 +52,7 @@ ulong ha_read_count, ha_write_count, ha_delete_count, ha_update_count,
const char *ha_table_type[] = { const char *ha_table_type[] = {
"", "DIAB_ISAM","HASH","MISAM","PISAM","RMS_ISAM","HEAP", "ISAM", "", "DIAB_ISAM","HASH","MISAM","PISAM","RMS_ISAM","HEAP", "ISAM",
"MRG_ISAM","MYISAM", "MRG_MYISAM", "BDB", "INNOBASE", "GEMINI", "?", "?",NullS "MRG_ISAM","MYISAM", "MRG_MYISAM", "BDB", "INNODB", "GEMINI", "?", "?",NullS
}; };
TYPELIB ha_table_typelib= {array_elements(ha_table_type)-4,"", TYPELIB ha_table_typelib= {array_elements(ha_table_type)-4,"",
...@@ -837,8 +837,15 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info, ...@@ -837,8 +837,15 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
} }
error=table.file->create(name,&table,create_info); error=table.file->create(name,&table,create_info);
VOID(closefrm(&table)); VOID(closefrm(&table));
if (error) if (error) {
my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,my_errno); if (table.db_type == DB_TYPE_INNOBASE) {
/* Creation of InnoDB table cannot fail because of an OS error:
put error as the number */
my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,error);
} else {
my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,my_errno);
}
}
DBUG_RETURN(error != 0); DBUG_RETURN(error != 0);
} }
......
...@@ -169,8 +169,10 @@ static int lock_external(TABLE **tables,uint count) ...@@ -169,8 +169,10 @@ static int lock_external(TABLE **tables,uint count)
void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock) void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock)
{ {
DBUG_ENTER("mysql_unlock_tables"); DBUG_ENTER("mysql_unlock_tables");
thr_multi_unlock(sql_lock->locks,sql_lock->lock_count); if (sql_lock->lock_count)
VOID(unlock_external(thd,sql_lock->table,sql_lock->table_count)); thr_multi_unlock(sql_lock->locks,sql_lock->lock_count);
if (sql_lock->table_count)
VOID(unlock_external(thd,sql_lock->table,sql_lock->table_count));
my_free((gptr) sql_lock,MYF(0)); my_free((gptr) sql_lock,MYF(0));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
...@@ -213,7 +215,7 @@ void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock) ...@@ -213,7 +215,7 @@ void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock)
if (i != found) if (i != found)
{ {
thr_multi_unlock(lock,i-found); thr_multi_unlock(lock,i-found);
sql_lock->lock_count-=found; sql_lock->lock_count= found;
} }
/* Then to the same for the external locks */ /* Then to the same for the external locks */
...@@ -232,7 +234,7 @@ void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock) ...@@ -232,7 +234,7 @@ void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock)
if (i != found) if (i != found)
{ {
VOID(unlock_external(thd,table,i-found)); VOID(unlock_external(thd,table,i-found));
sql_lock->table_count-=found; sql_lock->table_count=found;
} }
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
...@@ -314,7 +316,7 @@ static int unlock_external(THD *thd, TABLE **table,uint count) ...@@ -314,7 +316,7 @@ static int unlock_external(THD *thd, TABLE **table,uint count)
DBUG_ENTER("unlock_external"); DBUG_ENTER("unlock_external");
error_code=0; error_code=0;
for (; count-- ; table++) do
{ {
if ((*table)->current_lock != F_UNLCK) if ((*table)->current_lock != F_UNLCK)
{ {
...@@ -322,7 +324,8 @@ static int unlock_external(THD *thd, TABLE **table,uint count) ...@@ -322,7 +324,8 @@ static int unlock_external(THD *thd, TABLE **table,uint count)
if ((error=(*table)->file->external_lock(thd, F_UNLCK))) if ((error=(*table)->file->external_lock(thd, F_UNLCK)))
error_code=error; error_code=error;
} }
} table++;
} while (--count);
if (error_code) if (error_code)
print_lock_error(error_code); print_lock_error(error_code);
DBUG_RETURN(error_code); DBUG_RETURN(error_code);
......
...@@ -272,24 +272,24 @@ void Log_event::print_header(FILE* file) ...@@ -272,24 +272,24 @@ void Log_event::print_header(FILE* file)
void Log_event::print_timestamp(FILE* file, time_t* ts) void Log_event::print_timestamp(FILE* file, time_t* ts)
{ {
struct tm tm_tmp; struct tm tm_tmp, *res;
if (!ts) if (!ts)
{ {
ts = &when; ts = &when;
} }
#ifdef MYSQL_SERVER #ifdef MYSQL_SERVER
localtime_r(ts,&tm_tmp); localtime_r(ts,(res= &tm_tmp));
#else #else
localtime(ts); res=localtime(ts);
#endif #endif
fprintf(file,"%02d%02d%02d %2d:%02d:%02d", fprintf(file,"%02d%02d%02d %2d:%02d:%02d",
tm_tmp.tm_year % 100, res->tm_year % 100,
tm_tmp.tm_mon+1, res->tm_mon+1,
tm_tmp.tm_mday, res->tm_mday,
tm_tmp.tm_hour, res->tm_hour,
tm_tmp.tm_min, res->tm_min,
tm_tmp.tm_sec); res->tm_sec);
} }
......
...@@ -163,7 +163,8 @@ void kill_one_thread(THD *thd, ulong id); ...@@ -163,7 +163,8 @@ void kill_one_thread(THD *thd, ulong id);
#define OPTION_BIN_LOG OPTION_BUFFER_RESULT*2 #define OPTION_BIN_LOG OPTION_BUFFER_RESULT*2
#define OPTION_NOT_AUTO_COMMIT OPTION_BIN_LOG*2 #define OPTION_NOT_AUTO_COMMIT OPTION_BIN_LOG*2
#define OPTION_BEGIN OPTION_NOT_AUTO_COMMIT*2 #define OPTION_BEGIN OPTION_NOT_AUTO_COMMIT*2
#define OPTION_QUICK OPTION_BEGIN*2 #define OPTION_TABLE_LOCK OPTION_BEGIN*2
#define OPTION_QUICK OPTION_TABLE_LOCK*2
#define OPTION_QUOTE_SHOW_CREATE OPTION_QUICK*2 #define OPTION_QUOTE_SHOW_CREATE OPTION_QUICK*2
#define OPTION_INTERNAL_SUBTRANSACTIONS OPTION_QUOTE_SHOW_CREATE*2 #define OPTION_INTERNAL_SUBTRANSACTIONS OPTION_QUOTE_SHOW_CREATE*2
......
...@@ -636,9 +636,7 @@ static void __cdecl kill_server(int sig_ptr) ...@@ -636,9 +636,7 @@ static void __cdecl kill_server(int sig_ptr)
unireg_abort(1); /* purecov: inspected */ unireg_abort(1); /* purecov: inspected */
else else
unireg_end(0); unireg_end(0);
#ifndef OS2
pthread_exit(0); /* purecov: deadcode */ pthread_exit(0); /* purecov: deadcode */
#endif
RETURN_FROM_KILL_SERVER; RETURN_FROM_KILL_SERVER;
} }
...@@ -670,9 +668,7 @@ static sig_handler print_signal_warning(int sig) ...@@ -670,9 +668,7 @@ static sig_handler print_signal_warning(int sig)
void unireg_end(int signal_number __attribute__((unused))) void unireg_end(int signal_number __attribute__((unused)))
{ {
clean_up(); clean_up();
#ifndef OS2
pthread_exit(0); // Exit is in main thread pthread_exit(0); // Exit is in main thread
#endif
} }
......
...@@ -413,7 +413,10 @@ void close_thread_tables(THD *thd, bool locked) ...@@ -413,7 +413,10 @@ void close_thread_tables(THD *thd, bool locked)
DBUG_ENTER("close_thread_tables"); DBUG_ENTER("close_thread_tables");
if (thd->locked_tables) if (thd->locked_tables)
{
ha_commit_stmt(thd); // If select statement
DBUG_VOID_RETURN; // LOCK TABLES in use DBUG_VOID_RETURN; // LOCK TABLES in use
}
TABLE *table,*next; TABLE *table,*next;
bool found_old_table=0; bool found_old_table=0;
......
...@@ -81,7 +81,8 @@ static void init_signals(void) ...@@ -81,7 +81,8 @@ static void init_signals(void)
inline bool end_active_trans(THD *thd) inline bool end_active_trans(THD *thd)
{ {
int error=0; int error=0;
if (thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN)) if (thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN |
OPTION_TABLE_LOCK))
{ {
thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE); thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE);
thd->server_status&= ~SERVER_STATUS_IN_TRANS; thd->server_status&= ~SERVER_STATUS_IN_TRANS;
...@@ -1825,7 +1826,11 @@ mysql_execute_command(void) ...@@ -1825,7 +1826,11 @@ mysql_execute_command(void)
{ {
thd->lock=thd->locked_tables; thd->lock=thd->locked_tables;
thd->locked_tables=0; // Will be automaticly closed thd->locked_tables=0; // Will be automaticly closed
}
if (thd->options & OPTION_TABLE_LOCK)
{
end_active_trans(thd); end_active_trans(thd);
thd->options&= ~(ulong) (OPTION_TABLE_LOCK);
} }
if (thd->global_read_lock) if (thd->global_read_lock)
{ {
...@@ -1847,12 +1852,15 @@ mysql_execute_command(void) ...@@ -1847,12 +1852,15 @@ mysql_execute_command(void)
if (check_db_used(thd,tables) || end_active_trans(thd)) if (check_db_used(thd,tables) || end_active_trans(thd))
goto error; goto error;
thd->in_lock_tables=1; thd->in_lock_tables=1;
thd->options|= OPTION_TABLE_LOCK;
if (!(res=open_and_lock_tables(thd,tables))) if (!(res=open_and_lock_tables(thd,tables)))
{ {
thd->locked_tables=thd->lock; thd->locked_tables=thd->lock;
thd->lock=0; thd->lock=0;
send_ok(&thd->net); send_ok(&thd->net);
} }
else
thd->options&= ~(ulong) (OPTION_TABLE_LOCK);
thd->in_lock_tables=0; thd->in_lock_tables=0;
break; break;
case SQLCOM_CREATE_DB: case SQLCOM_CREATE_DB:
......
...@@ -2516,6 +2516,7 @@ static void ...@@ -2516,6 +2516,7 @@ static void
join_free(JOIN *join) join_free(JOIN *join)
{ {
JOIN_TAB *tab,*end; JOIN_TAB *tab,*end;
DBUG_ENTER("join_free");
if (join->table) if (join->table)
{ {
...@@ -2556,6 +2557,7 @@ join_free(JOIN *join) ...@@ -2556,6 +2557,7 @@ join_free(JOIN *join)
join->tmp_table_param.copy_funcs.delete_elements(); join->tmp_table_param.copy_funcs.delete_elements();
delete [] join->tmp_table_param.copy_field; delete [] join->tmp_table_param.copy_field;
join->tmp_table_param.copy_field=0; join->tmp_table_param.copy_field=0;
DBUG_VOID_RETURN;
} }
......
...@@ -154,7 +154,7 @@ int vio_read(Vio * vio, gptr buf, int size) ...@@ -154,7 +154,7 @@ int vio_read(Vio * vio, gptr buf, int size)
{ {
int r; int r;
DBUG_ENTER("vio_read"); DBUG_ENTER("vio_read");
DBUG_PRINT("enter", ("sd=%d, buf=%p, size=%d", vio->sd, buf, size)); DBUG_PRINT("enter", ("sd=%d size=%d", vio->sd, size));
#if defined( __WIN__) || defined(OS2) #if defined( __WIN__) || defined(OS2)
if (vio->type == VIO_TYPE_NAMEDPIPE) if (vio->type == VIO_TYPE_NAMEDPIPE)
{ {
...@@ -188,7 +188,7 @@ int vio_write(Vio * vio, const gptr buf, int size) ...@@ -188,7 +188,7 @@ int vio_write(Vio * vio, const gptr buf, int size)
{ {
int r; int r;
DBUG_ENTER("vio_write"); DBUG_ENTER("vio_write");
DBUG_PRINT("enter", ("sd=%d, buf=%p, size=%d", vio->sd, buf, size)); DBUG_PRINT("enter", ("sd=%d size=%d", vio->sd, size));
#if defined( __WIN__) || defined(OS2) #if defined( __WIN__) || defined(OS2)
if ( vio->type == VIO_TYPE_NAMEDPIPE) if ( vio->type == VIO_TYPE_NAMEDPIPE)
{ {
...@@ -303,7 +303,7 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive) ...@@ -303,7 +303,7 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive)
int r=0; int r=0;
uint opt = 0; uint opt = 0;
DBUG_ENTER("vio_keepalive"); DBUG_ENTER("vio_keepalive");
DBUG_PRINT("enter", ("sd=%d, set_keep_alive=%d", vio->sd, (int) DBUG_PRINT("enter", ("sd=%d set_keep_alive=%d", vio->sd, (int)
set_keep_alive)); set_keep_alive));
if (vio->type != VIO_TYPE_NAMEDPIPE) if (vio->type != VIO_TYPE_NAMEDPIPE)
{ {
......
...@@ -85,22 +85,22 @@ uchar NEAR to_lower_euc_kr[]= ...@@ -85,22 +85,22 @@ uchar NEAR to_lower_euc_kr[]=
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z', '{', '|', '}', '~', '\177', 'x', 'y', 'z', '{', '|', '}', '~', '\177',
'\200','\201','\202','\203','\204','\205','\206','\207', (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207',
'\210','\211','\212','\213','\214','\215','\216','\217', (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217',
'\220','\221','\222','\223','\224','\225','\226','\227', (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227',
'\230','\231','\232','\233','\234','\235','\236','\237', (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237',
'\240','\241','\242','\243','\244','\245','\246','\247', (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247',
'\250','\251','\252','\253','\254','\255','\256','\257', (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257',
'\260','\261','\262','\263','\264','\265','\266','\267', (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267',
'\270','\271','\272','\273','\274','\275','\276','\277', (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277',
'\300','\301','\302','\303','\304','\305','\306','\307', (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307',
'\310','\311','\312','\313','\314','\315','\316','\317', (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317',
'\320','\321','\322','\323','\324','\325','\326','\327', (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327',
'\330','\331','\332','\333','\334','\335','\336','\337', (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337',
'\340','\341','\342','\343','\344','\345','\346','\347', (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347',
'\350','\351','\352','\353','\354','\355','\356','\357', (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357',
'\360','\361','\362','\363','\364','\365','\366','\367', (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367',
'\370','\371','\372','\373','\374','\375','\376','\377', (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377',
}; };
uchar NEAR to_upper_euc_kr[]= uchar NEAR to_upper_euc_kr[]=
...@@ -121,22 +121,22 @@ uchar NEAR to_upper_euc_kr[]= ...@@ -121,22 +121,22 @@ uchar NEAR to_upper_euc_kr[]=
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '{', '|', '}', '~', '\177', 'X', 'Y', 'Z', '{', '|', '}', '~', '\177',
'\200','\201','\202','\203','\204','\205','\206','\207', (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207',
'\210','\211','\212','\213','\214','\215','\216','\217', (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217',
'\220','\221','\222','\223','\224','\225','\226','\227', (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227',
'\230','\231','\232','\233','\234','\235','\236','\237', (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237',
'\240','\241','\242','\243','\244','\245','\246','\247', (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247',
'\250','\251','\252','\253','\254','\255','\256','\257', (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257',
'\260','\261','\262','\263','\264','\265','\266','\267', (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267',
'\270','\271','\272','\273','\274','\275','\276','\277', (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277',
'\300','\301','\302','\303','\304','\305','\306','\307', (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307',
'\310','\311','\312','\313','\314','\315','\316','\317', (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317',
'\320','\321','\322','\323','\324','\325','\326','\327', (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327',
'\330','\331','\332','\333','\334','\335','\336','\337', (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337',
'\340','\341','\342','\343','\344','\345','\346','\347', (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347',
'\350','\351','\352','\353','\354','\355','\356','\357', (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357',
'\360','\361','\362','\363','\364','\365','\366','\367', (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367',
'\370','\371','\372','\373','\374','\375','\376','\377', (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377',
}; };
uchar NEAR sort_order_euc_kr[]= uchar NEAR sort_order_euc_kr[]=
...@@ -157,22 +157,22 @@ uchar NEAR sort_order_euc_kr[]= ...@@ -157,22 +157,22 @@ uchar NEAR sort_order_euc_kr[]=
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '{', '|', '}', '~', '\177', 'X', 'Y', 'Z', '{', '|', '}', '~', '\177',
'\200','\201','\202','\203','\204','\205','\206','\207', (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207',
'\210','\211','\212','\213','\214','\215','\216','\217', (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217',
'\220','\221','\222','\223','\224','\225','\226','\227', (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227',
'\230','\231','\232','\233','\234','\235','\236','\237', (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237',
'\240','\241','\242','\243','\244','\245','\246','\247', (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247',
'\250','\251','\252','\253','\254','\255','\256','\257', (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257',
'\260','\261','\262','\263','\264','\265','\266','\267', (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267',
'\270','\271','\272','\273','\274','\275','\276','\277', (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277',
'\300','\301','\302','\303','\304','\305','\306','\307', (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307',
'\310','\311','\312','\313','\314','\315','\316','\317', (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317',
'\320','\321','\322','\323','\324','\325','\326','\327', (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327',
'\330','\331','\332','\333','\334','\335','\336','\337', (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337',
'\340','\341','\342','\343','\344','\345','\346','\347', (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347',
'\350','\351','\352','\353','\354','\355','\356','\357', (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357',
'\360','\361','\362','\363','\364','\365','\366','\367', (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367',
'\370','\371','\372','\373','\374','\375','\376','\377', (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377',
}; };
/* Support for Korean(EUC_KR) characters, by powerm90@tinc.co.kr and mrpark@tinc.co.kr */ /* Support for Korean(EUC_KR) characters, by powerm90@tinc.co.kr and mrpark@tinc.co.kr */
......
...@@ -85,22 +85,22 @@ uchar NEAR to_lower_sjis[]= ...@@ -85,22 +85,22 @@ uchar NEAR to_lower_sjis[]=
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z', '{', '|', '}', '~', '\177', 'x', 'y', 'z', '{', '|', '}', '~', '\177',
'\200','\201','\202','\203','\204','\205','\206','\207', (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207',
'\210','\211','\212','\213','\214','\215','\216','\217', (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217',
'\220','\221','\222','\223','\224','\225','\226','\227', (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227',
'\230','\231','\232','\233','\234','\235','\236','\237', (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237',
'\240','\241','\242','\243','\244','\245','\246','\247', (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247',
'\250','\251','\252','\253','\254','\255','\256','\257', (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257',
'\260','\261','\262','\263','\264','\265','\266','\267', (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267',
'\270','\271','\272','\273','\274','\275','\276','\277', (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277',
'\300','\301','\302','\303','\304','\305','\306','\307', (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307',
'\310','\311','\312','\313','\314','\315','\316','\317', (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317',
'\320','\321','\322','\323','\324','\325','\326','\327', (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327',
'\330','\331','\332','\333','\334','\335','\336','\337', (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337',
'\340','\341','\342','\343','\344','\345','\346','\347', (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347',
'\350','\351','\352','\353','\354','\355','\356','\357', (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357',
'\360','\361','\362','\363','\364','\365','\366','\367', (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367',
'\370','\371','\372','\373','\374','\375','\376','\377' (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377'
}; };
uchar NEAR to_upper_sjis[]= uchar NEAR to_upper_sjis[]=
...@@ -121,22 +121,22 @@ uchar NEAR to_upper_sjis[]= ...@@ -121,22 +121,22 @@ uchar NEAR to_upper_sjis[]=
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '{', '|', '}', '~', '\177', 'X', 'Y', 'Z', '{', '|', '}', '~', '\177',
'\200','\201','\202','\203','\204','\205','\206','\207', (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207',
'\210','\211','\212','\213','\214','\215','\216','\217', (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217',
'\220','\221','\222','\223','\224','\225','\226','\227', (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227',
'\230','\231','\232','\233','\234','\235','\236','\237', (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237',
'\240','\241','\242','\243','\244','\245','\246','\247', (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247',
'\250','\251','\252','\253','\254','\255','\256','\257', (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257',
'\260','\261','\262','\263','\264','\265','\266','\267', (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267',
'\270','\271','\272','\273','\274','\275','\276','\277', (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277',
'\300','\301','\302','\303','\304','\305','\306','\307', (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307',
'\310','\311','\312','\313','\314','\315','\316','\317', (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317',
'\320','\321','\322','\323','\324','\325','\326','\327', (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327',
'\330','\331','\332','\333','\334','\335','\336','\337', (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337',
'\340','\341','\342','\343','\344','\345','\346','\347', (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347',
'\350','\351','\352','\353','\354','\355','\356','\357', (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357',
'\360','\361','\362','\363','\364','\365','\366','\367', (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367',
'\370','\371','\372','\373','\374','\375','\376','\377' (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377'
}; };
uchar NEAR sort_order_sjis[]= uchar NEAR sort_order_sjis[]=
...@@ -157,22 +157,22 @@ uchar NEAR sort_order_sjis[]= ...@@ -157,22 +157,22 @@ uchar NEAR sort_order_sjis[]=
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '{', '|', '}', '~', '\177', 'X', 'Y', 'Z', '{', '|', '}', '~', '\177',
'\200','\201','\202','\203','\204','\205','\206','\207', (uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207',
'\210','\211','\212','\213','\214','\215','\216','\217', (uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217',
'\220','\221','\222','\223','\224','\225','\226','\227', (uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227',
'\230','\231','\232','\233','\234','\235','\236','\237', (uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237',
'\240','\241','\242','\243','\244','\245','\246','\247', (uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247',
'\250','\251','\252','\253','\254','\255','\256','\257', (uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257',
'\260','\261','\262','\263','\264','\265','\266','\267', (uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267',
'\270','\271','\272','\273','\274','\275','\276','\277', (uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277',
'\300','\301','\302','\303','\304','\305','\306','\307', (uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307',
'\310','\311','\312','\313','\314','\315','\316','\317', (uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317',
'\320','\321','\322','\323','\324','\325','\326','\327', (uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327',
'\330','\331','\332','\333','\334','\335','\336','\337', (uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337',
'\340','\341','\342','\343','\344','\345','\346','\347', (uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347',
'\350','\351','\352','\353','\354','\355','\356','\357', (uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357',
'\360','\361','\362','\363','\364','\365','\366','\367', (uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367',
'\370','\371','\372','\373','\374','\375','\376','\377' (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377'
}; };
#define issjishead(c) ((0x81<=(c) && (c)<=0x9f) || \ #define issjishead(c) ((0x81<=(c) && (c)<=0x9f) || \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment