summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-12-12 04:34:56 +0200
committerunknown <monty@donna.mysql.com>2000-12-12 04:34:56 +0200
commit28ad76e22c799a933006e8cad31a7389e85106eb (patch)
tree3c78736b50f99b9b8ac968afb833752f201a482a /sql
parent7847639270269bc6aebeed36e68ddfec0cf6c145 (diff)
downloadmariadb-git-28ad76e22c799a933006e8cad31a7389e85106eb.tar.gz
Fixed delete in tables with hidden primary key
Remove not used BDB logs on shutdown Don't give warnings for repair on slaves Fixed transaction log files Docs/manual.texi: Updated 'known bugs' include/my_sys.h: Added define for checking number of bytes left in the IO_CACHE mysql-test/mysql-test-run: Small bug fixes mysys/mf_iocache2.c: Use new define sql/filesort.cc: Temporary fix for FULLTEXT index sql/ha_berkeley.cc: Fix for delete in tables with hidden primary key Remove not used BDB logs on shutdown sql/ha_myisam.cc: Don't give warnings for repair on slaves sql/hostname.cc: Portability fix sql/log.cc: Fix transaction log files sql/log_event.h: portability fix sql/slave.cc: Don't give warnings for repair on slaves sql/sql_class.h: Cleanup sql/sql_parse.cc: Fixed typo
Diffstat (limited to 'sql')
-rw-r--r--sql/filesort.cc6
-rw-r--r--sql/ha_berkeley.cc3
-rw-r--r--sql/ha_myisam.cc2
-rw-r--r--sql/hostname.cc3
-rw-r--r--sql/log.cc10
-rw-r--r--sql/log_event.h2
-rw-r--r--sql/slave.cc2
-rw-r--r--sql/sql_class.h2
-rw-r--r--sql/sql_parse.cc2
9 files changed, 20 insertions, 12 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 09151a1327e..e0808a9e8b7 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -324,8 +324,12 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
file->rnd_init();
file->extra(HA_EXTRA_CACHE); /* Quicker reads */
}
+ else if (quick_select) // QQ For FULLTEXT
+ { // QQ Should be removed soon
+ file->index_end();
+ select->quick->init();
+ }
- if (!error)
for (;;)
{
if (quick_select)
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index ceaa0b0291a..0436b16fddc 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -161,6 +161,7 @@ bool berkeley_end(void)
DBUG_ENTER("berkeley_end");
if (!db_env)
return 1;
+ berkeley_cleanup_log_files();
error=db_env->close(db_env,0); // Error is logged
db_env=0;
hash_free(&bdb_open_tables);
@@ -987,7 +988,7 @@ int ha_berkeley::remove_key(DB_TXN *sub_trans, uint keynr, const byte *record,
DBUG_PRINT("enter",("index: %d",keynr));
if ((table->key_info[keynr].flags & (HA_NOSAME | HA_NULL_PART_KEY)) ==
- HA_NOSAME)
+ HA_NOSAME || keynr == primary_key)
{ // Unique key
dbug_assert(keynr == primary_key || prim_key->data != key_buff2);
error=key_file[keynr]->del(key_file[keynr], sub_trans,
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 860418a3fe4..c0f7b73a856 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -563,7 +563,7 @@ int ha_myisam::repair(THD *thd, MI_CHECK &param, bool optimize)
T_STATISTICS ? UPDATE_STAT : 0));
info(HA_STATUS_NO_LOCK | HA_STATUS_TIME | HA_STATUS_VARIABLE |
HA_STATUS_CONST);
- if (rows != file->state->records)
+ if (rows != file->state->records && ! (param.testflag & T_VERY_SILENT))
{
char llbuff[22],llbuff2[22];
mi_check_print_warning(&param,"Number of rows changed from %s to %s",
diff --git a/sql/hostname.cc b/sql/hostname.cc
index 1c52a5363d3..fcf8d2753b8 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -123,6 +123,7 @@ void reset_host_errors(struct in_addr *in)
my_string ip_to_hostname(struct in_addr *in, uint *errors)
{
+ uint i;
host_entry *entry;
DBUG_ENTER("ip_to_hostname");
@@ -222,7 +223,7 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors)
}
/* Check that 'gethostbyname' returned the used ip */
- for (uint i=0; check->h_addr_list[i]; i++)
+ for (i=0; check->h_addr_list[i]; i++)
{
if (*(uint32*)(check->h_addr_list)[i] == in->s_addr)
{
diff --git a/sql/log.cc b/sql/log.cc
index 49e0faf4a7a..41fb4bfb856 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -76,7 +76,7 @@ static int find_uniq_filename(char *name)
MYSQL_LOG::MYSQL_LOG(): last_time(0), query_start(0),index_file(-1),
name(0), log_type(LOG_CLOSED),write_error(0),
- inited(0), opened(0), no_rotate(0)
+ inited(0), no_rotate(0)
{
/*
We don't want to intialize LOCK_Log here as the thread system may
@@ -616,7 +616,7 @@ bool MYSQL_LOG::write(Query_log_event* event_info)
IO_CACHE *file = (event_info->cache_stmt ? &thd->transaction.trans_log :
&log_file);
if ((!(thd->options & OPTION_BIN_LOG) &&
- thd->master_access & PROCESS_ACL) ||
+ (thd->master_access & PROCESS_ACL)) ||
!db_ok(event_info->db, binlog_do_db, binlog_ignore_db))
{
VOID(pthread_mutex_unlock(&LOCK_log));
@@ -684,14 +684,14 @@ bool MYSQL_LOG::write(IO_CACHE *cache)
if (is_open())
{
uint length;
- my_off_t start_pos=my_b_tell(&log_file);
if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0))
{
sql_print_error(ER(ER_ERROR_ON_WRITE), cache->file_name, errno);
goto err;
}
- while ((length=my_b_fill(cache)))
+ length=my_b_bytes_in_cache(cache);
+ do
{
if (my_b_write(&log_file, cache->rc_pos, length))
{
@@ -700,7 +700,7 @@ bool MYSQL_LOG::write(IO_CACHE *cache)
goto err;
}
cache->rc_pos=cache->rc_end; // Mark buffer used up
- }
+ } while ((length=my_b_fill(cache)));
if (flush_io_cache(&log_file))
{
if (!write_error)
diff --git a/sql/log_event.h b/sql/log_event.h
index 9c97a1a121c..6dde2932014 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -72,7 +72,7 @@ public:
static void operator delete(void *ptr, size_t size)
{
- my_free((byte*)ptr, MYF(MY_WME|MY_ALLOW_ZERO_PTR));
+ my_free((gptr) ptr, MYF(MY_WME|MY_ALLOW_ZERO_PTR));
}
int write(IO_CACHE* file);
diff --git a/sql/slave.cc b/sql/slave.cc
index 2545745e7ea..86dc3e593af 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -17,6 +17,7 @@
#include "mysql_priv.h"
#include <mysql.h>
+#include <myisam.h>
#include "mini_client.h"
#include "slave.h"
#include <thr_alarm.h>
@@ -360,6 +361,7 @@ static int create_table_from_dump(THD* thd, NET* net, const char* db,
HA_CHECK_OPT check_opt;
check_opt.init();
+ check_opt.flags|= T_VERY_SILENT;
check_opt.quick = 1;
thd->proc_info = "rebuilding the index on master dump table";
Vio* save_vio = thd->net.vio;
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 4943e334aa0..b1b734165d0 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -60,7 +60,7 @@ class MYSQL_LOG {
volatile enum_log_type log_type;
char time_buff[20],db[NAME_LEN+1];
char log_file_name[FN_REFLEN],index_file_name[FN_REFLEN];
- bool write_error,inited,opened;
+ bool write_error,inited;
bool no_rotate; // for binlog - if log name can never change
// we should not try to rotate it or write any rotation events
// the user should use FLUSH MASTER instead of FLUSH LOGS for
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 88a9df7543a..d3177eae1ee 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1779,7 +1779,7 @@ mysql_execute_command(void)
}
else
{
- thd->options= ((thd->options & (ulong) (OPTION_STATUS_NO_TRANS_UPDATE)) |
+ thd->options= ((thd->options & (ulong) ~(OPTION_STATUS_NO_TRANS_UPDATE)) |
OPTION_BEGIN);
thd->server_status|= SERVER_STATUS_IN_TRANS;
send_ok(&thd->net);