summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@bitch.mysql.fi>2001-08-10 17:05:54 +0300
committerunknown <monty@bitch.mysql.fi>2001-08-10 17:05:54 +0300
commitbffebc8e0be4772e7988b6b23570bd1197c7214a (patch)
treed54f66790a3d6fbc6eb5c7145f39bba41960b0e1 /sql
parent9d5a520730a8136633f8aa81e5f3ede2a1412033 (diff)
downloadmariadb-git-bffebc8e0be4772e7988b6b23570bd1197c7214a.tar.gz
Fixed bug in ALTER TABLE for MERGE tables
Portability fixes Fixed problem when giving wrong arguments to myisam_recover Fix to remove warnings when using purify BUILD/compile-solaris-sparc-purify: Added innodb and berkeleydb to test mysql-test/install_test_db.sh: Portability fix. sql/ha_myisam.cc: Fixed problem when giving wrong arguments to myisam_recover sql/ha_myisammrg.cc: Fixed bug in ALTER TABLE for MERGE tables sql/sql_list.h: Fix to remove warnings when using purify sql/sql_select.cc: Fix to remove warnings from purify BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_myisam.cc2
-rw-r--r--sql/ha_myisammrg.cc2
-rw-r--r--sql/sql_list.h11
-rw-r--r--sql/sql_select.cc44
4 files changed, 37 insertions, 22 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 6409ec5d019..8be62920308 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -35,7 +35,7 @@ ulong myisam_recover_options= HA_RECOVER_NONE;
/* bits in myisam_recover_options */
const char *myisam_recover_names[] =
-{ "DEFAULT", "BACKUP", "FORCE", "QUICK"};
+{ "DEFAULT", "BACKUP", "FORCE", "QUICK", NullS};
TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names),"",
myisam_recover_names};
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
index b842c15cce0..866fd1e69f9 100644
--- a/sql/ha_myisammrg.cc
+++ b/sql/ha_myisammrg.cc
@@ -229,6 +229,7 @@ void ha_myisammrg::update_create_info(HA_CREATE_INFO *create_info)
MYRG_TABLE *table;
THD *thd=current_thd;
create_info->merge_list.next= &create_info->merge_list.first;
+ create_info->merge_list.elements=0;
for (table=file->open_tables ; table != file->end_table ; table++)
{
@@ -240,6 +241,7 @@ void ha_myisammrg::update_create_info(HA_CREATE_INFO *create_info)
fn_format(buff,name,"","",3);
if (!(ptr->real_name=thd->strdup(buff)))
goto err;
+ create_info->merge_list.elements++;
(*create_info->merge_list.next) = (byte*) ptr;
create_info->merge_list.next= (byte**) &ptr->next;
}
diff --git a/sql/sql_list.h b/sql/sql_list.h
index b86250f70b6..d21f2e658dc 100644
--- a/sql/sql_list.h
+++ b/sql/sql_list.h
@@ -27,8 +27,15 @@ class Sql_alloc
public:
static void *operator new(size_t size) {return (void*) sql_alloc((uint) size); }
static void operator delete(void *ptr, size_t size) {} /*lint -e715 */
- inline Sql_alloc() {};
- inline ~Sql_alloc() {};
+#ifdef HAVE_purify
+ bool dummy;
+ inline Sql_alloc() :dummy(0) {}
+ inline ~Sql_alloc() {}
+#else
+ inline Sql_alloc() {}
+ inline ~Sql_alloc() {}
+#endif
+
};
/*
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index d23a7edd37e..14640e8387e 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1368,24 +1368,27 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
if (cond->type() == Item::FUNC_ITEM)
{
- Item_func *func=(Item_func *)cond,
- *arg0=(Item_func *)(func->arguments()[0]),
- *arg1=(Item_func *)(func->arguments()[1]);
-
- if (func->functype() == Item_func::FT_FUNC)
+ Item_func *func=(Item_func *)cond;
+ Item_func::Functype functype= func->functype();
+ if (functype == Item_func::FT_FUNC)
cond_func=(Item_func_match *)cond;
- else if ((func->functype() == Item_func::GE_FUNC ||
- func->functype() == Item_func::GT_FUNC) &&
- arg0->type() == Item::FUNC_ITEM &&
- arg0->functype() == Item_func::FT_FUNC &&
- arg1->const_item() && arg1->val()>=0)
- cond_func=(Item_func_match *)arg0;
- else if ((func->functype() == Item_func::LE_FUNC ||
- func->functype() == Item_func::LT_FUNC) &&
- arg1->type() == Item::FUNC_ITEM &&
- arg1->functype() == Item_func::FT_FUNC &&
- arg0->const_item() && arg0->val()>=0)
- cond_func=(Item_func_match *)arg1;
+ else if (func->arg_count == 2)
+ {
+ Item_func *arg0=(Item_func *)(func->arguments()[0]),
+ *arg1=(Item_func *)(func->arguments()[1]);
+ if ((functype == Item_func::GE_FUNC ||
+ functype == Item_func::GT_FUNC) &&
+ arg0->type() == Item::FUNC_ITEM &&
+ arg0->functype() == Item_func::FT_FUNC &&
+ arg1->const_item() && arg1->val()>=0)
+ cond_func=(Item_func_match *) arg0;
+ else if ((functype == Item_func::LE_FUNC ||
+ functype == Item_func::LT_FUNC) &&
+ arg1->type() == Item::FUNC_ITEM &&
+ arg1->functype() == Item_func::FT_FUNC &&
+ arg0->const_item() && arg0->val()>=0)
+ cond_func=(Item_func_match *) arg1;
+ }
}
else if (cond->type() == Item::COND_ITEM)
{
@@ -1394,18 +1397,21 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
if (((Item_cond*) cond)->functype() == Item_func::COND_AND_FUNC)
{
Item *item;
- /* I'm too lazy to implement proper recursive descent here,
+ /*
+ I', (Sergei) too lazy to implement proper recursive descent here,
and anyway, nobody will use such a stupid queries
that will require it :-)
May be later...
- */
+ */
while ((item=li++))
+ {
if (item->type() == Item::FUNC_ITEM &&
((Item_func *)item)->functype() == Item_func::FT_FUNC)
{
cond_func=(Item_func_match *)item;
break;
}
+ }
}
}