Commit 410faef6 authored by monty@bitch.mysql.fi's avatar monty@bitch.mysql.fi

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
parent 934f3acc
...@@ -6,6 +6,8 @@ aclocal && autoheader && aclocal && automake && autoconf ...@@ -6,6 +6,8 @@ aclocal && autoheader && aclocal && automake && autoconf
(cd bdb/dist && sh s_all) (cd bdb/dist && sh s_all)
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf) (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 gmake -j 4
cd sql ; rm mysqld ; make CXXLD="purify -best-effort g++" mysqld
...@@ -15,3 +15,4 @@ jcole@tetra.spaceapes.com ...@@ -15,3 +15,4 @@ jcole@tetra.spaceapes.com
davida@isil.mysql.com davida@isil.mysql.com
tonu@x153.internalnet tonu@x153.internalnet
tim@bitch.mysql.fi tim@bitch.mysql.fi
monty@bitch.mysql.fi
...@@ -59,7 +59,7 @@ else ...@@ -59,7 +59,7 @@ else
basedir=. basedir=.
rm -rf share rm -rf share
mkdir share mkdir share
ln -sf ../../sql/share share/mysql ln -f -s ../../sql/share share/mysql
fi fi
# Initialize variables # Initialize variables
......
...@@ -35,7 +35,7 @@ ulong myisam_recover_options= HA_RECOVER_NONE; ...@@ -35,7 +35,7 @@ ulong myisam_recover_options= HA_RECOVER_NONE;
/* bits in myisam_recover_options */ /* bits in myisam_recover_options */
const char *myisam_recover_names[] = const char *myisam_recover_names[] =
{ "DEFAULT", "BACKUP", "FORCE", "QUICK"}; { "DEFAULT", "BACKUP", "FORCE", "QUICK", NullS};
TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names),"", TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names),"",
myisam_recover_names}; myisam_recover_names};
......
...@@ -229,6 +229,7 @@ void ha_myisammrg::update_create_info(HA_CREATE_INFO *create_info) ...@@ -229,6 +229,7 @@ void ha_myisammrg::update_create_info(HA_CREATE_INFO *create_info)
MYRG_TABLE *table; MYRG_TABLE *table;
THD *thd=current_thd; THD *thd=current_thd;
create_info->merge_list.next= &create_info->merge_list.first; 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++) 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) ...@@ -240,6 +241,7 @@ void ha_myisammrg::update_create_info(HA_CREATE_INFO *create_info)
fn_format(buff,name,"","",3); fn_format(buff,name,"","",3);
if (!(ptr->real_name=thd->strdup(buff))) if (!(ptr->real_name=thd->strdup(buff)))
goto err; goto err;
create_info->merge_list.elements++;
(*create_info->merge_list.next) = (byte*) ptr; (*create_info->merge_list.next) = (byte*) ptr;
create_info->merge_list.next= (byte**) &ptr->next; create_info->merge_list.next= (byte**) &ptr->next;
} }
......
...@@ -27,8 +27,15 @@ class Sql_alloc ...@@ -27,8 +27,15 @@ class Sql_alloc
public: public:
static void *operator new(size_t size) {return (void*) sql_alloc((uint) size); } static void *operator new(size_t size) {return (void*) sql_alloc((uint) size); }
static void operator delete(void *ptr, size_t size) {} /*lint -e715 */ static void operator delete(void *ptr, size_t size) {} /*lint -e715 */
inline Sql_alloc() {}; #ifdef HAVE_purify
inline ~Sql_alloc() {}; 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, ...@@ -1368,24 +1368,27 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
if (cond->type() == Item::FUNC_ITEM) if (cond->type() == Item::FUNC_ITEM)
{ {
Item_func *func=(Item_func *)cond, Item_func *func=(Item_func *)cond;
*arg0=(Item_func *)(func->arguments()[0]), Item_func::Functype functype= func->functype();
*arg1=(Item_func *)(func->arguments()[1]); if (functype == Item_func::FT_FUNC)
if (func->functype() == Item_func::FT_FUNC)
cond_func=(Item_func_match *)cond; cond_func=(Item_func_match *)cond;
else if ((func->functype() == Item_func::GE_FUNC || else if (func->arg_count == 2)
func->functype() == Item_func::GT_FUNC) && {
arg0->type() == Item::FUNC_ITEM && Item_func *arg0=(Item_func *)(func->arguments()[0]),
arg0->functype() == Item_func::FT_FUNC && *arg1=(Item_func *)(func->arguments()[1]);
arg1->const_item() && arg1->val()>=0) if ((functype == Item_func::GE_FUNC ||
cond_func=(Item_func_match *)arg0; functype == Item_func::GT_FUNC) &&
else if ((func->functype() == Item_func::LE_FUNC || arg0->type() == Item::FUNC_ITEM &&
func->functype() == Item_func::LT_FUNC) && arg0->functype() == Item_func::FT_FUNC &&
arg1->type() == Item::FUNC_ITEM && arg1->const_item() && arg1->val()>=0)
arg1->functype() == Item_func::FT_FUNC && cond_func=(Item_func_match *) arg0;
arg0->const_item() && arg0->val()>=0) else if ((functype == Item_func::LE_FUNC ||
cond_func=(Item_func_match *)arg1; 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) else if (cond->type() == Item::COND_ITEM)
{ {
...@@ -1394,18 +1397,21 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array, ...@@ -1394,18 +1397,21 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
if (((Item_cond*) cond)->functype() == Item_func::COND_AND_FUNC) if (((Item_cond*) cond)->functype() == Item_func::COND_AND_FUNC)
{ {
Item *item; 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 and anyway, nobody will use such a stupid queries
that will require it :-) that will require it :-)
May be later... May be later...
*/ */
while ((item=li++)) while ((item=li++))
{
if (item->type() == Item::FUNC_ITEM && if (item->type() == Item::FUNC_ITEM &&
((Item_func *)item)->functype() == Item_func::FT_FUNC) ((Item_func *)item)->functype() == Item_func::FT_FUNC)
{ {
cond_func=(Item_func_match *)item; cond_func=(Item_func_match *)item;
break; break;
} }
}
} }
} }
......
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