summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2000-10-11 00:48:03 +0300
committerunknown <monty@narttu.mysql.fi>2000-10-11 00:48:03 +0300
commit3c7bb7902a0b5f789db7329e51801c8495f38f09 (patch)
treec6677bb9b8f4eee0143a25aa5b5b345004edc2ff /sql
parentf3078422da127c27b82a3726f5ded7d7fa5034d5 (diff)
downloadmariadb-git-3c7bb7902a0b5f789db7329e51801c8495f38f09.tar.gz
Portability fixes
Docs/manual.texi: Update for Access 2000 extra/perror.c: Added --silent include/my_pthread.h: Patch for windows scripts/safe_mysqld.sh: Fix of bug in --patch sql/sql_lex.cc: Allow numbers of type 1e1 sql/sql_string.h: Safety fix sql/sql_table.cc: Portability fix BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_lex.cc8
-rw-r--r--sql/sql_string.h16
-rw-r--r--sql/sql_table.cc4
3 files changed, 16 insertions, 12 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 50c9ab852c1..ca36cb9f205 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -526,7 +526,8 @@ int yylex(void *arg)
}
if (c == 'e' || c == 'E')
{
- if ((c=(yyGet())) == '+' || c == '-')
+ // The following test is written this way to allow numbers of type 1e1
+ if (isdigit(yyPeek()) || (c=(yyGet())) == '+' || c == '-')
{ // Allow 1E+10
if (isdigit(yyPeek())) // Number must have digit after sign
{
@@ -628,7 +629,8 @@ int yylex(void *arg)
yyUnget(); // Fix for next loop
}
while (isdigit(c=yyGet())) ; // Incomplete real or int number
- if ((c == 'e' || c == 'E') && (yyPeek() == '+' || yyPeek() == '-'))
+ if ((c == 'e' || c == 'E') &&
+ (yyPeek() == '+' || yyPeek() == '-' || isdigit(yyPeek())))
{ // Real number
yyUnget();
c= '.'; // Fool next test
@@ -647,7 +649,7 @@ int yylex(void *arg)
if (c == 'e' || c == 'E')
{
c = yyGet();
- if (c != '-' && c != '+')
+ if (c != '-' && c != '+' && !isdigit(c))
{ // No exp sig found
state= STATE_CHAR;
break;
diff --git a/sql/sql_string.h b/sql/sql_string.h
index 8711cf314ad..45c82b82dd0 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -100,16 +100,16 @@ public:
bool set(ulonglong num);
bool set(double num,uint decimals=2);
inline void free()
+ {
+ if (alloced)
{
- if (alloced)
- {
- alloced=0;
- Alloced_length=0;
- my_free(Ptr,MYF(0));
- Ptr=0;
- }
+ alloced=0;
+ Alloced_length=0;
+ my_free(Ptr,MYF(0));
+ Ptr=0;
+ str_length=0; /* Safety */
}
-
+ }
inline bool alloc(uint32 arg_length)
{
if (arg_length < Alloced_length)
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 3cb40d7d9ed..2d52aa5ff5a 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -867,10 +867,12 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
}
if ((table->table->db_stat & HA_READ_ONLY) && open_for_modify)
{
+ char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE];
net_store_data(packet, table_name);
net_store_data(packet, operator_name);
net_store_data(packet, "error");
- net_store_data(packet, ER(ER_OPEN_AS_READONLY));
+ sprintf(buff, ER(ER_OPEN_AS_READONLY), table_name);
+ net_store_data(packet, buff);
close_thread_tables(thd);
if (my_net_write(&thd->net, (char*) thd->packet.ptr(),
packet->length()))