summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.fi>2001-03-25 01:02:26 +0200
committerunknown <monty@donna.mysql.fi>2001-03-25 01:02:26 +0200
commit4a3f651d6dcd050b5a213ed141fc5c70ce5500e8 (patch)
tree6191242036b4e9061dfd34fc46bf82677415e532 /sql
parenta032242b883ab2697ea3a69b2b3650247dfea1b2 (diff)
downloadmariadb-git-4a3f651d6dcd050b5a213ed141fc5c70ce5500e8.tar.gz
Fixed bug in send in mysqltest
Removed usage of @r/result as this made life hard when testing different table handlers. Allow concurrent inserts if no update/binary log. Don't remove key_cache at flush tables. Fixed bug in SELECT DISTINCT SUM()... BitKeeper/deleted/.del-rpl000012.status.result~bbbd650b5beea32f: Delete: mysql-test/r/rpl000012.status.result BitKeeper/deleted/.del-rpl000013.status.result~6bee190c298cc9fd: Delete: mysql-test/r/rpl000013.status.result Docs/manual.texi: Changelog client/mysqltest.c: Fixed bug in 'send' that Sasha had introduced. Make database, port and socket optional parameters to connect() mysql-test/r/rpl000005.result: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/r/rpl000006.result: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/r/rpl000012.result: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/r/rpl000013.result: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/r/sel000033.result: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/backup.test: Use default port and socket. mysql-test/t/dirty-close.test: Use default port and socket. mysql-test/t/flush.test: Use default port and socket. mysql-test/t/kill.test: Use default port and socket. mysql-test/t/overflow.test: Use default port and socket. mysql-test/t/rpl000003.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/rpl000005.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/rpl000006.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/rpl000007.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/rpl000008.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/rpl000009.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/rpl000010.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/rpl000011.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/rpl000012.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/rpl000013.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/sel000001.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/sel000002.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/sel000003.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/sel000031.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/sel000032.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/sel000033.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/sel000100.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/shw000001.test: Removed usage of @r/result as this made life hard when doing test for multiple table handlers. mysql-test/t/status.test: Use default port and socket. sql/gen_lex_hash.cc: Smaller hash table sql/mysql_priv.h: Allow concurrent inserts if no update/binary log sql/mysqld.cc: Allow concurrent inserts if no update/binary log Don't remove key_cache at flush tables sql/sql_base.cc: Don't remove key_cache at flush tables sql/sql_select.cc: Fix bug in SELECT DISTINCT SUM(). sql/sql_yacc.yy: Allow concurrent inserts if no update/binary log tests/export.pl: C
Diffstat (limited to 'sql')
-rw-r--r--sql/gen_lex_hash.cc4
-rw-r--r--sql/mysql_priv.h2
-rw-r--r--sql/mysqld.cc10
-rw-r--r--sql/sql_base.cc8
-rw-r--r--sql/sql_select.cc2
-rw-r--r--sql/sql_yacc.yy6
6 files changed, 14 insertions, 18 deletions
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc
index 13284a8f723..e847da182a0 100644
--- a/sql/gen_lex_hash.cc
+++ b/sql/gen_lex_hash.cc
@@ -472,8 +472,8 @@ int main(int argc,char **argv)
int error;
MY_INIT(argv[0]);
- start_value=318439L; best_t1=7136932L; best_t2=1067561L; best_type=0; /* mode=5413 add=5 type: 0 */
- if (get_options(argc,(char **) argv))
+ start_value=6871391L; best_t1=1779313L; best_t2=5719807L; best_type=3; /* mode=4987 add=5 type: 0 */
+ if (get_options(argc,(char **) argv))
exit(1);
make_max_length_table();
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 32619d40e16..9af7012f0bc 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -532,7 +532,7 @@ extern ulong keybuff_size,sortbuff_size,max_item_sort_length,table_cache_size,
lower_case_table_names,thread_stack,thread_stack_min,
binlog_cache_size, max_binlog_cache_size;
extern ulong specialflag, current_pid;
-extern bool low_priority_updates;
+extern bool low_priority_updates, using_update_log;
extern bool opt_sql_bin_update, opt_safe_show_db;
extern char language[LIBLEN],reg_ext[FN_EXTLEN],blob_newline;
extern const char **errmesg; /* Error messages */
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index b91ab40389e..f45614bd0a1 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -253,7 +253,7 @@ ulong max_tmp_tables,max_heap_table_size;
ulong bytes_sent = 0L, bytes_received = 0L;
bool opt_endinfo,using_udf_functions,low_priority_updates, locked_in_memory;
-bool opt_using_transactions;
+bool opt_using_transactions, using_update_log;
bool volatile abort_loop,select_thread_in_use,grant_option;
bool volatile ready_to_exit,shutdown_in_progress;
ulong refresh_version=1L,flush_version=1L; /* Increments on each reload */
@@ -649,7 +649,7 @@ void clean_up(void)
if (!opt_noacl)
udf_free();
#endif
- end_key_cache(); /* This is usually freed automaticly */
+ end_key_cache();
(void) ha_panic(HA_PANIC_CLOSE); /* close all tables and logs */
#ifdef USE_RAID
end_raid();
@@ -1683,8 +1683,11 @@ int main(int argc, char **argv)
if (opt_log)
open_log(&mysql_log, glob_hostname, opt_logname, ".log", LOG_NORMAL);
if (opt_update_log)
+ {
open_log(&mysql_update_log, glob_hostname, opt_update_logname, "",
LOG_NEW);
+ using_update_log=1;
+ }
if (opt_bin_log && !server_id)
{
@@ -1720,6 +1723,7 @@ The server will not act as a slave.");
mysql_bin_log.set_index_file_name(opt_binlog_index_name);
open_log(&mysql_bin_log, glob_hostname, opt_bin_logname, "-bin",
LOG_BIN);
+ using_update_log=1;
}
if (opt_slow_log)
@@ -1730,10 +1734,10 @@ The server will not act as a slave.");
sql_print_error("Can't init databases");
exit(1);
}
+ ha_key_cache();
#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT)
if (locked_in_memory && !geteuid())
{
- ha_key_cache();
if (mlockall(MCL_CURRENT))
{
sql_print_error("Warning: Failed to lock memory. Errno: %d\n",errno);
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 85148de0cfa..0024e80219b 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -335,10 +335,6 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh,
VOID(hash_delete(&open_cache,(byte*) unused_tables));
#endif
}
- if (!open_cache.records && ! locked_in_memory)
- {
- end_key_cache(); /* No tables in memory */
- }
refresh_version++; // Force close of open tables
}
else
@@ -703,8 +699,6 @@ TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
table->key_length=key_length;
table->version=0;
table->flush_version=0;
- if (!key_cache_inited)
- ha_key_cache();
table->in_use = thd;
check_unused();
pthread_mutex_unlock(&LOCK_open);
@@ -857,8 +851,6 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name,
table->key_length=key_length;
table->version=refresh_version;
table->flush_version=flush_version;
- if (!key_cache_inited)
- ha_key_cache();
DBUG_PRINT("info", ("inserting table %p into the cache", table));
VOID(hash_insert(&open_cache,(byte*) table));
}
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 720226033e6..db95214cfa3 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -3635,7 +3635,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
in the first 'hidden_null_pack_length' bytes of the row.
*/
null_pack_length-=hidden_null_pack_length;
- keyinfo->key_parts= ((field_count-hidden_field_count)+
+ keyinfo->key_parts= ((field_count-param->hidden_field_count)+
test(null_pack_length));
if (allow_distinct_limit)
{
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 70468d8e1a5..1196d279e5c 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -540,7 +540,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
query:
END_OF_INPUT
- {
+ {
if (!current_thd->bootstrap)
send_error(&current_thd->net,ER_EMPTY_QUERY);
YYABORT;
@@ -699,7 +699,7 @@ create3:
/* empty */ {}
| opt_duplicate opt_as SELECT_SYM
{
- Lex->lock_option= TL_READ_NO_INSERT;
+ Lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
mysql_init_select(Lex);
}
select_options select_item_list opt_select_from {}
@@ -2072,7 +2072,7 @@ insert_values:
LEX *lex=Lex;
lex->sql_command = (lex->sql_command == SQLCOM_INSERT ?
SQLCOM_INSERT_SELECT : SQLCOM_REPLACE_SELECT);
- lex->lock_option= TL_READ_NO_INSERT;
+ lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
mysql_init_select(lex);
}
select_options select_item_list select_from select_lock_type {}