1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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
This commit is contained in:
monty@hundin.mysql.fi
2001-08-21 20:06:00 +03:00
parent 301af97d4a
commit 063a1a6557
25 changed files with 143 additions and 55 deletions

View File

@ -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
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
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
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.
@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.
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.
@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}
@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}

View File

@ -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;

View File

@ -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(
#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"

View File

@ -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;
# #

View File

@ -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;
} }

View File

@ -874,6 +874,14 @@ public:
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);

View File

@ -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();

View File

@ -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);

View File

@ -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')
{ {

View File

@ -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);

View File

@ -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) {

View File

@ -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)
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

View File

@ -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 @@ public:
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();

View File

@ -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},

View File

@ -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",
#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)
(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;
} }

View File

@ -1,6 +1,6 @@
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB /* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
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 */
/* Updated by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */ /* Updated by Roberto de Martin Serqueira - martinsc@uol.com.br - 08.20.2001 */
"hashchk", "hashchk",
"isamchk", "isamchk",
"n<>o", "n<>o",
@ -35,14 +35,14 @@
"Manipulador de tabela para '%-.64s' n<>o tem esta op<6F><70>o", "Manipulador de tabela para '%-.64s' n<>o tem esta op<6F><70>o",
"N<>o pode encontrar registro em '%-.64s'", "N<>o pode encontrar registro em '%-.64s'",
"Informa<6D><61>o incorreta no arquivo '%-.64s'", "Informa<6D><61>o incorreta no arquivo '%-.64s'",
"Arquivo chave incorreto para tabela '%-.64s'. Tente reparar", "Arquivo de <20>ndice incorreto para tabela '%-.64s'. Tente reparar",
"Arquivo chave desatualizado para tabela '%-.64s'. Repare-o!", "Arquivo chave desatualizado para tabela '%-.64s'. Repare-o!",
"Tabela '%-.64s' <20> somente para leitura", "Tabela '%-.64s' <20> somente para leitura",
"Sem mem<65>ria. Reinicie o programa e tente novamente (necessita de %d bytes)", "Sem mem<65>ria. Reinicie o programa e tente novamente (necessita de %d bytes)",
"Sem mem<65>ria para ordena<6E><61>o. Aumente tamanho do 'buffer' de ordena<6E><61>o", "Sem mem<65>ria para ordena<6E><61>o. Aumente tamanho do 'buffer' de ordena<6E><61>o",
"Encontrado fim de arquivo inesperado ao ler arquivo '%-.64s' (erro no. %d)", "Encontrado fim de arquivo inesperado ao ler arquivo '%-.64s' (erro no. %d)",
"Excesso de conex<65>es", "Excesso de conex<65>es",
"Sem mem<65>ria. Verifique se o mysqld ou algum outro processo est<73> usando toda mem<65>ria dispon<6F>vel. Se n<>o, voc<6F> pode ter que usar 'ulimit' para permitir ao mysqld usar mais mem<65>ria ou se voc<EFBFBD> pode adicionar mais <20>rea de 'swap'", "Sem mem<65>ria. Verifique se o mysqld ou algum outro processo est<73> usando toda mem<65>ria dispon<6F>vel. Se n<>o, voc<6F> pode ter que usar 'ulimit' para permitir ao mysqld usar mais mem<65>ria ou voc<6F> pode adicionar mais <20>rea de 'swap'",
"N<>o pode obter nome do 'host' para seu endere<72>o", "N<>o pode obter nome do 'host' para seu endere<72>o",
"Negocia<69><61>o de acesso falhou", "Negocia<69><61>o de acesso falhou",
"Acesso negado para o usu<73>rio '%-.32s@%-.64s' ao banco de dados '%-.64s'", "Acesso negado para o usu<73>rio '%-.32s@%-.64s' ao banco de dados '%-.64s'",
@ -58,7 +58,7 @@
"Coluna '%-.64s' desconhecida em '%-.64s'", "Coluna '%-.64s' desconhecida em '%-.64s'",
"'%-.64s' n<>o est<73> em 'GROUP BY'", "'%-.64s' n<>o est<73> em 'GROUP BY'",
"N<>o pode agrupar em '%-.64s'", "N<>o pode agrupar em '%-.64s'",
"Cl<43>usula cont<6E>m fun<75><6E>es de soma e colunas juntos", "Cl<43>usula cont<6E>m fun<75><6E>es de soma e colunas juntas",
"Contagem de colunas n<>o confere com a contagem de valores", "Contagem de colunas n<>o confere com a contagem de valores",
"Nome identificador '%-.100s' <20> longo demais", "Nome identificador '%-.100s' <20> longo demais",
"Nome da coluna '%-.64s' duplicado", "Nome da coluna '%-.64s' duplicado",
@ -72,27 +72,27 @@
"Definida mais de uma chave prim<69>ria", "Definida mais de uma chave prim<69>ria",
"Especificadas chaves demais. O m<>ximo permitido s<>o %d chaves", "Especificadas chaves demais. O m<>ximo permitido s<>o %d chaves",
"Especificadas partes de chave demais. O m<>ximo permitido s<>o %d partes", "Especificadas partes de chave demais. O m<>ximo permitido s<>o %d partes",
"Chave especificada longa demais. O comprimento m<>ximo permitido <20> %d", "Chave especificada longa demais. O comprimento de chave m<EFBFBD>ximo permitido <20> %d",
"Coluna chave '%-.64s' n<>o existe na tabela", "Coluna chave '%-.64s' n<>o existe na tabela",
"Coluna BLOB '%-.64s' n<>o pode ser utilizada na especifica<63><61>o de chave para o tipo de tabela usado", "Coluna BLOB '%-.64s' n<>o pode ser utilizada na especifica<63><61>o de chave para o tipo de tabela usado",
"Comprimento da coluna '%-.64s' grande demais (max = %d). Use BLOB em seu lugar", "Comprimento da coluna '%-.64s' grande demais (max = %d). Use BLOB em seu lugar",
"Defini<6E><69>o incorreta de tabela. Somente <20> permitido um campo auto-incrementado e ele tem que ser definido como chave", "Defini<6E><69>o incorreta de tabela. Somente <20> permitido um <EFBFBD>nico campo auto-incrementado e ele tem que ser definido como chave",
"%s: Pronto para conex<65>es\n", "%s: Pronto para conex<65>es\n",
"%s: 'Shutdown' normal\n", "%s: 'Shutdown' normal\n",
"%s: Obteve sinal %d. Abortando!\n", "%s: Obteve sinal %d. Abortando!\n",
"%s: 'Shutdown' completo\n", "%s: 'Shutdown' completo\n",
"%s: For<6F>ando finaliza<7A><61>o da 'thread' %ld - usu<73>rio '%-.32s'\n", "%s: For<6F>ando finaliza<7A><61>o da 'thread' %ld - usu<73>rio '%-.32s'\n",
"N<>o pode criar 'socket' IP", "N<>o pode criar 'IP socket'",
"Tabela '%-.64s' n<>o possui um <20>ndice como o usado em CREATE INDEX. Recrie a tabela", "Tabela '%-.64s' n<>o possui um <20>ndice como o usado em CREATE INDEX. Recrie a tabela",
"Argumento separador de campos n<>o <20> o esperado. Confira no manual", "Argumento separador de campos n<>o <20> o esperado. Confira no manual",
"Voc<6F> n<>o pode usar comprimento de linha fixo com BLOBs. Favor usar 'fields terminated by'", "Voc<6F> n<>o pode usar comprimento de linha fixo com BLOBs. Favor usar 'fields terminated by'",
"Arquivo '%-.64s' tem que estar no diret<65>rio do banco de dados ou ter leitura permitida para todos", "Arquivo '%-.64s' tem que estar no diret<65>rio do banco de dados ou ter leitura poss<EFBFBD>vel para todos",
"Arquivo '%-.80s' j<> existe", "Arquivo '%-.80s' j<> existe",
"Registros: %ld - Deletados: %ld - Ignorados: %ld - Avisos: %ld", "Registros: %ld - Deletados: %ld - Ignorados: %ld - Avisos: %ld",
"Registros: %ld - Duplicados: %ld", "Registros: %ld - Duplicados: %ld",
"Parte de chave incorreta. A parte de chave usada n<>o <20> um 'string' ou o comprimento usado <20> maior do que a parte de chave", "Parte de chave incorreta. A parte de chave usada n<>o <20> um 'string' ou o comprimento usado <20> maior do que a parte de chave ou o manipulador de tabelas n<>o aceita partes de chaves <20>nicas",
"Voc<6F> n<>o pode deletar todas as colunas com ALTER TABLE. Use DROP TABLE em seu lugar", "Voc<6F> n<>o pode deletar todas as colunas com ALTER TABLE. Use DROP TABLE em seu lugar",
"N<>o pode fazer DROP '%-.64s'. Confira se este campo/chave existe", "N<>o pode fazer DROP '%-.64s'. Confira se esta coluna/chave existe",
"Registros: %ld - Duplicados: %ld - Avisos: %ld", "Registros: %ld - Duplicados: %ld - Avisos: %ld",
"INSERT TABLE '%-.64s' n<>o <20> permitido em lista de tabelas FROM", "INSERT TABLE '%-.64s' n<>o <20> permitido em lista de tabelas FROM",
"'Id' de 'thread' %lu desconhecido", "'Id' de 'thread' %lu desconhecido",
@ -112,14 +112,14 @@
"Par<61>metros incorretos para a 'procedure' '%-.64s'", "Par<61>metros incorretos para a 'procedure' '%-.64s'",
"Tabela '%-.64s' desconhecida em '%-.32s'", "Tabela '%-.64s' desconhecida em '%-.32s'",
"Coluna '%-.64s' especificada duas vezes", "Coluna '%-.64s' especificada duas vezes",
"Uso inv<6E>lido da fun<75><6E>o GROUP", "Uso inv<6E>lido de fun<75><6E>o de grupo",
"Tabela '%-.64s' usa uma extens<6E>o que n<>o existe nesta vers<72>o do MySQL", "Tabela '%-.64s' usa uma extens<6E>o que n<>o existe nesta vers<72>o do MySQL",
"Uma tabela tem que ter pelo menos uma (1) coluna", "Uma tabela tem que ter pelo menos uma (1) coluna",
"Tabela '%-.64s' est<73> cheia", "Tabela '%-.64s' est<73> cheia",
"Conjunto de caracteres '%-.64s' desconhecido", "Conjunto de caracteres '%-.64s' desconhecido",
"Tabelas demais. O MySQL pode usar somente %d tabelas em um JOIN", "Tabelas demais. O MySQL pode usar somente %d tabelas em um JOIN",
"Colunas demais", "Colunas demais",
"Tamanho de linha grande demais. O m<>ximo tamanho de linha, n<>o contando BLOBs, <20> de %d. Voc<6F> tem que mudar alguns campos para BLOBs", "Tamanho de linha grande demais. O m<>ximo tamanho de linha, n<>o contando BLOBs, <20> %d. Voc<6F> tem que mudar alguns campos para BLOBs",
"Estouro da pilha do 'thread'. Usados %ld de uma pilha de %ld . Use 'mysqld -O thread_stack=#' para especificar uma pilha maior, se necess<73>rio", "Estouro da pilha do 'thread'. Usados %ld de uma pilha de %ld . Use 'mysqld -O thread_stack=#' para especificar uma pilha maior, se necess<73>rio",
"Depend<6E>ncia cruzada encontrada em OUTER JOIN. Examine suas condi<64><69>es ON", "Depend<6E>ncia cruzada encontrada em OUTER JOIN. Examine suas condi<64><69>es ON",
"Coluna '%-.64s' <20> usada com UNIQUE ou INDEX, mas n<>o est<73> definida como NOT NULL", "Coluna '%-.64s' <20> usada com UNIQUE ou INDEX, mas n<>o est<73> definida como NOT NULL",
@ -136,7 +136,7 @@
"Voc<6F> tem que ter o privil<69>gio para atualizar tabelas no banco de dados mysql para ser capaz de mudar a senha de outros", "Voc<6F> tem que ter o privil<69>gio para atualizar tabelas no banco de dados mysql para ser capaz de mudar a senha de outros",
"N<>o pode encontrar nenhuma linha que combine na tabela user", "N<>o pode encontrar nenhuma linha que combine na tabela user",
"Linhas que combinaram: %ld - Alteradas: %ld - Avisos: %ld", "Linhas que combinaram: %ld - Alteradas: %ld - Avisos: %ld",
"N<>o pode criar uma nova 'thread' (erro no. %d). Se voc<6F> n<>o estiver sem mem<65>ria dispon<6F>vel, voc<6F> pode consultar o manual sobre uma poss<73>vel falha dependente do sistema operacional", "N<>o pode criar uma nova 'thread' (erro no. %d). Se voc<6F> n<>o estiver sem mem<65>ria dispon<6F>vel, voc<6F> pode consultar o manual sobre um poss<73>vel 'bug' dependente do sistema operacional",
"Contagem de colunas n<>o confere com a contagem de valores na linha %ld", "Contagem de colunas n<>o confere com a contagem de valores na linha %ld",
"N<>o pode reabrir a tabela '%-.64s', "N<>o pode reabrir a tabela '%-.64s',
"Uso inv<6E>lido do valor NULL", "Uso inv<6E>lido do valor NULL",
@ -151,22 +151,22 @@
"N<>o existe tal 'grant' definido para o usu<73>rio '%-.32s' no 'host' '%-.64s', na tabela '%-.64s'", "N<>o existe tal 'grant' definido para o usu<73>rio '%-.32s' no 'host' '%-.64s', na tabela '%-.64s'",
"Comando usado n<>o <20> permitido para esta vers<72>o do MySQL", "Comando usado n<>o <20> permitido para esta vers<72>o do MySQL",
"Voc<6F> tem um erro de sintaxe no seu SQL", "Voc<6F> tem um erro de sintaxe no seu SQL",
"'Thread' de inser<65><72>o retardada ('delayed') n<>o conseguiu obter trava solicitada na tabela '%-.64s'", "'Thread' de inser<65><72>o retardada ('delayed') n<>o conseguiu obter trava solicitada para tabela '%-.64s'",
"Excesso de 'threads' retardadas ('delayed') em uso", "Excesso de 'threads' retardadas ('delayed') em uso",
"Conex<65>o %ld abortou para o banco de dados '%-.64s' - usu<73>rio '%-.32s' (%-.64s)", "Conex<65>o %ld abortou para o banco de dados '%-.64s' - usu<73>rio '%-.32s' (%-.64s)",
"Obteve um pacote maior do que 'max_allowed_packet'", "Obteve um pacote maior do que 'max_allowed_packet'",
"Obteve um erro de leitura no 'pipe' de conex<65>o", "Obteve um erro de leitura no 'pipe' da conex<65>o",
"Obteve um erro em fcntl()", "Obteve um erro em fcntl()",
"Obteve pacotes fora de ordem", "Obteve pacotes fora de ordem",
"N<>o conseguiu descomprimir pacote de comunica<63><61>o", "N<>o conseguiu descomprimir pacote de comunica<63><61>o",
"Obteve um erro na leitura de pacotes de comunica<63><61>o", "Obteve um erro na leitura de pacotes de comunica<63><61>o",
"Obteve expira<72><61>o de tempo ('timeout') na leitura de pacotes de comunica<63><61>o", "Obteve expira<72><61>o de tempo ('timeout') na leitura de pacotes de comunica<63><61>o",
"Obteve um erro na grava<EFBFBD><EFBFBD>o de pacotes de comunica<63><61>o", "Obteve um erro na escrita de pacotes de comunica<63><61>o",
"Obteve expira<72><61>o de tempo ('timeout') na escrita de pacotes de comunica<63><61>o", "Obteve expira<72><61>o de tempo ('timeout') na escrita de pacotes de comunica<63><61>o",
"'String' resultante <20> mais longa do que 'max_allowed_packet'", "'String' resultante <20> mais longa do que 'max_allowed_packet'",
"Tipo de tabela usado n<>o permite colunas BLOB/TEXT", "Tipo de tabela usado n<>o permite colunas BLOB/TEXT",
"Tipo de tabela usado n<>o permite colunas AUTO_INCREMENT", "Tipo de tabela usado n<>o permite colunas AUTO_INCREMENT",
"INSERT DELAYED n<>o pode ser usado com a tabela '%-.64s', porque est<73> travada com LOCK TABLES", "INSERT DELAYED n<>o pode ser usado com a tabela '%-.64s', porque ela est<EFBFBD> travada com LOCK TABLES",
"Nome de coluna '%-.100s' incorreto", "Nome de coluna '%-.100s' incorreto",
"O manipulador de tabela usado n<>o pode indexar a coluna '%-.64s'", "O manipulador de tabela usado n<>o pode indexar a coluna '%-.64s'",
"Tabelas no MERGE n<>o est<73>o todas definidas identicamente", "Tabelas no MERGE n<>o est<73>o todas definidas identicamente",
@ -176,7 +176,7 @@
"O resultado consistiu em mais do que uma linha", "O resultado consistiu em mais do que uma linha",
"Este tipo de tabela requer uma chave prim<69>ria", "Este tipo de tabela requer uma chave prim<69>ria",
"Esta vers<72>o do MySQL n<>o foi compilada com suporte a RAID", "Esta vers<72>o do MySQL n<>o foi compilada com suporte a RAID",
"Voc<6F> est<73> usando modo de atualiza<7A><61>o seguro e tentou atualizar uma tabela sem um WHERE que use uma coluna tipo KEY", "Voc<6F> est<73> usando modo de atualiza<7A><61>o seguro e tentou atualizar uma tabela sem um WHERE que use uma coluna de KEY",
"Chave '%-.64s' n<>o existe na tabela '%-.64s'", "Chave '%-.64s' n<>o existe na tabela '%-.64s'",
"N<>o pode abrir a tabela", "N<>o pode abrir a tabela",
"O manipulador de tabela n<>o suporta check/repair", "O manipulador de tabela n<>o suporta check/repair",
@ -188,7 +188,7 @@
"Conex<65>o %ld abortada ao banco de dados '%-.64s' - usu<73>rio '%-.32s' - 'host' `%-.64s' ('%-.64s')", "Conex<65>o %ld abortada ao banco de dados '%-.64s' - usu<73>rio '%-.32s' - 'host' `%-.64s' ('%-.64s')",
"O manipulador de tabela n<>o suporta DUMP bin<69>rio de tabela", "O manipulador de tabela n<>o suporta DUMP bin<69>rio de tabela",
"Binlog fechado. N<>o pode fazer RESET MASTER", "Binlog fechado. N<>o pode fazer RESET MASTER",
"Falhou na reconstru<72><75>o do <20>ndice da tabela 'dumped' '%-.64s'", "Falhou na reconstru<72><75>o do <20>ndice da tabela '%-.64s' 'dumped'",
"Erro no 'master' '%-.64s'", "Erro no 'master' '%-.64s'",
"Erro de rede na leitura do 'master'", "Erro de rede na leitura do 'master'",
"Erro de rede na grava<76><61>o do 'master'", "Erro de rede na grava<76><61>o do 'master'",
@ -207,9 +207,9 @@
"Usu<73>rio '%-.64s' j<> possui 'max_user_connections' conex<65>es ativas", "Usu<73>rio '%-.64s' j<> possui 'max_user_connections' conex<65>es ativas",
"Voc<6F> pode usar apenas express<73>es de constante com SET", "Voc<6F> pode usar apenas express<73>es de constante com SET",
"Excedido tempo de espera (timeout) do travamento", "Excedido tempo de espera (timeout) do travamento",
"O n<>mero total de travamentos excede o tamanho de travamento da tabela", "O n<>mero total de travamentos excede o tamanho da tabela de travamentos",
"Travamentos de atualiza<7A><61>o n<>o podem ser obtidos durante um READ UNCOMMITTED na transa<73><61>o", "Travamentos de atualiza<7A><61>o n<>o podem ser obtidos durante uma transa<73><61>o de READ UNCOMMITTED",
"DROP DATABASE n<>o permitido enquanto uma 'thread' est<73> assegurando um travamento global de leitura", "DROP DATABASE n<>o permitido enquanto uma 'thread' est<73> mantendo um travamento global de leitura",
"CREATE DATABASE n<>o permitido enquanto uma 'thread' est<73> assegurando um travamento global de leitura", "CREATE DATABASE n<>o permitido enquanto uma 'thread' est<73> mantendo um travamento global de leitura",
"Wrong arguments to %s", "Argumentos errados para %s",
"%-.32s@%-.64s is not allowed to create new users", "N<EFBFBD>o <20> permitido a %-.32s@%-.64s criar novos usu<73>rios",

View File

@ -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),
#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()
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);

View File

@ -283,7 +283,7 @@ public:
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 @@ public:
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 @@ public:
{ {
#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;

View File

@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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
{ {

View File

@ -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";

View File

@ -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:
| 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 {}

View File

@ -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