Commit 8700c563 authored by unknown's avatar unknown

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
parent 29b3ef30
......@@ -6,6 +6,8 @@ aclocal && autoheader && aclocal && automake && autoconf
(cd bdb/dist && sh s_all)
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
CFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_purify -O2" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_PURIFY -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug=full
CFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_purify -DEXTRA_DEBUG -O2" CXX=gcc CXXLD=g++ CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_purify -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug=full --with-berkeley-db --with-innodb
gmake -j 4
cd sql ; rm mysqld ; make CXXLD="purify -best-effort g++" mysqld
......@@ -15,3 +15,4 @@ jcole@tetra.spaceapes.com
davida@isil.mysql.com
tonu@x153.internalnet
tim@bitch.mysql.fi
monty@bitch.mysql.fi
......@@ -59,7 +59,7 @@ else
basedir=.
rm -rf share
mkdir share
ln -sf ../../sql/share share/mysql
ln -f -s ../../sql/share share/mysql
fi
# Initialize variables
......
......@@ -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};
......
......@@ -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;
}
......
......@@ -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
};
/*
......
......@@ -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) &&
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 ((func->functype() == Item_func::LE_FUNC ||
func->functype() == Item_func::LT_FUNC) &&
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;
cond_func=(Item_func_match *) arg1;
}
}
else if (cond->type() == Item::COND_ITEM)
{
......@@ -1394,12 +1397,14 @@ 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)
{
......@@ -1408,6 +1413,7 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
}
}
}
}
if(!cond_func)
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment