Commit d61418b9 authored by unknown's avatar unknown

Portability fixes.

Patches required by Gemini
Fix to properly detect if there is an active transaction in InnoDB
Fix to not lock thread structure when doing automatic rollback when thread ends
Allow -O lower_case_names=0 on UNIX


Docs/manual.texi:
  Some updates from mailing list.
  Changelog
client/mysqlbinlog.cc:
  Removed variables declared in net.c
configure.in:
  Added test for strtoll and fixed test for gethostname_r for AIX
mysql-test/t/innodb.test:
  Added test of active transactions
sql/field.cc:
  Patch required by Gemini
sql/field.h:
  Patch required by Gemini
sql/filesort.cc:
  Patch required by Gemini
sql/gen_lex_hash.cc:
  Update to support new syntax
sql/ha_gemini.cc:
  Patch required by Gemini
sql/ha_gemini.h:
  Patch required by Gemini
sql/ha_innobase.cc:
  Fix to properly detect if there is an active transaction in InnoDB
sql/handler.cc:
  Fix to properly detect if there is an active transaction in InnoDB
sql/handler.h:
  Fix to properly detect if there is an active transaction in InnoDB.
  Fix for Gemini
sql/lex.h:
  SHOW LOCKS
sql/mysqld.cc:
  Fix to not lock thread structure when doing automatic rollback when thread ends.
sql/share/portuguese/errmsg.txt:
  Update
sql/sql_class.cc:
  Fix to not lock thread structure when doing automatic rollback when thread ends.
sql/sql_class.h:
  Fix to properly detect if there is an active transaction in InnoDB
sql/sql_delete.cc:
  Fix for Gemini
sql/sql_parse.cc:
  Allow -O lower_case_names=0 on UNIX
sql/sql_select.cc:
  Fix for Gemini
sql/sql_table.cc:
  Allow -O lower_case_names=0 on UNIX
sql/sql_update.cc:
  Fix for Gemini
sql/sql_yacc.yy:
  For SHOW LOCKS
strings/strto.c:
  Portability fix
parent a14d63ba
...@@ -10714,6 +10714,10 @@ ld: fatal: library -ldl: not found ...@@ -10714,6 +10714,10 @@ ld: fatal: library -ldl: not found
or or
undefined reference to `dlopen' undefined reference to `dlopen'
or
cannot find -lrt
@end example @end example
If too many processes try to connect very rapidly to @code{mysqld}, you will If too many processes try to connect very rapidly to @code{mysqld}, you will
...@@ -19875,8 +19879,8 @@ will be incremented. If you are using @code{--log-slow-queries}, the query ...@@ -19875,8 +19879,8 @@ will be incremented. If you are using @code{--log-slow-queries}, the query
will be logged to the slow query logfile. @xref{Slow query log}. will be logged to the slow query logfile. @xref{Slow query log}.
@item @code{lower_case_table_names} @item @code{lower_case_table_names}
If set to 1 table names are stored in lowercase on disk. This will enable If set to 1 table names are stored in lowercase on disk and table
you to access the table names case-insensitive also on Unix. names will be case-insensitive.
@xref{Name case sensitivity}. @xref{Name case sensitivity}.
@item @code{max_allowed_packet} @item @code{max_allowed_packet}
...@@ -38431,6 +38435,8 @@ is to upgrade to MyODBC Version 2.50.33 and MySQL Version ...@@ -38431,6 +38435,8 @@ is to upgrade to MyODBC Version 2.50.33 and MySQL Version
You should also get and apply the Microsoft Jet 4.0 Service Pack 5 (SP5) You should also get and apply the Microsoft Jet 4.0 Service Pack 5 (SP5)
which can be found here which can be found here
@uref{http://support.microsoft.com/support/kb/articles/Q 239/1/14.ASP}. @uref{http://support.microsoft.com/support/kb/articles/Q 239/1/14.ASP}.
This will fix some cases where columns are marked as @code{#deleted#}
in Access.
Note that if you are using MySQL Version 3.22, you must to apply the Note that if you are using MySQL Version 3.22, you must to apply the
MDAC patch and use MyODBC 2.50.32 or 2.50.34 and above to go around MDAC patch and use MyODBC 2.50.32 or 2.50.34 and above to go around
...@@ -43273,6 +43279,11 @@ expecting to store the full length of a @code{BLOB} into a table, you'll need ...@@ -43273,6 +43279,11 @@ expecting to store the full length of a @code{BLOB} into a table, you'll need
to start the server with the @code{--set-variable=max_allowed_packet=16M} to start the server with the @code{--set-variable=max_allowed_packet=16M}
option. option.
You can also get strange problems with large packets if you are using
big blobs, but you haven't given @code{mysqld} access to enough memory
to handle the query. If you suspect this is the case, try adding
@code{ulimit -d 256000} to the beginning of the @code{safe_mysqld} script
and restart @code{mysqld}.
@node Communication errors, Full table, Packet too large, Common errors @node Communication errors, Full table, Packet too large, Common errors
@appendixsubsec Communication Errors / Aborted Connection @appendixsubsec Communication Errors / Aborted Connection
...@@ -43344,6 +43355,9 @@ Badly configured TCP/IP. ...@@ -43344,6 +43355,9 @@ Badly configured TCP/IP.
@item @item
Faulty Ethernets or hubs or switches, cables ... This can be diagnosed Faulty Ethernets or hubs or switches, cables ... This can be diagnosed
properly only by replacing hardware. properly only by replacing hardware.
@item
@code{max_allowed_packet} is too small or queries require more memory
than you have alloacated for @code{mysqld}. @xref{Packet too large}.
@end itemize @end itemize
...@@ -45719,7 +45733,7 @@ By Steve Shreeve. ...@@ -45719,7 +45733,7 @@ By Steve Shreeve.
Perl program to convert Oracle databases to MySQL. Has same Perl program to convert Oracle databases to MySQL. Has same
output format as mysqldump. By Johan Andersson. output format as mysqldump. By Johan Andersson.
@item @uref{http://www.mysql.com/Downloads/Contrib/excel2mysql, excel2mysql} @item @uref{http://www.mysql.com/Downloads/Contrib/excel2mysql.pl, excel2mysql.pl}
Perl program to import Excel spreadsheets into a MySQL database. By Stephen Hurd @email{shurd@@sk.sympatico.ca} Perl program to import Excel spreadsheets into a MySQL database. By Stephen Hurd @email{shurd@@sk.sympatico.ca}
@item @uref{http://www.mysql.com/Downloads/Contrib/T2S_100.ZIP, T2S_100.ZIP}. @item @uref{http://www.mysql.com/Downloads/Contrib/T2S_100.ZIP, T2S_100.ZIP}.
...@@ -46529,12 +46543,22 @@ not yet 100% confident in this code. ...@@ -46529,12 +46543,22 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.42 @appendixsubsec Changes in release 3.23.42
@itemize @bullet @itemize @bullet
@item @item
Fixed problem with InnoDB when one could get the error @code{Can't
execute the given command...} even when one didn't have an active
transaction.
@item
Applied some fixes for Gemini.
@item
Use real arithmetic operations even in integer context if not Use real arithmetic operations even in integer context if not
all arguments are integers. (Fixes uncommon bug in some integer all arguments are integers. (Fixes uncommon bug in some integer
context). context).
@item @item
Don't force everything to lower cases on windows. (To fix problem Don't force everything to lower cases on windows. (To fix problem
with windows and @code{ALTER TABLE}). with windows and @code{ALTER TABLE}). Now @code{--lower_case_names}
also works on Unix.
@item
Fixed that automatic rollback that is done when thread end doesn't lock
other threads.
@end itemize @end itemize
@node News-3.23.41, News-3.23.40, News-3.23.42, News-3.23.x @node News-3.23.41, News-3.23.40, News-3.23.42, News-3.23.x
...@@ -52045,9 +52069,19 @@ Start the @code{mysqld} server with a trace log in @file{/tmp/mysqld.trace} ...@@ -52045,9 +52069,19 @@ Start the @code{mysqld} server with a trace log in @file{/tmp/mysqld.trace}
@code{mysqld --debug} @code{mysqld --debug}
On Windows you should also use the @code{--standalone} flag to not start On Windows you should also use the @code{--standalone} flag to not start
@code{mysqld} as a service. @code{mysqld} as a service:
Note that the trace file will get very @emph{BIG}!
In a DOS window do:
@example
mysqld --debug --standalone
@end example
After this you can use the @code{mysql.exe} command line tool in a
second DOS window to reproduce the problem. You can take down the above
@code{mysqld} server with @code{mysqladmin shutdown}.
Note that the trace file will get very @emph{BIG}!
If you want to have a smaller trace file, you can use something like: If you want to have a smaller trace file, you can use something like:
@code{mysqld --debug=d,info,error,query,general,where:O,/tmp/mysqld.trace} @code{mysqld --debug=d,info,error,query,general,where:O,/tmp/mysqld.trace}
...@@ -41,8 +41,6 @@ uint32 server_id = 0; ...@@ -41,8 +41,6 @@ uint32 server_id = 0;
// needed by net_serv.c // needed by net_serv.c
ulong bytes_sent = 0L, bytes_received = 0L; ulong bytes_sent = 0L, bytes_received = 0L;
ulong mysqld_net_retry_count = 10L; ulong mysqld_net_retry_count = 10L;
ulong net_read_timeout= NET_READ_TIMEOUT;
ulong net_write_timeout= NET_WRITE_TIMEOUT;
uint test_flags = 0; uint test_flags = 0;
FILE *result_file; FILE *result_file;
......
...@@ -1373,7 +1373,7 @@ AC_CHECK_FUNCS(alarm bmove \ ...@@ -1373,7 +1373,7 @@ AC_CHECK_FUNCS(alarm bmove \
getrusage getpwuid getcwd getrlimit getwd index stpcpy locking longjmp \ getrusage getpwuid getcwd getrlimit getwd index stpcpy locking longjmp \
perror pread realpath readlink rename \ perror pread realpath readlink rename \
socket strnlen madvise mkstemp \ socket strnlen madvise mkstemp \
strtol strtoul strtoull snprintf tempnam thr_setconcurrency \ strtol strtoul strtoll strtoull snprintf tempnam thr_setconcurrency \
gethostbyaddr_r gethostbyname_r getpwnam \ gethostbyaddr_r gethostbyname_r getpwnam \
bfill bzero bcmp strstr strpbrk strerror \ bfill bzero bcmp strstr strpbrk strerror \
tell atod memcpy memmove \ tell atod memcpy memmove \
...@@ -1485,7 +1485,7 @@ AC_TRY_COMPILE( ...@@ -1485,7 +1485,7 @@ AC_TRY_COMPILE(
#include <netdb.h>], #include <netdb.h>],
[int skr; [int skr;
skr = gethostbyname_r((const char *) 0, (struct hostent*) 0, (hostent_data*) 0);], skr = gethostbyname_r((const char *) 0, (struct hostent*) 0, (struct hostent_data*) 0);],
mysql_cv_gethostname_arg=hostent_data, mysql_cv_gethostname_arg=char)) mysql_cv_gethostname_arg=hostent_data, mysql_cv_gethostname_arg=char))
AC_LANG_RESTORE AC_LANG_RESTORE
CXXFLAGS="$ac_save_CXXFLAGS" CXXFLAGS="$ac_save_CXXFLAGS"
......
...@@ -161,6 +161,20 @@ delete from t1; ...@@ -161,6 +161,20 @@ delete from t1;
commit; commit;
select * from t1; select * from t1;
drop table t1; drop table t1;
#
# Test of active transactions
#
create table t1 (a integer) type=innodb;
begin;
rename table t1 to t2;
create table t1 (b integer) type=innodb;
insert into t1 values (1);
rollback;
drop table t1;
rename table t2 to t1;
drop table t1;
set autocommit=1; set autocommit=1;
# #
......
...@@ -4122,7 +4122,7 @@ ulonglong Field_blob::get_id(const char *from) ...@@ -4122,7 +4122,7 @@ ulonglong Field_blob::get_id(const char *from)
ulonglong id = 0; ulonglong id = 0;
ulong length=get_length(from); ulong length=get_length(from);
if (length) if (length)
longlongget(id, from+packlength); uint8korr(id, from+packlength);
return id; return id;
} }
......
...@@ -874,6 +874,14 @@ class Field_blob :public Field_str { ...@@ -874,6 +874,14 @@ class Field_blob :public Field_str {
uint max_length= ~(uint) 0); uint max_length= ~(uint) 0);
ulonglong get_id(const char *from); ulonglong get_id(const char *from);
const char *unpack_id(char *to, const char *from, const char *bdata); const char *unpack_id(char *to, const char *from, const char *bdata);
inline void get_ptr_from_key_image(char **str,char *key_str)
{
*str = key_str + sizeof(uint16);
}
inline uint get_length_from_key_image(char *key_str)
{
return uint2korr(key_str);
}
enum_field_types blobtype() { return (packlength == 1 ? FIELD_TYPE_TINY_BLOB : FIELD_TYPE_BLOB);} enum_field_types blobtype() { return (packlength == 1 ? FIELD_TYPE_TINY_BLOB : FIELD_TYPE_BLOB);}
#endif #endif
char *pack_key(char *to, const char *from, uint max_length); char *pack_key(char *to, const char *from, uint max_length);
......
...@@ -388,6 +388,8 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select, ...@@ -388,6 +388,8 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
} }
make_sortkey(param,sort_keys[idx++],ref_pos); make_sortkey(param,sort_keys[idx++],ref_pos);
} }
else
file->unlock_row();
} }
(void) file->extra(HA_EXTRA_NO_CACHE); /* End cacheing of records */ (void) file->extra(HA_EXTRA_NO_CACHE); /* End cacheing of records */
file->rnd_end(); file->rnd_end();
......
...@@ -472,7 +472,7 @@ int main(int argc,char **argv) ...@@ -472,7 +472,7 @@ int main(int argc,char **argv)
int error; int error;
MY_INIT(argv[0]); MY_INIT(argv[0]);
start_value=2663113L; best_t1=1175350L; best_t2=7404531L; best_type=4; /* mode=4327 add=3 type: 0 */ start_value=8214901L; best_t1=4099790L; best_t2=2406115L; best_type=4; /* mode=4799 add=2 type: 0 */
if (get_options(argc,(char **) argv)) if (get_options(argc,(char **) argv))
exit(1); exit(1);
......
...@@ -93,6 +93,7 @@ bool gemini_init(void) ...@@ -93,6 +93,7 @@ bool gemini_init(void)
DBUG_ENTER("gemini_init"); DBUG_ENTER("gemini_init");
gemini_basedir=mysql_home;
/* If datadir isn't set, bail out */ /* If datadir isn't set, bail out */
if (*mysql_real_data_home == '\0') if (*mysql_real_data_home == '\0')
{ {
......
...@@ -205,3 +205,4 @@ int gemini_set_option_long(int optid, long optval); ...@@ -205,3 +205,4 @@ int gemini_set_option_long(int optid, long optval);
const int gemini_blocksize = BLKSIZE; const int gemini_blocksize = BLKSIZE;
const int gemini_recbits = DEFAULT_RECBITS; const int gemini_recbits = DEFAULT_RECBITS;
extern "C" void uttrace(void);
...@@ -2219,7 +2219,7 @@ ha_innobase::external_lock( ...@@ -2219,7 +2219,7 @@ ha_innobase::external_lock(
if (trx->n_mysql_tables_in_use == 0) { if (trx->n_mysql_tables_in_use == 0) {
trx_mark_sql_stat_end(trx); trx_mark_sql_stat_end(trx);
} }
thd->transaction.all.innodb_active_trans=1;
trx->n_mysql_tables_in_use++; trx->n_mysql_tables_in_use++;
if (prebuilt->select_lock_type != LOCK_NONE) { if (prebuilt->select_lock_type != LOCK_NONE) {
......
...@@ -286,6 +286,7 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans) ...@@ -286,6 +286,7 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
my_error(ER_ERROR_DURING_COMMIT, MYF(0), error); my_error(ER_ERROR_DURING_COMMIT, MYF(0), error);
error=1; error=1;
} }
trans->innodb_active_trans=0;
} }
#endif #endif
#ifdef HAVE_GEMINI_DB #ifdef HAVE_GEMINI_DB
...@@ -337,6 +338,7 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans) ...@@ -337,6 +338,7 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), error); my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), error);
error=1; error=1;
} }
trans->innodb_active_trans=0;
} }
#endif #endif
#ifdef HAVE_GEMINI_DB #ifdef HAVE_GEMINI_DB
......
...@@ -128,6 +128,7 @@ typedef struct st_thd_trans { ...@@ -128,6 +128,7 @@ typedef struct st_thd_trans {
void *bdb_tid; void *bdb_tid;
void *innobase_tid; void *innobase_tid;
void *gemini_tid; void *gemini_tid;
bool innodb_active_trans;
} THD_TRANS; } THD_TRANS;
enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED, enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED,
...@@ -267,6 +268,7 @@ class handler :public Sql_alloc ...@@ -267,6 +268,7 @@ class handler :public Sql_alloc
virtual int extra(enum ha_extra_function operation)=0; virtual int extra(enum ha_extra_function operation)=0;
virtual int reset()=0; virtual int reset()=0;
virtual int external_lock(THD *thd, int lock_type)=0; virtual int external_lock(THD *thd, int lock_type)=0;
virtual void unlock_row() {}
virtual int start_stmt(THD *thd) {return 0;} virtual int start_stmt(THD *thd) {return 0;}
virtual int delete_all_rows(); virtual int delete_all_rows();
virtual longlong get_auto_increment(); virtual longlong get_auto_increment();
......
...@@ -196,6 +196,7 @@ static SYMBOL symbols[] = { ...@@ -196,6 +196,7 @@ static SYMBOL symbols[] = {
{ "LOAD", SYM(LOAD),0,0}, { "LOAD", SYM(LOAD),0,0},
{ "LOCAL", SYM(LOCAL_SYM),0,0}, { "LOCAL", SYM(LOCAL_SYM),0,0},
{ "LOCK", SYM(LOCK_SYM),0,0}, { "LOCK", SYM(LOCK_SYM),0,0},
{ "LOCKS", SYM(LOCKS_SYM),0,0},
{ "LOGS", SYM(LOGS_SYM),0,0}, { "LOGS", SYM(LOGS_SYM),0,0},
{ "LONG", SYM(LONG_SYM),0,0}, { "LONG", SYM(LONG_SYM),0,0},
{ "LONGBLOB", SYM(LONGBLOB),0,0}, { "LONGBLOB", SYM(LONGBLOB),0,0},
......
...@@ -995,6 +995,7 @@ sig_handler end_thread_signal(int sig __attribute__((unused))) ...@@ -995,6 +995,7 @@ sig_handler end_thread_signal(int sig __attribute__((unused)))
void end_thread(THD *thd, bool put_in_cache) void end_thread(THD *thd, bool put_in_cache)
{ {
DBUG_ENTER("end_thread"); DBUG_ENTER("end_thread");
thd->cleanup();
(void) pthread_mutex_lock(&LOCK_thread_count); (void) pthread_mutex_lock(&LOCK_thread_count);
thread_count--; thread_count--;
delete thd; delete thd;
...@@ -1189,8 +1190,13 @@ the thread stack. Please read http://www.mysql.com/doc/L/i/Linux.html\n\n", ...@@ -1189,8 +1190,13 @@ the thread stack. Please read http://www.mysql.com/doc/L/i/Linux.html\n\n",
#ifdef HAVE_STACKTRACE #ifdef HAVE_STACKTRACE
if(!(test_flags & TEST_NO_STACKTRACE)) if(!(test_flags & TEST_NO_STACKTRACE))
{
#ifdef HAVE_GEMINI_DB
utrace();
#endif
print_stacktrace(thd ? (gptr) thd->thread_stack : (gptr) 0, print_stacktrace(thd ? (gptr) thd->thread_stack : (gptr) 0,
thread_stack); thread_stack);
}
if (thd) if (thd)
{ {
fprintf(stderr, "Trying to get some variables.\n\ fprintf(stderr, "Trying to get some variables.\n\
...@@ -2054,6 +2060,7 @@ static int bootstrap(FILE *file) ...@@ -2054,6 +2060,7 @@ static int bootstrap(FILE *file)
(void) pthread_mutex_unlock(&LOCK_thread_count); (void) pthread_mutex_unlock(&LOCK_thread_count);
error= thd->fatal_error; error= thd->fatal_error;
net_end(&thd->net); net_end(&thd->net);
thd->cleanup();
delete thd; delete thd;
return error; return error;
} }
......
This diff is collapsed.
...@@ -101,7 +101,7 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0), ...@@ -101,7 +101,7 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0),
mysys_var=0; mysys_var=0;
net.vio=0; net.vio=0;
ull=0; ull=0;
system_thread=0; system_thread=cleanup_done=0;
#ifdef __WIN__ #ifdef __WIN__
real_id = 0; real_id = 0;
#endif #endif
...@@ -149,15 +149,11 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0), ...@@ -149,15 +149,11 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0),
#endif #endif
} }
THD::~THD() /* Do operations that may take a long time */
void THD::cleanup(void)
{ {
DBUG_ENTER("~THD()"); DBUG_ENTER("THD::cleanup");
/* Close connection */
if (net.vio)
{
vio_delete(net.vio);
net_end(&net);
}
ha_rollback(this); ha_rollback(this);
if (locked_tables) if (locked_tables)
{ {
...@@ -172,6 +168,21 @@ THD::~THD() ...@@ -172,6 +168,21 @@ THD::~THD()
ha_close_connection(this); ha_close_connection(this);
} }
#endif #endif
cleanup_done=1;
DBUG_VOID_RETURN;
}
THD::~THD()
{
DBUG_ENTER("~THD()");
/* Close connection */
if (net.vio)
{
vio_delete(net.vio);
net_end(&net);
}
if (!cleanup_done)
cleanup();
if (global_read_lock) if (global_read_lock)
{ {
pthread_mutex_lock(&LOCK_open); pthread_mutex_lock(&LOCK_open);
......
...@@ -283,7 +283,7 @@ class THD :public ilink { ...@@ -283,7 +283,7 @@ class THD :public ilink {
bool no_errors, allow_sum_func, password, fatal_error; bool no_errors, allow_sum_func, password, fatal_error;
bool query_start_used,last_insert_id_used,insert_id_used; bool query_start_used,last_insert_id_used,insert_id_used;
bool system_thread,in_lock_tables,global_read_lock; bool system_thread,in_lock_tables,global_read_lock;
bool query_error, bootstrap; bool query_error, bootstrap, cleanup_done;
bool volatile killed; bool volatile killed;
LOG_INFO* current_linfo; LOG_INFO* current_linfo;
// if we do a purge of binary logs, log index info of the threads // if we do a purge of binary logs, log index info of the threads
...@@ -295,6 +295,7 @@ class THD :public ilink { ...@@ -295,6 +295,7 @@ class THD :public ilink {
THD(); THD();
~THD(); ~THD();
void cleanup(void);
bool store_globals(); bool store_globals();
#ifdef SIGNAL_WITH_VIO_CLOSE #ifdef SIGNAL_WITH_VIO_CLOSE
inline void set_active_vio(Vio* vio) inline void set_active_vio(Vio* vio)
...@@ -360,7 +361,7 @@ class THD :public ilink { ...@@ -360,7 +361,7 @@ class THD :public ilink {
{ {
#ifdef USING_TRANSACTIONS #ifdef USING_TRANSACTIONS
return (transaction.all.bdb_tid != 0 || return (transaction.all.bdb_tid != 0 ||
transaction.all.innobase_tid != 0 || transaction.all.innodb_active_trans != 0 ||
transaction.all.gemini_tid != 0); transaction.all.gemini_tid != 0);
#else #else
return 0; return 0;
......
...@@ -216,6 +216,8 @@ int mysql_delete(THD *thd,TABLE_LIST *table_list,COND *conds,ha_rows limit, ...@@ -216,6 +216,8 @@ int mysql_delete(THD *thd,TABLE_LIST *table_list,COND *conds,ha_rows limit,
break; break;
} }
} }
else
table->file->unlock_row(); // Row failed selection, release lock on it
} }
thd->proc_info="end"; thd->proc_info="end";
end_read_record(&info); end_read_record(&info);
......
...@@ -2667,13 +2667,11 @@ TABLE_LIST *add_table_to_list(Table_ident *table, LEX_STRING *alias, ...@@ -2667,13 +2667,11 @@ TABLE_LIST *add_table_to_list(Table_ident *table, LEX_STRING *alias,
DBUG_RETURN(0); DBUG_RETURN(0);
} }
#ifdef FN_NO_CASE_SENCE
if (!alias) /* Alias is case sensitive */ if (!alias) /* Alias is case sensitive */
if (!(alias_str=sql_strmake(alias_str,table->table.length))) if (!(alias_str=sql_strmake(alias_str,table->table.length)))
DBUG_RETURN(0); DBUG_RETURN(0);
if (lower_case_table_names) if (lower_case_table_names)
casedn_str(table->table.str); casedn_str(table->table.str);
#endif
if (!(ptr = (TABLE_LIST *) thd->calloc(sizeof(TABLE_LIST)))) if (!(ptr = (TABLE_LIST *) thd->calloc(sizeof(TABLE_LIST))))
DBUG_RETURN(0); /* purecov: inspected */ DBUG_RETURN(0); /* purecov: inspected */
ptr->db= table->db.str; ptr->db= table->db.str;
......
...@@ -4130,6 +4130,8 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records) ...@@ -4130,6 +4130,8 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
if (not_used_in_distinct && found_records != join->found_records) if (not_used_in_distinct && found_records != join->found_records)
return 0; return 0;
} }
else
info->file->unlock_row();
} }
} while (!(error=info->read_record(info))); } while (!(error=info->read_record(info)));
if (error > 0) // Fatal error if (error > 0) // Fatal error
......
...@@ -1125,16 +1125,12 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -1125,16 +1125,12 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
{ {
strmov(new_name_buff,new_name); strmov(new_name_buff,new_name);
fn_same(new_name_buff,table_name,3); fn_same(new_name_buff,table_name,3);
#ifdef FN_NO_CASE_SENCE
if (lower_case_table_names) if (lower_case_table_names)
casedn_str(new_name); casedn_str(new_name);
if ((lower_case_table_names && if ((lower_case_table_names &&
!my_strcasecmp(new_name_buff,table_name)) || !my_strcasecmp(new_name_buff,table_name)) ||
(!lower_case_table_names && (!lower_case_table_names &&
!strcmp(new_name_buff,table_name))) !strcmp(new_name_buff,table_name)))
#else
if (!strcmp(new_name_buff,table_name)) // Check if name changed
#endif
new_name=table_name; // No. Make later check easier new_name=table_name; // No. Make later check easier
else else
{ {
......
...@@ -259,6 +259,8 @@ int mysql_update(THD *thd,TABLE_LIST *table_list,List<Item> &fields, ...@@ -259,6 +259,8 @@ int mysql_update(THD *thd,TABLE_LIST *table_list,List<Item> &fields,
} }
} }
} }
else
table->file->unlock_row();
} }
end_read_record(&info); end_read_record(&info);
thd->proc_info="end"; thd->proc_info="end";
......
...@@ -121,6 +121,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); ...@@ -121,6 +121,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token KILL_SYM %token KILL_SYM
%token LOAD %token LOAD
%token LOCK_SYM %token LOCK_SYM
%token LOCKS_SYM
%token UNLOCK_SYM %token UNLOCK_SYM
%token ACTION %token ACTION
...@@ -2560,6 +2561,7 @@ keyword: ...@@ -2560,6 +2561,7 @@ keyword:
| INNOBASE_SYM {} | INNOBASE_SYM {}
| LEVEL_SYM {} | LEVEL_SYM {}
| LOCAL_SYM {} | LOCAL_SYM {}
| LOCKS_SYM {}
| LOGS_SYM {} | LOGS_SYM {}
| MAX_ROWS {} | MAX_ROWS {}
| MASTER_SYM {} | MASTER_SYM {}
......
...@@ -42,6 +42,10 @@ ...@@ -42,6 +42,10 @@
#include "my_sys.h" /* defines errno */ #include "my_sys.h" /* defines errno */
#include <errno.h> #include <errno.h>
#undef strtoull
#undef strtoll
#undef strtoul
#undef strtol
#ifdef USE_LONGLONG #ifdef USE_LONGLONG
#define UTYPE_MAX (~(ulonglong) 0) #define UTYPE_MAX (~(ulonglong) 0)
#define TYPE_MIN LONGLONG_MIN #define TYPE_MIN LONGLONG_MIN
......
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