summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-11-24 02:36:28 +0200
committerunknown <monty@mysql.com>2005-11-24 02:36:28 +0200
commit97bfd41fe1382ff33a9fc458c0bd092342b217e5 (patch)
treefc3928c9ced01afa8474a263e5d847940b4cff4a /sql
parentf4431619110ffa018559930aac6454df9148ae61 (diff)
downloadmariadb-git-97bfd41fe1382ff33a9fc458c0bd092342b217e5.tar.gz
Don't use PATH_MAX for FN_REFLEN as this uses too much stack space
Larger stack size neaded for open table on x86 64 bit Fix failing test cases Deleted symlink from bk BitKeeper/etc/ignore: added libmysqld/ha_blackhole.cc BitKeeper/deleted/.del-ha_blackhole.cc~727c69ef7846623a: Delete: libmysqld/ha_blackhole.cc include/my_global.h: Don't use PATH_MAX for FN_REFLEN as this uses too much stack space. (With a PATH_MAX of 4096, we use 80K for opening a table as there is several objects of size FN_REFLEN on stack) mysql-test/r/federated.result: Update results after error message changes mysql-test/r/grant.result: Update results after error message changes mysql-test/r/grant2.result: Update results after error message changes sql/ha_federated.cc: Fix error messages to be more consistent sql/mysql_priv.h: Stack size to have when opening a table (This was needed on x86 64 bit Linux) sql/share/errmsg.txt: Remove quotes around error string for federated as two quotes in the output looks strange sql/sql_base.cc: More correct stack size sql/sql_parse.cc: Set thread_stack before store_globals() sql/unireg.h: More correct MAX_DBKEY_LENGTH
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_federated.cc25
-rw-r--r--sql/mysql_priv.h1
-rw-r--r--sql/share/errmsg.txt16
-rw-r--r--sql/sql_base.cc2
-rw-r--r--sql/sql_parse.cc1
-rw-r--r--sql/unireg.h4
6 files changed, 26 insertions, 23 deletions
diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc
index 3ab246df012..d2f827989f5 100644
--- a/sql/ha_federated.cc
+++ b/sql/ha_federated.cc
@@ -469,8 +469,7 @@ bool federated_db_end()
table, and if so, does the foreign table exist.
*/
-static int check_foreign_data_source(
- FEDERATED_SHARE *share,
+static int check_foreign_data_source(FEDERATED_SHARE *share,
bool table_create_flag)
{
char escaped_table_name[NAME_LEN*2];
@@ -496,15 +495,17 @@ static int check_foreign_data_source(
share->port,
share->socket, 0))
{
- /*
- we want the correct error message, but it to return
- ER_CANT_CREATE_FEDERATED_TABLE if called by ::create
- */
- error_code= table_create_flag?
- ER_CANT_CREATE_FEDERATED_TABLE : ER_CONNECT_TO_FOREIGN_DATA_SOURCE;
+ /*
+ we want the correct error message, but it to return
+ ER_CANT_CREATE_FEDERATED_TABLE if called by ::create
+ */
+ error_code= (table_create_flag ?
+ ER_CANT_CREATE_FEDERATED_TABLE :
+ ER_CONNECT_TO_FOREIGN_DATA_SOURCE);
my_sprintf(error_buffer,
- (error_buffer, " database %s username %s hostname %s",
+ (error_buffer,
+ "database: '%s' username: '%s' hostname: '%s'",
share->database, share->username, share->hostname));
my_error(ER_CONNECT_TO_FOREIGN_DATA_SOURCE, MYF(0), error_buffer);
@@ -545,8 +546,8 @@ static int check_foreign_data_source(
{
error_code= table_create_flag ?
ER_CANT_CREATE_FEDERATED_TABLE : ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST;
- my_sprintf(error_buffer, (error_buffer, ": %d : %s",
- mysql_errno(mysql), mysql_error(mysql)));
+ my_sprintf(error_buffer, (error_buffer, "error: %d '%s'",
+ mysql_errno(mysql), mysql_error(mysql)));
my_error(error_code, MYF(0), error_buffer);
goto error;
@@ -2035,7 +2036,7 @@ int ha_federated::index_read_idx(byte *buf, uint index, const byte *key,
}
if (mysql_real_query(mysql, sql_query.ptr(), sql_query.length()))
{
- my_sprintf(error_buffer, (error_buffer, ": %d : %s",
+ my_sprintf(error_buffer, (error_buffer, "error: %d '%s'",
mysql_errno(mysql), mysql_error(mysql)));
retval= ER_QUERY_ON_FOREIGN_DATA_SOURCE;
goto error;
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 2a65b99585a..4f5a0032531 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -101,6 +101,7 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
#define MAX_FIELDS_BEFORE_HASH 32
#define USER_VARS_HASH_SIZE 16
#define STACK_MIN_SIZE 8192 // Abort if less stack during eval.
+#define STACK_MIN_SIZE_FOR_OPEN 1024*80
#define STACK_BUFF_ALLOC 256 // For stack overrun checks
#ifndef MYSQLD_NET_RETRY_COUNT
#define MYSQLD_NET_RETRY_COUNT 10 // Abort read after this many int.
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index 4a5e6297a89..f67ad3a9fd2 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -5520,14 +5520,14 @@ ER_WRONG_LOCK_OF_SYSTEM_TABLE
eng "You can't combine write-locking of system '%-.64s.%-.64s' table with other tables"
ger "Sie können Schreibsperren auf der Systemtabelle '%-.64s.%-.64s' nicht mit anderen Tabellen kombinieren"
ER_CONNECT_TO_FOREIGN_DATA_SOURCE
- eng "Unable to connect to foreign data source - database '%.64s'!"
- ger "Kann nicht mit Fremddatenquelle verbinden - Datenquelle '%.64s'"
+ eng "Unable to connect to foreign data source: %.64s"
+ ger "Kann nicht mit Fremddatenquelle verbinden: %.64s"
ER_QUERY_ON_FOREIGN_DATA_SOURCE
- eng "There was a problem processing the query on the foreign data source. Data source error: '%-.64s'"
- ger "Bei der Verarbeitung der Abfrage ist in der Fremddatenquelle ein Problem aufgetreten. Datenquellenfehlermeldung: '%-.64s'"
+ eng "There was a problem processing the query on the foreign data source. Data source error: %-.64"
+ ger "Bei der Verarbeitung der Abfrage ist in der Fremddatenquelle ein Problem aufgetreten. Datenquellenfehlermeldung: %-.64s"
ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST
- eng "The foreign data source you are trying to reference does not exist. Data source error: '%-.64s'"
- ger "Die Fremddatenquelle, auf die Sie zugreifen wollen, existiert nicht. Datenquellenfehlermeldung: '%-.64s'"
+ eng "The foreign data source you are trying to reference does not exist. Data source error: %-.64s"
+ ger "Die Fremddatenquelle, auf die Sie zugreifen wollen, existiert nicht. Datenquellenfehlermeldung: %-.64s"
ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE
eng "Can't create federated table. The data source connection string '%-.64s' is not in the correct format"
ger "Kann föderierte Tabelle nicht erzeugen. Der Datenquellen-Verbindungsstring '%-.64s' hat kein korrektes Format"
@@ -5535,8 +5535,8 @@ ER_FOREIGN_DATA_STRING_INVALID
eng "The data source connection string '%-.64s' is not in the correct format"
ger "Der Datenquellen-Verbindungsstring '%-.64s' hat kein korrektes Format"
ER_CANT_CREATE_FEDERATED_TABLE
- eng "Can't create federated table. Foreign data src error: '%-.64s'"
- ger "Kann föderierte Tabelle nicht erzeugen. Fremddatenquellenfehlermeldung: '%-.64s'"
+ eng "Can't create federated table. Foreign data src error: %-.64s"
+ ger "Kann föderierte Tabelle nicht erzeugen. Fremddatenquellenfehlermeldung: %-.64s"
ER_TRG_IN_WRONG_SCHEMA
eng "Trigger in wrong schema"
ger "Trigger im falschen Schema"
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index b765f2f53e2..39e15675e47 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1090,7 +1090,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
*refresh=0;
/* an open table operation needs a lot of the stack space */
- if (check_stack_overrun(thd, 8 * STACK_MIN_SIZE, (char *)&alias))
+ if (check_stack_overrun(thd, STACK_MIN_SIZE_FOR_OPEN, (char *)&alias))
return 0;
if (thd->killed)
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 86f884c101a..00124225719 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1201,6 +1201,7 @@ pthread_handler_t handle_bootstrap(void *arg)
char *buff;
/* The following must be called before DBUG_ENTER */
+ thd->thread_stack= (char*) &thd;
if (my_thread_init() || thd->store_globals())
{
#ifndef EMBEDDED_LIBRARY
diff --git a/sql/unireg.h b/sql/unireg.h
index 6afefa579e8..8f21dd1d2db 100644
--- a/sql/unireg.h
+++ b/sql/unireg.h
@@ -43,8 +43,8 @@
#define ERRMAPP 1 /* Errormap f|r my_error */
#define LIBLEN FN_REFLEN-FN_LEN /* Max l{ngd p} dev */
-#define MAX_DBKEY_LENGTH (FN_LEN*2+1+1+4+4) /* extra 4+4 bytes for slave tmp
- * tables */
+/* extra 4+4 bytes for slave tmp tables */
+#define MAX_DBKEY_LENGTH (NAME_LEN*2+1+1+4+4)
#define MAX_ALIAS_NAME 256
#define MAX_FIELD_NAME 34 /* Max colum name length +2 */
#define MAX_SYS_VAR_LENGTH 32