Commit graph

3 commits

Author SHA1 Message Date
Michael Widenius
d13c54351d Remove compiler warnings (Including some warnings from -Wstrict-aliasing)
Don't use static link by default (in compile-pentium) as some new systems doesn't have all static libraries available
Change type for functions in plugin.h:str_mysql_ftparser_param() to const unsigned char and string lengths to size_t.
One effect of the above change is that one needs to include mysql_global.h or define size_t before including plugin.h
This fixes a case where mysql_client_test failed with newer gcc that enables strict-aliasing by default


BUILD/compile-pentium:
  Don't use static link by default as some new systems doesn't have all static libraries available
client/mysql_upgrade.c:
  Remove not used variable
cmd-line-utils/readline/config_readline.h:
  Define some constants to get rid of compiler warnings on Linux
cmd-line-utils/readline/display.c:
  Get rid of compiler warnings
cmd-line-utils/readline/history.c:
  Got rid of compiler warnings:
  - Defining some strings as const
  - Added cast
cmd-line-utils/readline/rlmbutil.h:
  Added cast to get rid of compiler warnings
cmd-line-utils/readline/text.c:
  Remove not needed initialization to get rid of compiler warnings
cmd-line-utils/readline/xmalloc.c:
  Changed types to 'const char* to get rid of compiler warnings
configure.in:
  Ensure that we use MariaDB as suffix
include/mysql/plugin.h:
  Changed types to 'const unsigned char* to get rid of compiler warnings (in other parts of the code)
  Change length for not \0 terminated string to size_t
include/mysql/plugin.h.pp:
  Update related to plugin.h
libmysql/libmysql.c:
  Fixed bug that caused core dump with newer gcc when strict aliasing is not turned off
mysql-test/t/information_schema.test:
  Test is depending on innodb
mysql-test/t/not_partition.test:
  Fixed wrong directory name
  (Not noticed before as we don't ususally run this test)
mysys/lf_hash.c:
  Got rid of compiler warnings from -Wstrict-aliasing
mysys/my_redel.c:
  Removed not used variable
regex/engine.c:
  Changed types to 'const char* to get rid of compiler warnings
regex/engine.ih:
  Changed types to 'const char* to get rid of compiler warnings
sql/sp_head.cc:
  Got rid of compiler warning from -Wstrict-aliasing
sql/sql_base.cc:
  Got rid of compiler warnings from -Wstrict-aliasing
  (The original code was probably wrong as nj_col->table_field was
sql/sql_builtin.cc.in:
  plugin.h needs to have size_t defined
sql/sql_parse.cc:
  Remove used variable
sql/sql_select.cc:
  Got rid of compiler warnings from -Wstrict-aliasing
sql/sql_show.cc:
  Added #ifdef to get rid of compiler warning when not using partition engine
sql/table.cc:
  Got rid of compiler warning from -Wstrict-aliasing
storage/maria/ha_maria.cc:
  Got rid of compiler warnings from -Wstrict-aliasing:
  - Use the thd_killed() API function
storage/maria/lockman.c:
  Got rid of compiler warnings from -Wstrict-aliasing
storage/maria/ma_check.c:
  Got rid of compiler warnings from -Wstrict-aliasing
  Change to use new version of _ma_killed_ptr; Don't call it as often as before
storage/maria/ma_check_standalone.h:
  Update to compatible _ma_killed_ptr() from ha_maria.cc
storage/maria/ma_ft_boolean_search.c:
  Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/maria/ma_ft_nlq_search.c:
  Got rid of compiler warnings from -Wstrict-aliasing
  Ensure that 'subkeys' is 32 bit
storage/maria/ma_ft_parser.c:
  Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/maria/ma_ftdefs.h:
  Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/maria/ma_sort.c:
  Change to use new version of _ma_killed_ptr; Don't call it as often as before
storage/maria/ma_state.c:
  Got rid of compiler warnings from -Wstrict-aliasing
storage/maria/maria_def.h:
  Redefine ma_killed_ptr()
storage/maria/maria_ftdump.c:
  Got rid of compiler warnings from -Wstrict-aliasing
storage/maria/trnman.c:
  Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/ft_boolean_search.c:
  Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ft_nlq_search.c:
  Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/ft_parser.c:
  Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ft_stopwords.c:
  Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ftdefs.h:
  Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ha_myisam.cc:
  Got rid of compiler warnings from -Wstrict-aliasing:
  - Use the thd_killed() API function
storage/myisam/mi_check.c:
  Use new killed_ptr() function
storage/myisam/myisam_ftdump.c:
  Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/myisamchk.c:
  Update to compatible killed_ptr() from ha_myisam.cc
storage/myisam/myisamdef.h:
  Redefine killed_ptr()
storage/myisam/myisamlog.c:
  Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/sort.c:
  Change to use new version of killed_ptr; Don't call it as often as before
storage/xtradb/fil/fil0fil.c:
  Fixedc ompiler warning
storage/xtradb/trx/trx0i_s.c:
  Include mysql_plugin.h later to ensure that size_t is defined
2009-11-30 01:08:56 +02:00
Mattias Jonsson
48e0325c5e Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
Problem was that it tried to run partitioning function calls when
opening a partitioned table, when it was explicitly disabled.

Solution is to check if the partitioning plugin is ready to use before
using any partitioning specific calls.

mysql-test/r/disabled_partition.require:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  New require file to use when partitioning is disabled (but compiled in)
mysql-test/r/not_partition.result:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  Updated testcase
mysql-test/r/partition_disabled.result:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  New result file
mysql-test/std_data/parts/t1.frm:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  frm file for 'create table t1 (a int) partition by hash (a)'
mysql-test/t/not_partition.test:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  Updated test cases
mysql-test/t/partition_disabled-master.opt:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  New opt file
mysql-test/t/partition_disabled.test:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  New test file (looks like not_partition.test, but with different errors)
sql/sql_yacc.yy:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  Better error message (it is already built with partitioning, but is explicitly
  disabled).
sql/table.cc:
  Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
  
  If the partitioning plugin is not ready, fail to open the table.
2009-01-08 15:16:44 +01:00
unknown
ed53c394f9 Bug#18888 Trying to overwrite sql/lex_hash.h during build
- As a sideeffect of the patch to generate lex_hash.h only once
on the machine where the source dist was produced, a problem
was found when compiling a mysqld without partition support - it 
would crash when looking up the lex symbols due to mismatch between
lex.h and the generated lex_hash.h

 - Remove the ifdef for partition in lex.h 
 - Fix minor problem with"EXPLAIN PARTITION" when not compiled with
   partition(existed also without the above patch)
 - Add test case that will be run when we don't have partition
   support compiled into mysqld
 - Return error ER_FEATURE_DISABLED if user tries to use PARTITION
   when there is no support for it.


sql/lex.h:
  There should be no ifdefs of features in lex.h
sql/sql_class.cc:
  In line with the comment in sql_yacc.yy that we want the same output
  from "EXPLAIN PARTITIONS.." regardless of wheter we have compiled in
  support for partition  or not, remove the ifdef so the extra field
  is added to output if the DESCRIBE_PARTITIONS bit it set. Without
  this patch we get a crash as the code in select_describe believes the
  field is there.
sql/sql_select.cc:
  Use "const" for the variable as it's a ssigned once and never changes
sql/sql_yacc.yy:
  Don't allow PARTITION syntax oif there is no suport for partitioning
mysql-test/r/not_partition.require:
  New BitKeeper file ``mysql-test/r/not_partition.require''
mysql-test/r/not_partition.result:
  New BitKeeper file ``mysql-test/r/not_partition.result''
mysql-test/t/not_partition.test:
  New BitKeeper file ``mysql-test/t/not_partition.test''
2006-10-26 19:11:09 +02:00