summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-08-16 05:14:02 +0300
committerunknown <monty@donna.mysql.com>2000-08-16 05:14:02 +0300
commite318f3a607f609c28636a9ac29cd67662166f01a (patch)
tree6c04aea21b1a42222c20034b365c343788f2335c
parent6388f02bbf7ec0bee2e3bfcce0df23146c56f092 (diff)
downloadmariadb-git-e318f3a607f609c28636a9ac29cd67662166f01a.tar.gz
Delayed keys + portability fixes
client/Makefile.am: Fix for make/bitkeeper configure.in: Fix for SCO and SHOW PROCESSLIST include/Makefile.am: Fix for make/bitkeeper libmysql/Makefile.am: Fix for make/bitkeeper myisam/mi_check.c: Fixes for delayed key handling sql-bench/Makefile.am: Fix for make/bitkeeper sql/Makefile.am: Fix for make/bitkeeper sql/sql_insert.cc: Added delay key creation to INSERT .. SELECT
-rw-r--r--client/Makefile.am3
-rw-r--r--configure.in1
-rw-r--r--include/Makefile.am3
-rw-r--r--libmysql/Makefile.am3
-rw-r--r--myisam/mi_check.c22
-rw-r--r--sql-bench/Makefile.am3
-rw-r--r--sql/Makefile.am3
-rw-r--r--sql/sql_insert.cc16
8 files changed, 40 insertions, 14 deletions
diff --git a/client/Makefile.am b/client/Makefile.am
index e715a2c15d0..6bb93e90443 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -41,3 +41,6 @@ DEFS = -DUNDEF_THREADS_HACK
thread_test.o: thread_test.c
$(COMPILE) -c @MT_INCLUDES@ $(INCLUDES) $<
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/configure.in b/configure.in
index 5550bcbe26e..bf661b56f35 100644
--- a/configure.in
+++ b/configure.in
@@ -211,6 +211,7 @@ AC_MSG_RESULT($mysql_cv_sys_os)
case "$target_os" in
sco3.2v5*)
CFLAGS="$CFLAGS -DSCO"
+ CXXFLAGS="$CXXFLAGS -DSCO"
LD='$(CC) $(CFLAGS)'
case "$CFLAGS" in
*-belf*)
diff --git a/include/Makefile.am b/include/Makefile.am
index 8ba6ea9d41e..5ee60521ca0 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -51,3 +51,6 @@ my_global.h: global.h
# generated by configure from the .h.in files
dist-hook:
rm -f $(distdir)/mysql_version.h $(distdir)/my_config.h
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am
index 78c52be3d31..2e04b33a72a 100644
--- a/libmysql/Makefile.am
+++ b/libmysql/Makefile.am
@@ -147,3 +147,6 @@ do-lib-dist:
echo ' $$(AR) r $$@ $$?' >>$$dir/Makefile; \
gtar cvzf $$dir.tar.gz $$dir; \
cd $$dir; gmake
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index f8667afb46a..82524334886 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -1600,7 +1600,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
char llbuff[22];
SORT_INFO *sort_info= &param->sort_info;
ulonglong key_map=share->state.key_map;
- DBUG_ENTER("rep_by_sort");
+ DBUG_ENTER("mi_repair_by_sort");
start_records=info->state->records;
got_error=1;
@@ -1630,9 +1630,6 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
info->opt_flag|=WRITE_CACHE_USED;
info->rec_cache.file=info->dfile; /* for sort_delete_record */
- /* Flush key cache for this file if we are calling this outside myisamchk */
- flush_key_blocks(share->kfile, FLUSH_IGNORE_CHANGED);
-
if (!(sort_info->record=(byte*) my_malloc((uint) share->base.pack_reclength,
MYF(0))))
{
@@ -1669,15 +1666,24 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
if (!(param->testflag & T_CREATE_MISSING_KEYS))
{
+ /*
+ Flush key cache for this file if we are calling this outside
+ myisamchk
+ */
+ flush_key_blocks(share->kfile, FLUSH_IGNORE_CHANGED);
+ /* Clear the pointers to the given rows */
for (i=0 ; i < share->base.keys ; i++)
share->state.key_root[i]= HA_OFFSET_ERROR;
for (i=0 ; i < share->state.header.max_block_size ; i++)
share->state.key_del[i]= HA_OFFSET_ERROR;
+ info->state->key_file_length=share->base.keystart;
}
else
+ {
+ if (flush_key_blocks(share->kfile, FLUSH_FORCE_WRITE))
+ goto err;
key_map= ~key_map; /* Create the missing keys */
-
- info->state->key_file_length=share->base.keystart;
+ }
sort_info->info=info;
sort_info->param = param;
@@ -1758,6 +1764,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
if (param->testflag & T_STATISTICS)
update_key_parts(sort_info->keyinfo, rec_per_key_part, sort_info->unique,
(ulonglong) info->state->records);
+ share->state.key_map|=(ulonglong) 1 << sort_info->key;
if (sort_info->fix_datafile)
{
@@ -2933,7 +2940,8 @@ void mi_dectivate_non_unique_index(MI_INFO *info, ha_rows rows)
MI_KEYDEF *key=share->keyinfo;
for (i=0 ; i < share->base.keys ; i++,key++)
{
- if (!(key->flag & HA_NOSAME) && ! mi_too_big_key_for_sort(key,rows))
+ if (!(key->flag & HA_NOSAME) && ! mi_too_big_key_for_sort(key,rows) &&
+ info->s->base.auto_key != i+1)
{
share->state.key_map&= ~ ((ulonglong) 1 << i);
info->update|= HA_STATE_CHANGED;
diff --git a/sql-bench/Makefile.am b/sql-bench/Makefile.am
index 0f01de71074..4af97e86e4f 100644
--- a/sql-bench/Makefile.am
+++ b/sql-bench/Makefile.am
@@ -77,3 +77,6 @@ SUFFIXES = .sh
$< > $@-t
@CHMOD@ +x $@-t
@MV@ $@-t $@
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/sql/Makefile.am b/sql/Makefile.am
index a4aee97d0bb..df9236c7e5a 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -124,3 +124,6 @@ sql_lex.o: lex_hash.h
#distclean:
# rm -f lex_hash.h
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index a7a6a6c24c7..fe8264814a6 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1154,7 +1154,6 @@ bool delayed_insert::handle_inserts(void)
int
select_insert::prepare(List<Item> &values)
{
- TABLE *form=table;
DBUG_ENTER("select_insert::prepare");
save_time_stamp=table->time_stamp;
@@ -1163,15 +1162,16 @@ select_insert::prepare(List<Item> &values)
if (fields->elements)
{
- restore_record(form,2); // Get empty record
+ restore_record(table,2); // Get empty record
}
else
- form->record[0][0]=form->record[2][0]; // Fix delete marker
- form->next_number_field=form->found_next_number_field;
+ table->record[0][0]=table->record[2][0]; // Fix delete marker
+ table->next_number_field=table->found_next_number_field;
thd->count_cuted_fields=1; /* calc cuted fields */
thd->cuted_fields=0;
if (info.handle_duplicates != DUP_REPLACE)
- form->file->extra(HA_EXTRA_WRITE_CACHE);
+ table->file->extra(HA_EXTRA_WRITE_CACHE);
+ table->file->deactivate_non_unique_index((ha_rows) 0);
DBUG_RETURN(0);
}
@@ -1213,14 +1213,16 @@ bool select_insert::send_data(List<Item> &values)
void select_insert::send_error(uint errcode,const char *err)
{
::send_error(&thd->net,errcode,err);
- VOID(table->file->extra(HA_EXTRA_NO_CACHE));
+ table->file->extra(HA_EXTRA_NO_CACHE);
+ table->file->activate_all_index(thd);
}
bool select_insert::send_eof()
{
int error;
- if ((error=table->file->extra(HA_EXTRA_NO_CACHE)))
+ if ((error=table->file->extra(HA_EXTRA_NO_CACHE)) ||
+ (error=table->file->activate_all_index(thd)))
{
table->file->print_error(error,MYF(0));
::send_error(&thd->net);