summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-03-31 03:32:38 +0300
committerunknown <monty@mysql.com>2004-03-31 03:32:38 +0300
commit93c70c07722d3e6edccd371e6c3a8b14d2f40750 (patch)
tree0404bd0f500145286f101ddeb518678df83896d7
parent2ac5a256fea5e620eccefab6636f0d29f89e56f0 (diff)
downloadmariadb-git-93c70c07722d3e6edccd371e6c3a8b14d2f40750.tar.gz
simple optimzation
Portability fixes client/mysqltest.c: Fixed that if error number 0 is included in --error, we will not generate an error message include/mysql.h: Portability fix mysql-test/mysql-test-run.sh: Portability fix mysql-test/r/heap_btree.result: Portability fix mysql-test/r/rpl_error_ignored_table.result: Portability fix mysql-test/t/heap_btree.test: Portability fix mysql-test/t/rpl_error_ignored_table.test: Portability fix sql/sql_base.cc: simple optimzation sql/sql_yacc.yy: simple optimzation
-rw-r--r--client/mysqltest.c8
-rw-r--r--include/mysql.h10
-rw-r--r--mysql-test/mysql-test-run.sh3
-rw-r--r--mysql-test/r/heap_btree.result2
-rw-r--r--mysql-test/r/rpl_error_ignored_table.result1
-rw-r--r--mysql-test/t/heap_btree.test1
-rw-r--r--mysql-test/t/rpl_error_ignored_table.test2
-rw-r--r--sql/sql_base.cc12
-rw-r--r--sql/sql_yacc.yy8
9 files changed, 27 insertions, 20 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 30da0a184eb..00165ab4f45 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -1833,6 +1833,7 @@ int read_line(char* buf, int size)
return feof(*cur_file);
}
+
static char read_query_buf[MAX_QUERY];
int read_query(struct st_query** q_ptr)
@@ -1840,7 +1841,7 @@ int read_query(struct st_query** q_ptr)
char *p = read_query_buf, * p1 ;
int expected_errno;
struct st_query* q;
- DBUG_ENTER("read_query_buf");
+ DBUG_ENTER("read_query");
if (parser.current_line < parser.read_lines)
{
@@ -1857,7 +1858,7 @@ int read_query(struct st_query** q_ptr)
memcpy((gptr) q->expected_errno, (gptr) global_expected_errno,
sizeof(global_expected_errno));
q->expected_errors= global_expected_errors;
- q->abort_on_error= global_expected_errno[0] == 0;
+ q->abort_on_error= global_expected_errors == 0;
bzero((gptr) global_expected_errno, sizeof(global_expected_errno));
global_expected_errors=0;
@@ -2308,7 +2309,8 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
goto end; /* Ok */
}
}
- DBUG_PRINT("info",("i: %d expected_errors: %d", i, q->expected_errors));
+ DBUG_PRINT("info",("i: %d expected_errors: %d", i,
+ q->expected_errors));
dynstr_append_mem(ds, "ERROR ",6);
replace_dynstr_append_mem(ds, mysql_sqlstate(mysql),
strlen(mysql_sqlstate(mysql)));
diff --git a/include/mysql.h b/include/mysql.h
index 43ca7fdba12..852d633facf 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -188,9 +188,9 @@ struct st_mysql_options {
/* function pointers for local infile support */
int (*local_infile_init)(void **, const char *);
- int (*local_infile_read)(void *, char *, uint);
+ int (*local_infile_read)(void *, char *, unsigned int);
void (*local_infile_end)(void *);
- int (*local_infile_error)(void *, char *, uint);
+ int (*local_infile_error)(void *, char *, unsigned int);
};
enum mysql_status
@@ -397,9 +397,11 @@ my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
void
mysql_set_local_infile_handler(MYSQL *mysql,
int (*local_infile_init)(void **, const char *),
- int (*local_infile_read)(void *, char *, uint),
+ int (*local_infile_read)(void *, char *,
+ unsigned int),
void (*local_infile_end)(void *),
- int (*local_infile_error)(void *, char*, uint));
+ int (*local_infile_error)(void *, char*,
+ unsigned int));
void
mysql_set_local_infile_default(MYSQL *mysql);
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index b4d5958fb50..d0ce62cdcee 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -22,6 +22,9 @@ case `uname` in
SCO_SV | UnixWare | OpenUNIX )
# do nothing (Causes strange behavior)
;;
+ QNX)
+ # do nothing (avoid error message)
+ ;;
* )
ulimit -n 1024
;;
diff --git a/mysql-test/r/heap_btree.result b/mysql-test/r/heap_btree.result
index f92a8653a69..5c60c97d674 100644
--- a/mysql-test/r/heap_btree.result
+++ b/mysql-test/r/heap_btree.result
@@ -178,7 +178,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range btn btn 10 NULL 1 Using where
explain select * from t1 where btn like "h%";
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range btn btn 10 NULL 4 Using where
+1 SIMPLE t1 range btn btn 10 NULL # Using where
explain select * from t1 where btn like "a%";
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range btn btn 10 NULL 1 Using where
diff --git a/mysql-test/r/rpl_error_ignored_table.result b/mysql-test/r/rpl_error_ignored_table.result
index dd277e41ad0..4a562dbfc70 100644
--- a/mysql-test/r/rpl_error_ignored_table.result
+++ b/mysql-test/r/rpl_error_ignored_table.result
@@ -26,7 +26,6 @@ select (@id := id) - id from t3;
0
kill @id;
drop table t2,t3;
-Got one of the listed errors
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.000001 79 Query 1 79 use `test`; create table t1 (a int primary key)
diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test
index ad78636d002..d156d059634 100644
--- a/mysql-test/t/heap_btree.test
+++ b/mysql-test/t/heap_btree.test
@@ -111,6 +111,7 @@ drop table t1;
create table t1 (btn char(10) not null, key using BTREE (btn)) engine=heap;
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
explain select * from t1 where btn like "i%";
+--replace_column 9 #
explain select * from t1 where btn like "h%";
explain select * from t1 where btn like "a%";
explain select * from t1 where btn like "b%";
diff --git a/mysql-test/t/rpl_error_ignored_table.test b/mysql-test/t/rpl_error_ignored_table.test
index 40dbe455c7a..f2ddaa273ed 100644
--- a/mysql-test/t/rpl_error_ignored_table.test
+++ b/mysql-test/t/rpl_error_ignored_table.test
@@ -45,7 +45,7 @@ select (@id := id) - id from t3;
kill @id;
drop table t2,t3;
connection master;
---error 1053,0;
+--error 0,1053;
reap;
connection master1;
show binlog events from 79;
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index c5cd124bf43..60c2938ba4e 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2293,14 +2293,14 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name,
DBUG_RETURN(-1);
#endif
Field **ptr=table->field,*field;
- TABLE *natural_join_table;
+ TABLE *natural_join_table= 0;
+
thd->used_tables|=table->map;
- if (table->outer_join ||
- !tables->natural_join ||
- tables->natural_join->table->outer_join)
- natural_join_table= NULL;
- else
+ if (!table->outer_join &&
+ tables->natural_join &&
+ !tables->natural_join->table->outer_join)
natural_join_table= tables->natural_join->table;
+
while ((field = *ptr++))
{
/* Skip duplicate field names if NATURAL JOIN is used */
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 58d22091e28..845f0d42f26 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1798,10 +1798,10 @@ alter_list_item:
YYABORT;
}
LEX *lex= Lex;
- lex->create_info.table_charset= $5;
- lex->create_info.used_fields|= HA_CREATE_USED_CHARSET;
- lex->create_info.default_table_charset= $5;
- lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
+ lex->create_info.table_charset=
+ lex->create_info.default_table_charset= $5;
+ lex->create_info.used_fields|= (HA_CREATE_USED_CHARSET |
+ HA_CREATE_USED_DEFAULT_CHARSET);
lex->simple_alter= 0;
}
| create_table_options_space_separated { Lex->simple_alter=0; }