Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
This commit is contained in:
commit
0ec06cabbd
@ -27,6 +27,7 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet`
|
CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet`
|
||||||
|
CSETKEY=`bk -R prs -r+ -h -d':KEY:' ChangeSet`
|
||||||
BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/\1/p'`
|
BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/\1/p'`
|
||||||
WL=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Ww][Ll] *# *\([0-9][0-9]*\).*$/ WL#\1/p'`
|
WL=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Ww][Ll] *# *\([0-9][0-9]*\).*$/ WL#\1/p'`
|
||||||
|
|
||||||
@ -52,6 +53,7 @@ List-ID: <bk.mysql-$VERSION>
|
|||||||
From: $FROM
|
From: $FROM
|
||||||
To: $TO
|
To: $TO
|
||||||
Subject: bk commit - $VERSION tree ($CHANGESET)${BS}${WL}
|
Subject: bk commit - $VERSION tree ($CHANGESET)${BS}${WL}
|
||||||
|
X-CSetKey: <$CSETKEY>
|
||||||
$BH
|
$BH
|
||||||
EOF
|
EOF
|
||||||
bk changes -v -r+
|
bk changes -v -r+
|
||||||
@ -68,6 +70,7 @@ List-ID: <bk.mysql-$VERSION>
|
|||||||
From: $FROM
|
From: $FROM
|
||||||
To: $INTERNALS
|
To: $INTERNALS
|
||||||
Subject: bk commit into $VERSION tree ($CHANGESET)$BS
|
Subject: bk commit into $VERSION tree ($CHANGESET)$BS
|
||||||
|
X-CSetKey: <$CSETKEY>
|
||||||
$BH
|
$BH
|
||||||
Below is the list of changes that have just been committed into a local
|
Below is the list of changes that have just been committed into a local
|
||||||
$VERSION repository of $USER. When $USER does a push these changes will
|
$VERSION repository of $USER. When $USER does a push these changes will
|
||||||
|
@ -149,7 +149,8 @@ typedef struct my_charset_handler_st
|
|||||||
uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
|
uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
|
||||||
uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
|
uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
|
||||||
uint (*well_formed_len)(struct charset_info_st *,
|
uint (*well_formed_len)(struct charset_info_st *,
|
||||||
const char *b,const char *e, uint nchars);
|
const char *b,const char *e,
|
||||||
|
uint nchars, int *error);
|
||||||
uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
|
uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
|
||||||
uint (*numcells)(struct charset_info_st *, const char *b, const char *e);
|
uint (*numcells)(struct charset_info_st *, const char *b, const char *e);
|
||||||
|
|
||||||
@ -349,7 +350,8 @@ int my_wildcmp_8bit(CHARSET_INFO *,
|
|||||||
uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
|
uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
|
||||||
uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
|
uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
|
||||||
uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||||
uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e,
|
||||||
|
uint pos, int *error);
|
||||||
int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
|
int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
|
||||||
|
|
||||||
|
|
||||||
@ -367,7 +369,8 @@ int my_wildcmp_mb(CHARSET_INFO *,
|
|||||||
uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
|
uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
|
||||||
uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
|
uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
|
||||||
uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||||
uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e,
|
||||||
|
uint pos, int *error);
|
||||||
uint my_instr_mb(struct charset_info_st *,
|
uint my_instr_mb(struct charset_info_st *,
|
||||||
const char *b, uint b_length,
|
const char *b, uint b_length,
|
||||||
const char *s, uint s_length,
|
const char *s, uint s_length,
|
||||||
|
@ -14,6 +14,7 @@ Created 2/23/1996 Heikki Tuuri
|
|||||||
|
|
||||||
#include "ut0byte.h"
|
#include "ut0byte.h"
|
||||||
#include "rem0cmp.h"
|
#include "rem0cmp.h"
|
||||||
|
#include "trx0trx.h"
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Allocates memory for a persistent cursor object and initializes the cursor. */
|
Allocates memory for a persistent cursor object and initializes the cursor. */
|
||||||
@ -206,7 +207,14 @@ btr_pcur_restore_position(
|
|||||||
|
|
||||||
ut_a(cursor->pos_state == BTR_PCUR_WAS_POSITIONED
|
ut_a(cursor->pos_state == BTR_PCUR_WAS_POSITIONED
|
||||||
|| cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
|| cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||||
ut_a(cursor->old_stored == BTR_PCUR_OLD_STORED);
|
if (cursor->old_stored != BTR_PCUR_OLD_STORED) {
|
||||||
|
ut_print_buf(stderr, (const byte*)cursor, sizeof(btr_pcur_t));
|
||||||
|
if (cursor->trx_if_known) {
|
||||||
|
trx_print(stderr, cursor->trx_if_known);
|
||||||
|
}
|
||||||
|
|
||||||
|
ut_a(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (cursor->rel_pos == BTR_PCUR_AFTER_LAST_IN_TREE
|
if (cursor->rel_pos == BTR_PCUR_AFTER_LAST_IN_TREE
|
||||||
|| cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE) {
|
|| cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE) {
|
||||||
|
@ -478,6 +478,10 @@ struct btr_pcur_struct{
|
|||||||
BTR_PCUR_WAS_POSITIONED,
|
BTR_PCUR_WAS_POSITIONED,
|
||||||
BTR_PCUR_NOT_POSITIONED */
|
BTR_PCUR_NOT_POSITIONED */
|
||||||
ulint search_mode; /* PAGE_CUR_G, ... */
|
ulint search_mode; /* PAGE_CUR_G, ... */
|
||||||
|
trx_t* trx_if_known; /* the transaction, if we know it;
|
||||||
|
otherwise this field is not defined;
|
||||||
|
can ONLY BE USED in error prints in
|
||||||
|
fatal assertion failures! */
|
||||||
/*-----------------------------*/
|
/*-----------------------------*/
|
||||||
/* NOTE that the following fields may possess dynamically allocated
|
/* NOTE that the following fields may possess dynamically allocated
|
||||||
memory which should be freed if not needed anymore! */
|
memory which should be freed if not needed anymore! */
|
||||||
|
@ -493,6 +493,8 @@ btr_pcur_open(
|
|||||||
btr_cur_search_to_nth_level(index, 0, tuple, mode, latch_mode,
|
btr_cur_search_to_nth_level(index, 0, tuple, mode, latch_mode,
|
||||||
btr_cursor, 0, mtr);
|
btr_cursor, 0, mtr);
|
||||||
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
||||||
|
|
||||||
|
cursor->trx_if_known = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
@ -535,6 +537,8 @@ btr_pcur_open_with_no_init(
|
|||||||
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
||||||
|
|
||||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||||
|
|
||||||
|
cursor->trx_if_known = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
@ -568,6 +572,8 @@ btr_pcur_open_at_index_side(
|
|||||||
pcur->pos_state = BTR_PCUR_IS_POSITIONED;
|
pcur->pos_state = BTR_PCUR_IS_POSITIONED;
|
||||||
|
|
||||||
pcur->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
pcur->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||||
|
|
||||||
|
pcur->trx_if_known = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -592,6 +598,8 @@ btr_pcur_open_at_rnd_pos(
|
|||||||
btr_pcur_get_btr_cur(cursor), mtr);
|
btr_pcur_get_btr_cur(cursor), mtr);
|
||||||
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
||||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||||
|
|
||||||
|
cursor->trx_if_known = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
@ -617,4 +625,6 @@ btr_pcur_close(
|
|||||||
|
|
||||||
cursor->latch_mode = BTR_NO_LATCHES;
|
cursor->latch_mode = BTR_NO_LATCHES;
|
||||||
cursor->pos_state = BTR_PCUR_NOT_POSITIONED;
|
cursor->pos_state = BTR_PCUR_NOT_POSITIONED;
|
||||||
|
|
||||||
|
cursor->trx_if_known = NULL;
|
||||||
}
|
}
|
||||||
|
@ -68,6 +68,8 @@ log. */
|
|||||||
#define OS_FILE_OVERWRITE 53
|
#define OS_FILE_OVERWRITE 53
|
||||||
#define OS_FILE_OPEN_RAW 54
|
#define OS_FILE_OPEN_RAW 54
|
||||||
#define OS_FILE_CREATE_PATH 55
|
#define OS_FILE_CREATE_PATH 55
|
||||||
|
#define OS_FILE_OPEN_RETRY 56 /* for os_file_create() on
|
||||||
|
the first ibdata file */
|
||||||
|
|
||||||
#define OS_FILE_READ_ONLY 333
|
#define OS_FILE_READ_ONLY 333
|
||||||
#define OS_FILE_READ_WRITE 444
|
#define OS_FILE_READ_WRITE 444
|
||||||
|
@ -413,8 +413,6 @@ os_file_lock(
|
|||||||
"InnoDB: using the same InnoDB data or log files.\n");
|
"InnoDB: using the same InnoDB data or log files.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
close(fd);
|
|
||||||
|
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -989,6 +987,7 @@ try_again:
|
|||||||
} else if (access_type == OS_FILE_READ_WRITE
|
} else if (access_type == OS_FILE_READ_WRITE
|
||||||
&& os_file_lock(file, name)) {
|
&& os_file_lock(file, name)) {
|
||||||
*success = FALSE;
|
*success = FALSE;
|
||||||
|
close(file);
|
||||||
file = -1;
|
file = -1;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
@ -1101,6 +1100,7 @@ os_file_create_simple_no_error_handling(
|
|||||||
} else if (access_type == OS_FILE_READ_WRITE
|
} else if (access_type == OS_FILE_READ_WRITE
|
||||||
&& os_file_lock(file, name)) {
|
&& os_file_lock(file, name)) {
|
||||||
*success = FALSE;
|
*success = FALSE;
|
||||||
|
close(file);
|
||||||
file = -1;
|
file = -1;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
@ -1152,7 +1152,8 @@ try_again:
|
|||||||
if (create_mode == OS_FILE_OPEN_RAW) {
|
if (create_mode == OS_FILE_OPEN_RAW) {
|
||||||
create_flag = OPEN_EXISTING;
|
create_flag = OPEN_EXISTING;
|
||||||
share_mode = FILE_SHARE_WRITE;
|
share_mode = FILE_SHARE_WRITE;
|
||||||
} else if (create_mode == OS_FILE_OPEN) {
|
} else if (create_mode == OS_FILE_OPEN
|
||||||
|
|| create_mode == OS_FILE_OPEN_RETRY) {
|
||||||
create_flag = OPEN_EXISTING;
|
create_flag = OPEN_EXISTING;
|
||||||
} else if (create_mode == OS_FILE_CREATE) {
|
} else if (create_mode == OS_FILE_CREATE) {
|
||||||
create_flag = CREATE_NEW;
|
create_flag = CREATE_NEW;
|
||||||
@ -1243,7 +1244,8 @@ try_again:
|
|||||||
try_again:
|
try_again:
|
||||||
ut_a(name);
|
ut_a(name);
|
||||||
|
|
||||||
if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW) {
|
if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW
|
||||||
|
|| create_mode == OS_FILE_OPEN_RETRY) {
|
||||||
mode_str = "OPEN";
|
mode_str = "OPEN";
|
||||||
create_flag = O_RDWR;
|
create_flag = O_RDWR;
|
||||||
} else if (create_mode == OS_FILE_CREATE) {
|
} else if (create_mode == OS_FILE_CREATE) {
|
||||||
@ -1316,6 +1318,23 @@ try_again:
|
|||||||
} else if (create_mode != OS_FILE_OPEN_RAW
|
} else if (create_mode != OS_FILE_OPEN_RAW
|
||||||
&& os_file_lock(file, name)) {
|
&& os_file_lock(file, name)) {
|
||||||
*success = FALSE;
|
*success = FALSE;
|
||||||
|
if (create_mode == OS_FILE_OPEN_RETRY) {
|
||||||
|
int i;
|
||||||
|
ut_print_timestamp(stderr);
|
||||||
|
fputs(" InnoDB: Retrying to lock the first data file\n",
|
||||||
|
stderr);
|
||||||
|
for (i = 0; i < 100; i++) {
|
||||||
|
os_thread_sleep(1000000);
|
||||||
|
if (!os_file_lock(file, name)) {
|
||||||
|
*success = TRUE;
|
||||||
|
return(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ut_print_timestamp(stderr);
|
||||||
|
fputs(" InnoDB: Unable to open the first data file\n",
|
||||||
|
stderr);
|
||||||
|
}
|
||||||
|
close(file);
|
||||||
file = -1;
|
file = -1;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
@ -2644,6 +2644,8 @@ row_sel_get_clust_rec_for_mysql(
|
|||||||
|
|
||||||
clust_rec = btr_pcur_get_rec(prebuilt->clust_pcur);
|
clust_rec = btr_pcur_get_rec(prebuilt->clust_pcur);
|
||||||
|
|
||||||
|
prebuilt->clust_pcur->trx_if_known = trx;
|
||||||
|
|
||||||
/* Note: only if the search ends up on a non-infimum record is the
|
/* Note: only if the search ends up on a non-infimum record is the
|
||||||
low_match value the real match to the search tuple */
|
low_match value the real match to the search tuple */
|
||||||
|
|
||||||
@ -3406,6 +3408,8 @@ shortcut_fails_too_big_rec:
|
|||||||
btr_pcur_open_with_no_init(index, search_tuple, mode,
|
btr_pcur_open_with_no_init(index, search_tuple, mode,
|
||||||
BTR_SEARCH_LEAF,
|
BTR_SEARCH_LEAF,
|
||||||
pcur, 0, &mtr);
|
pcur, 0, &mtr);
|
||||||
|
|
||||||
|
pcur->trx_if_known = trx;
|
||||||
} else {
|
} else {
|
||||||
if (mode == PAGE_CUR_G) {
|
if (mode == PAGE_CUR_G) {
|
||||||
btr_pcur_open_at_index_side(TRUE, index,
|
btr_pcur_open_at_index_side(TRUE, index,
|
||||||
|
@ -789,6 +789,11 @@ open_or_create_data_files(
|
|||||||
files[i] = os_file_create(
|
files[i] = os_file_create(
|
||||||
name, OS_FILE_OPEN_RAW, OS_FILE_NORMAL,
|
name, OS_FILE_OPEN_RAW, OS_FILE_NORMAL,
|
||||||
OS_DATA_FILE, &ret);
|
OS_DATA_FILE, &ret);
|
||||||
|
} else if (i == 0) {
|
||||||
|
files[i] = os_file_create(
|
||||||
|
name, OS_FILE_OPEN_RETRY,
|
||||||
|
OS_FILE_NORMAL,
|
||||||
|
OS_DATA_FILE, &ret);
|
||||||
} else {
|
} else {
|
||||||
files[i] = os_file_create(
|
files[i] = os_file_create(
|
||||||
name, OS_FILE_OPEN, OS_FILE_NORMAL,
|
name, OS_FILE_OPEN, OS_FILE_NORMAL,
|
||||||
|
@ -179,3 +179,6 @@ set @v1=null, @v2=1, @v3=1.1, @v4=now();
|
|||||||
select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
|
select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
|
||||||
coercibility(@v1) coercibility(@v2) coercibility(@v3) coercibility(@v4)
|
coercibility(@v1) coercibility(@v2) coercibility(@v3) coercibility(@v4)
|
||||||
2 2 2 2
|
2 2 2 2
|
||||||
|
set session @honk=99;
|
||||||
|
set one_shot @honk=99;
|
||||||
|
ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
|
||||||
|
@ -112,3 +112,10 @@ select FIELD( @var,'1it','Hit') as my_column;
|
|||||||
select @v, coercibility(@v);
|
select @v, coercibility(@v);
|
||||||
set @v1=null, @v2=1, @v3=1.1, @v4=now();
|
set @v1=null, @v2=1, @v3=1.1, @v4=now();
|
||||||
select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
|
select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #9286 SESSION/GLOBAL should be disallowed for user variables
|
||||||
|
#
|
||||||
|
set session @honk=99;
|
||||||
|
--error 1382
|
||||||
|
set one_shot @honk=99;
|
||||||
|
@ -658,6 +658,7 @@ private:
|
|||||||
// Release all cursor operations in connection
|
// Release all cursor operations in connection
|
||||||
void releaseOps(NdbOperation*);
|
void releaseOps(NdbOperation*);
|
||||||
void releaseScanOperations(NdbIndexScanOperation*);
|
void releaseScanOperations(NdbIndexScanOperation*);
|
||||||
|
void releaseExecutedScanOperation(NdbIndexScanOperation*);
|
||||||
|
|
||||||
// Set the transaction identity of the transaction
|
// Set the transaction identity of the transaction
|
||||||
void setTransactionId(Uint64 aTransactionId);
|
void setTransactionId(Uint64 aTransactionId);
|
||||||
|
@ -813,6 +813,7 @@ Dbtup::updateFixedSizeTHManyWordNotNULL(Uint32* inBuffer,
|
|||||||
ndbrequire(i < regTabPtr->noOfCharsets);
|
ndbrequire(i < regTabPtr->noOfCharsets);
|
||||||
// not const in MySQL
|
// not const in MySQL
|
||||||
CHARSET_INFO* cs = regTabPtr->charsetArray[i];
|
CHARSET_INFO* cs = regTabPtr->charsetArray[i];
|
||||||
|
int not_used;
|
||||||
const char* ssrc = (const char*)&inBuffer[tInBufIndex + 1];
|
const char* ssrc = (const char*)&inBuffer[tInBufIndex + 1];
|
||||||
Uint32 lb, len;
|
Uint32 lb, len;
|
||||||
if (! NdbSqlUtil::get_var_length(typeId, ssrc, bytes, lb, len)) {
|
if (! NdbSqlUtil::get_var_length(typeId, ssrc, bytes, lb, len)) {
|
||||||
@ -822,7 +823,7 @@ Dbtup::updateFixedSizeTHManyWordNotNULL(Uint32* inBuffer,
|
|||||||
}
|
}
|
||||||
// fast fix bug#7340
|
// fast fix bug#7340
|
||||||
if (typeId != NDB_TYPE_TEXT &&
|
if (typeId != NDB_TYPE_TEXT &&
|
||||||
(*cs->cset->well_formed_len)(cs, ssrc + lb, ssrc + lb + len, ZNIL) != len) {
|
(*cs->cset->well_formed_len)(cs, ssrc + lb, ssrc + lb + len, ZNIL, ¬_used) != len) {
|
||||||
ljam();
|
ljam();
|
||||||
terrorCode = ZINVALID_CHAR_FORMAT;
|
terrorCode = ZINVALID_CHAR_FORMAT;
|
||||||
return false;
|
return false;
|
||||||
|
@ -948,6 +948,37 @@ NdbTransaction::releaseScanOperations(NdbIndexScanOperation* cursorOp)
|
|||||||
}
|
}
|
||||||
}//NdbTransaction::releaseScanOperations()
|
}//NdbTransaction::releaseScanOperations()
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
void releaseExecutedScanOperation();
|
||||||
|
|
||||||
|
Remark: Release scan op when hupp'ed trans closed (save memory)
|
||||||
|
******************************************************************************/
|
||||||
|
void
|
||||||
|
NdbConnection::releaseExecutedScanOperation(NdbIndexScanOperation* cursorOp)
|
||||||
|
{
|
||||||
|
DBUG_ENTER("NdbConnection::releaseExecutedScanOperation");
|
||||||
|
DBUG_PRINT("enter", ("this=0x%x op=0x%x", (UintPtr)this, (UintPtr)cursorOp))
|
||||||
|
|
||||||
|
// here is one reason to make op lists doubly linked
|
||||||
|
if (m_firstExecutedScanOp == cursorOp) {
|
||||||
|
m_firstExecutedScanOp = (NdbIndexScanOperation*)cursorOp->theNext;
|
||||||
|
cursorOp->release();
|
||||||
|
theNdb->releaseScanOperation(cursorOp);
|
||||||
|
} else if (m_firstExecutedScanOp != NULL) {
|
||||||
|
NdbIndexScanOperation* tOp = m_firstExecutedScanOp;
|
||||||
|
while (tOp->theNext != NULL) {
|
||||||
|
if (tOp->theNext == cursorOp) {
|
||||||
|
tOp->theNext = cursorOp->theNext;
|
||||||
|
cursorOp->release();
|
||||||
|
theNdb->releaseScanOperation(cursorOp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
tOp = (NdbIndexScanOperation*)tOp->theNext;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DBUG_VOID_RETURN;
|
||||||
|
}//NdbConnection::releaseExecutedScanOperation()
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
NdbOperation* getNdbOperation(const char* aTableName);
|
NdbOperation* getNdbOperation(const char* aTableName);
|
||||||
|
|
||||||
|
23
sql/field.cc
23
sql/field.cc
@ -5777,7 +5777,7 @@ void Field_datetime::sql_type(String &res) const
|
|||||||
|
|
||||||
int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
|
int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
|
||||||
{
|
{
|
||||||
int error= 0;
|
int error= 0, well_formed_error;
|
||||||
uint32 not_used;
|
uint32 not_used;
|
||||||
char buff[STRING_BUFFER_USUAL_SIZE];
|
char buff[STRING_BUFFER_USUAL_SIZE];
|
||||||
String tmpstr(buff,sizeof(buff), &my_charset_bin);
|
String tmpstr(buff,sizeof(buff), &my_charset_bin);
|
||||||
@ -5802,9 +5802,10 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
|
|||||||
as well as don't copy a malformed data.
|
as well as don't copy a malformed data.
|
||||||
*/
|
*/
|
||||||
copy_length= field_charset->cset->well_formed_len(field_charset,
|
copy_length= field_charset->cset->well_formed_len(field_charset,
|
||||||
from,from+length,
|
from,from+length,
|
||||||
field_length/
|
field_length/
|
||||||
field_charset->mbmaxlen);
|
field_charset->mbmaxlen,
|
||||||
|
&well_formed_error);
|
||||||
memcpy(ptr,from,copy_length);
|
memcpy(ptr,from,copy_length);
|
||||||
if (copy_length < field_length) // Append spaces if shorter
|
if (copy_length < field_length) // Append spaces if shorter
|
||||||
field_charset->cset->fill(field_charset,ptr+copy_length,
|
field_charset->cset->fill(field_charset,ptr+copy_length,
|
||||||
@ -6152,7 +6153,7 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
|
|||||||
uint32 not_used, copy_length;
|
uint32 not_used, copy_length;
|
||||||
char buff[STRING_BUFFER_USUAL_SIZE];
|
char buff[STRING_BUFFER_USUAL_SIZE];
|
||||||
String tmpstr(buff,sizeof(buff), &my_charset_bin);
|
String tmpstr(buff,sizeof(buff), &my_charset_bin);
|
||||||
int error_code= 0;
|
int error_code= 0, well_formed_error;
|
||||||
enum MYSQL_ERROR::enum_warning_level level= MYSQL_ERROR::WARN_LEVEL_WARN;
|
enum MYSQL_ERROR::enum_warning_level level= MYSQL_ERROR::WARN_LEVEL_WARN;
|
||||||
|
|
||||||
/* Convert character set if necessary */
|
/* Convert character set if necessary */
|
||||||
@ -6172,7 +6173,8 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
|
|||||||
copy_length= field_charset->cset->well_formed_len(field_charset,
|
copy_length= field_charset->cset->well_formed_len(field_charset,
|
||||||
from,from+length,
|
from,from+length,
|
||||||
field_length/
|
field_length/
|
||||||
field_charset->mbmaxlen);
|
field_charset->mbmaxlen,
|
||||||
|
&well_formed_error);
|
||||||
memcpy(ptr + length_bytes, from, copy_length);
|
memcpy(ptr + length_bytes, from, copy_length);
|
||||||
if (length_bytes == 1)
|
if (length_bytes == 1)
|
||||||
*ptr= (uchar) copy_length;
|
*ptr= (uchar) copy_length;
|
||||||
@ -6746,7 +6748,7 @@ void Field_blob::put_length(char *pos, uint32 length)
|
|||||||
|
|
||||||
int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
|
int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
|
||||||
{
|
{
|
||||||
int error= 0;
|
int error= 0, well_formed_error;
|
||||||
if (!length)
|
if (!length)
|
||||||
{
|
{
|
||||||
bzero(ptr,Field_blob::pack_length());
|
bzero(ptr,Field_blob::pack_length());
|
||||||
@ -6778,9 +6780,10 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
|
|||||||
the 'min()' call below.
|
the 'min()' call below.
|
||||||
*/
|
*/
|
||||||
copy_length= field_charset->cset->well_formed_len(field_charset,
|
copy_length= field_charset->cset->well_formed_len(field_charset,
|
||||||
from,from +
|
from,from +
|
||||||
min(length, copy_length),
|
min(length, copy_length),
|
||||||
copy_length);
|
copy_length,
|
||||||
|
&well_formed_error);
|
||||||
if (copy_length < length)
|
if (copy_length < length)
|
||||||
error= 1;
|
error= 1;
|
||||||
Field_blob::store_length(copy_length);
|
Field_blob::store_length(copy_length);
|
||||||
|
@ -505,10 +505,16 @@ void ha_close_connection(THD* thd)
|
|||||||
"beginning of transaction" and "beginning of statement").
|
"beginning of transaction" and "beginning of statement").
|
||||||
Only storage engines registered for the transaction/statement
|
Only storage engines registered for the transaction/statement
|
||||||
will know when to commit/rollback it.
|
will know when to commit/rollback it.
|
||||||
|
|
||||||
|
NOTE
|
||||||
|
trans_register_ha is idempotent - storage engine may register many
|
||||||
|
times per transaction.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
void trans_register_ha(THD *thd, bool all, handlerton *ht_arg)
|
void trans_register_ha(THD *thd, bool all, handlerton *ht_arg)
|
||||||
{
|
{
|
||||||
THD_TRANS *trans;
|
THD_TRANS *trans;
|
||||||
|
handlerton **ht;
|
||||||
DBUG_ENTER("trans_register_ha");
|
DBUG_ENTER("trans_register_ha");
|
||||||
DBUG_PRINT("enter",("%s", all ? "all" : "stmt"));
|
DBUG_PRINT("enter",("%s", all ? "all" : "stmt"));
|
||||||
|
|
||||||
@ -520,15 +526,12 @@ void trans_register_ha(THD *thd, bool all, handlerton *ht_arg)
|
|||||||
else
|
else
|
||||||
trans= &thd->transaction.stmt;
|
trans= &thd->transaction.stmt;
|
||||||
|
|
||||||
handlerton **ht=trans->ht;
|
for (ht=trans->ht; *ht; ht++)
|
||||||
while (*ht)
|
|
||||||
{
|
|
||||||
if (*ht == ht_arg)
|
if (*ht == ht_arg)
|
||||||
DBUG_VOID_RETURN; /* already registered, return */
|
DBUG_VOID_RETURN; /* already registered, return */
|
||||||
ht++;
|
|
||||||
}
|
|
||||||
|
|
||||||
trans->ht[trans->nht++]=ht_arg;
|
trans->ht[trans->nht++]=ht_arg;
|
||||||
|
DBUG_ASSERT(*ht == ht_arg);
|
||||||
trans->no_2pc|=(ht_arg->prepare==0);
|
trans->no_2pc|=(ht_arg->prepare==0);
|
||||||
if (thd->transaction.xid.is_null())
|
if (thd->transaction.xid.is_null())
|
||||||
thd->transaction.xid.set(thd->query_id);
|
thd->transaction.xid.set(thd->query_id);
|
||||||
|
@ -7020,9 +7020,10 @@ IDENT_sys:
|
|||||||
if (thd->charset_is_system_charset)
|
if (thd->charset_is_system_charset)
|
||||||
{
|
{
|
||||||
CHARSET_INFO *cs= system_charset_info;
|
CHARSET_INFO *cs= system_charset_info;
|
||||||
|
int dummy_error;
|
||||||
uint wlen= cs->cset->well_formed_len(cs, $1.str,
|
uint wlen= cs->cset->well_formed_len(cs, $1.str,
|
||||||
$1.str+$1.length,
|
$1.str+$1.length,
|
||||||
$1.length);
|
$1.length, &dummy_error);
|
||||||
if (wlen < $1.length)
|
if (wlen < $1.length)
|
||||||
{
|
{
|
||||||
my_error(ER_INVALID_CHARACTER_STRING, MYF(0),
|
my_error(ER_INVALID_CHARACTER_STRING, MYF(0),
|
||||||
|
@ -6294,10 +6294,13 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
*/
|
*/
|
||||||
static
|
static
|
||||||
uint my_well_formed_len_big5(CHARSET_INFO *cs __attribute__((unused)),
|
uint my_well_formed_len_big5(CHARSET_INFO *cs __attribute__((unused)),
|
||||||
const char *b, const char *e, uint pos)
|
const char *b, const char *e,
|
||||||
|
uint pos, int *error)
|
||||||
{
|
{
|
||||||
const char *b0= b;
|
const char *b0= b;
|
||||||
const char *emb= e - 1; /* Last possible end of an MB character */
|
const char *emb= e - 1; /* Last possible end of an MB character */
|
||||||
|
|
||||||
|
*error= 0;
|
||||||
while (pos && b < e)
|
while (pos && b < e)
|
||||||
{
|
{
|
||||||
if ((uchar) b[0] < 128)
|
if ((uchar) b[0] < 128)
|
||||||
@ -6313,6 +6316,7 @@ uint my_well_formed_len_big5(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Wrong byte sequence */
|
/* Wrong byte sequence */
|
||||||
|
*error= 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5413,9 +5413,10 @@ uint my_numcells_cp932(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
*/
|
*/
|
||||||
static
|
static
|
||||||
uint my_well_formed_len_cp932(CHARSET_INFO *cs __attribute__((unused)),
|
uint my_well_formed_len_cp932(CHARSET_INFO *cs __attribute__((unused)),
|
||||||
const char *b, const char *e, uint pos)
|
const char *b, const char *e, uint pos, int *error)
|
||||||
{
|
{
|
||||||
const char *b0= b;
|
const char *b0= b;
|
||||||
|
*error= 0;
|
||||||
while (pos && b < e)
|
while (pos && b < e)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -5441,6 +5442,7 @@ uint my_well_formed_len_cp932(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Wrong byte sequence */
|
/* Wrong byte sequence */
|
||||||
|
*error= 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8388,9 +8388,10 @@ my_jisx0212_uni_onechar(int code){
|
|||||||
|
|
||||||
static
|
static
|
||||||
uint my_well_formed_len_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
|
uint my_well_formed_len_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
|
||||||
const char *beg, const char *end, uint pos)
|
const char *beg, const char *end, uint pos, int *error)
|
||||||
{
|
{
|
||||||
const uchar *b= (uchar *) beg;
|
const uchar *b= (uchar *) beg;
|
||||||
|
*error=0;
|
||||||
|
|
||||||
for ( ; pos && b < (uchar*) end; pos--, b++)
|
for ( ; pos && b < (uchar*) end; pos--, b++)
|
||||||
{
|
{
|
||||||
@ -8408,6 +8409,7 @@ uint my_well_formed_len_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
{
|
{
|
||||||
if (*b >= 0xA0 && *b <= 0xDF)
|
if (*b >= 0xA0 && *b <= 0xDF)
|
||||||
continue;
|
continue;
|
||||||
|
*error=1;
|
||||||
return chbeg - beg; /* invalid sequence */
|
return chbeg - beg; /* invalid sequence */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8421,6 +8423,7 @@ uint my_well_formed_len_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
if (ch >= 0xA1 && ch <= 0xFE &&
|
if (ch >= 0xA1 && ch <= 0xFE &&
|
||||||
*b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
|
*b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
|
||||||
continue;
|
continue;
|
||||||
|
*error=1;
|
||||||
return chbeg - beg; /* invalid sequence */
|
return chbeg - beg; /* invalid sequence */
|
||||||
}
|
}
|
||||||
return b - (uchar *) beg;
|
return b - (uchar *) beg;
|
||||||
|
@ -264,18 +264,21 @@ uint my_charpos_mb(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint my_well_formed_len_mb(CHARSET_INFO *cs,
|
uint my_well_formed_len_mb(CHARSET_INFO *cs, const char *b, const char *e,
|
||||||
const char *b, const char *e, uint pos)
|
uint pos, int *error)
|
||||||
{
|
{
|
||||||
const char *b_start= b;
|
const char *b_start= b;
|
||||||
|
*error= 0;
|
||||||
while (pos)
|
while (pos)
|
||||||
{
|
{
|
||||||
my_wc_t wc;
|
my_wc_t wc;
|
||||||
int mblen;
|
int mblen;
|
||||||
|
|
||||||
if ((mblen= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <= 0)
|
if ((mblen= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <= 0)
|
||||||
|
{
|
||||||
|
*error= b < e ? 1 : 0;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
b+= mblen;
|
b+= mblen;
|
||||||
pos--;
|
pos--;
|
||||||
}
|
}
|
||||||
|
@ -1122,11 +1122,11 @@ uint my_charpos_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
|
|
||||||
|
|
||||||
uint my_well_formed_len_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
uint my_well_formed_len_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
||||||
const char *start,
|
const char *start, const char *end,
|
||||||
const char *end,
|
uint nchars, int *error)
|
||||||
uint nchars)
|
|
||||||
{
|
{
|
||||||
uint nbytes= (uint) (end-start);
|
uint nbytes= (uint) (end-start);
|
||||||
|
*error= 0;
|
||||||
return min(nbytes, nchars);
|
return min(nbytes, nchars);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4586,9 +4586,11 @@ uint my_numcells_sjis(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
*/
|
*/
|
||||||
static
|
static
|
||||||
uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)),
|
uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)),
|
||||||
const char *b, const char *e, uint pos)
|
const char *b, const char *e,
|
||||||
|
uint pos, int *error)
|
||||||
{
|
{
|
||||||
const char *b0= b;
|
const char *b0= b;
|
||||||
|
*error= 0;
|
||||||
while (pos && b < e)
|
while (pos && b < e)
|
||||||
{
|
{
|
||||||
if ((uchar) b[0] < 128)
|
if ((uchar) b[0] < 128)
|
||||||
@ -4609,6 +4611,7 @@ uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Wrong byte sequence */
|
/* Wrong byte sequence */
|
||||||
|
*error= 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1273,11 +1273,11 @@ uint my_charpos_ucs2(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
|
|
||||||
static
|
static
|
||||||
uint my_well_formed_len_ucs2(CHARSET_INFO *cs __attribute__((unused)),
|
uint my_well_formed_len_ucs2(CHARSET_INFO *cs __attribute__((unused)),
|
||||||
const char *b,
|
const char *b, const char *e,
|
||||||
const char *e,
|
uint nchars, int *error)
|
||||||
uint nchars)
|
|
||||||
{
|
{
|
||||||
uint nbytes= (e-b) & ~ (uint)1;
|
uint nbytes= (e-b) & ~ (uint)1;
|
||||||
|
*error= 0;
|
||||||
nchars*= 2;
|
nchars*= 2;
|
||||||
return min(nbytes, nchars);
|
return min(nbytes, nchars);
|
||||||
}
|
}
|
||||||
|
@ -8253,11 +8253,12 @@ my_jisx0212_uni_onechar(int code){
|
|||||||
|
|
||||||
static
|
static
|
||||||
uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
|
uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
|
||||||
const char *beg, const char *end, uint pos)
|
const char *beg, const char *end,
|
||||||
|
uint pos, int *error)
|
||||||
{
|
{
|
||||||
const uchar *b= (uchar *) beg;
|
const uchar *b= (uchar *) beg;
|
||||||
|
|
||||||
for ( ; pos && b < (uchar*) end; pos--, b++)
|
for ( *error= 0 ; pos && b < (uchar*) end; pos--, b++)
|
||||||
{
|
{
|
||||||
char *chbeg;
|
char *chbeg;
|
||||||
uint ch= *b;
|
uint ch= *b;
|
||||||
@ -8267,12 +8268,16 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
|
|
||||||
chbeg= (char *) b++;
|
chbeg= (char *) b++;
|
||||||
if (b >= (uchar *) end) /* need more bytes */
|
if (b >= (uchar *) end) /* need more bytes */
|
||||||
|
{
|
||||||
|
*error= 1;
|
||||||
return chbeg - beg; /* unexpected EOL */
|
return chbeg - beg; /* unexpected EOL */
|
||||||
|
}
|
||||||
|
|
||||||
if (ch == 0x8E) /* [x8E][xA0-xDF] */
|
if (ch == 0x8E) /* [x8E][xA0-xDF] */
|
||||||
{
|
{
|
||||||
if (*b >= 0xA0 && *b <= 0xDF)
|
if (*b >= 0xA0 && *b <= 0xDF)
|
||||||
continue;
|
continue;
|
||||||
|
*error= 1;
|
||||||
return chbeg - beg; /* invalid sequence */
|
return chbeg - beg; /* invalid sequence */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8280,12 +8285,16 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
{
|
{
|
||||||
ch= *b++;
|
ch= *b++;
|
||||||
if (b >= (uchar*) end)
|
if (b >= (uchar*) end)
|
||||||
|
{
|
||||||
|
*error= 1;
|
||||||
return chbeg - beg; /* unexpected EOL */
|
return chbeg - beg; /* unexpected EOL */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch >= 0xA1 && ch <= 0xFE &&
|
if (ch >= 0xA1 && ch <= 0xFE &&
|
||||||
*b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
|
*b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
|
||||||
continue;
|
continue;
|
||||||
|
*error= 1;
|
||||||
return chbeg - beg; /* invalid sequence */
|
return chbeg - beg; /* invalid sequence */
|
||||||
}
|
}
|
||||||
return b - (uchar *) beg;
|
return b - (uchar *) beg;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user