Commit graph

133 commits

Author SHA1 Message Date
Kent Boortz
1400d7a2cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
Davi Arnaut
c96b249fc3 Bug#45288: pb2 returns a lot of compilation warnings on linux
Fix warnings flagged by the new warning option -Wunused-but-set-variable
that was added to GCC 4.6 and that is enabled by -Wunused and -Wall. The
option causes a warning whenever a local variable is assigned to but is
later unused. It also warns about meaningless pointer dereferences.
2010-07-20 15:07:36 -03:00
Davi Arnaut
4f59204b49 Bug#53445: Build with -Wall and fix warnings that it generates
Introduce a MySQL maintainer/developer mode that enables
a set of warning options for the C/C++ compiler. This mode
is intended to help improve the overall quality of the code.

The warning options are:

C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Werror"
CXX_WARNINGS="$C_WARNINGS -Wno-unused-parameter"

Since -Wall is essentially a moving target, autoconf checks
are not run with warning options enabled, in particualr -Werror.
This decision might be revisited in the future. The patch also
fixes a mistake in the makefiles, where automake CXXFLAGS would
be set to CFLAGS.
2010-07-09 08:37:51 -03:00
Sergey Glukhov
c8f278485b Bug#33717 INSERT...(default) fails for enum. Crashes CSV tables, loads spaces for MyISAM
Table corruption happens during table reading in ha_tina::find_current_row() func.
Field::store() method returns error(true) if stored value is 0.
The fix:
added special case for enum type which correctly processes 0 value.
Additional fix:
INSERT...(default) and INSERT...() have the same behaviour now for enum type.
2010-02-17 16:13:42 +04:00
Staale Smedseng
8b9843408d Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2

Cleaning up warnings not present in 5.0.
2009-09-23 15:21:29 +02:00
Vladislav Vaintroub
31b79618e3 Backport WL#3653 to 5.1 to enable bundled innodb plugin.
Remove custom DLL loader code from innodb plugin code, use 
symbols exported from mysqld.
2009-06-10 10:59:49 +02:00
Sergey Glukhov
40138ba72a compiler warning fix 2009-03-24 13:02:01 +04:00
Georgi Kodinov
ef4ab5cfaa fixed compilation warnings. addendum to the fix for bug 29125 2009-03-20 16:27:53 +02:00
Ignacio Galarza
2d9421c3bb Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
2009-02-13 11:41:47 -05:00
Sergey Glukhov
c9245922d6 Bug#41441 repair csv table crashes debug server
The problem: data file can not be deleted on win because
there is another opened instance of this file.
Data file might be opened twice, on table opening stage and
during write_row execution. We need to close both instances
to satisfy Win.
2008-12-29 16:50:51 +04:00
Sergey Glukhov
7eb1507ad1 Bug#36638 mysqld crashes when open file limit is passed and general query log enabled
The problem:
CSV storage engine open function returns success even
thought it failed to open the data file
The fix:
return error
Additional fixes:
added MY_WME to my_open to avoid mysterious error message
free share struct if open the file was unsuccessful
2008-08-15 11:53:54 +05:00
antony@pcg5ppc.xiphis.org
820068f1b7 Merge pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/mysql-5.1-engines
into  pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/merge.20080307/mysql-5.1
2008-03-07 13:46:29 -08:00
iggy@alf.(none)
a54f3995ec Merge bk-internal.mysql.com:/home/bk/mysql-5.1-build
into  alf.(none):/src/mysql-5.1-build_31929
2008-02-21 19:53:37 -05:00
iggy@alf.(none)
18aba8a82c Bug#31929 Windows build fails with >=4 Parallel build threads.
- Add GenError Dependency to storage engines that include 
mysqld_error.h
2008-01-29 21:58:57 -05:00
acurtis/antony@xiphis.org/ltamd64.xiphis.org
7fe6888220 Bug#33067
"Update of CSV row incorrect for some BLOBs"
  when reading in rows, move blob columns into temporary storage not
  allocated by Field_blob class or else row update operation will
  alter original row and make mysql think that nothing has been changed.
fix incrementing wrong statistic values.
2008-01-17 15:37:18 -08:00
istruewing@stella.local
03d99c5956 Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg
2007-12-11 21:37:33 +01:00
svoj@mysql.com/june.mysql.com
413112fb55 BUG#32817 - though CSV is marked as supported create table is rejected
with error 1005.

CSV doesn't support nullable fields. Report descriptive error if create
table with nullable field is requested.
2007-12-07 14:44:03 +04:00
svoj@mysql.com/april.(none)
a4d2d87395 BUG#32050 - table logging gone wrong.
INSERT/UPDATE against CSV table created by MySQL earlier than 5.1.23
with NULL-able column results in server crash in debug builds.

Starting with 5.1.23 CSV doesn't permit creation of NULL-able columns,
but it is still possible to get such table from older MySQL versions.

Fixed by removing excessive DBUG_ASSERT().
2007-11-27 14:01:11 +04:00
tsmith@ramayana.hindu.god
e347c1413a Merge ramayana.hindu.god:/home/tsmith/m/bk/51
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/51
2007-10-22 14:32:22 -06:00
antony@pcg5ppc.xiphis.org
f4a153c3c4 Bug#31473
"CSV does not work with NULL value in datetime fields"
  Attempting to insert a row with a NULL value for a DATETIME field
  results in a CSV file which the storage engine cannot read.
  Don't blindly assume that "0" is acceptable for all field types,
  Since CSV does not support NULL, we find out from the field the
  default non-null value.
  Do not permit the creation of a table with a nullable columns.
2007-10-18 14:48:04 -07:00
kaa@polly.(none)
97226f1027 Merge polly.(none):/home/kaa/src/maint/mysql-5.0-maint
into  polly.(none):/home/kaa/src/maint/mysql-5.1-maint
2007-10-18 14:32:43 +04:00
jbruehe/mysqldev@mysql.com/production.mysql.com
2d4efab366 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-marvel
into  mysql.com:/data0/mysqldev/my/mysql-5.1-30367
2007-08-16 18:21:47 +02:00
monty@mysql.com/nosik.monty.fi
e53a73e26c Fixed a lot of compiler warnings and errors detected by Forte C++ on Solaris
Faster thr_alarm()
Added 'Opened_files' status variable to track calls to my_open()
Don't give warnings when running mysql_install_db
Added option --source-install to mysql_install_db

I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems
index_read()      -> index_read_map()
index_read_idx()  -> index_read_idx_map()
index_read_last() -> index_read_last_map()
2007-08-13 16:11:25 +03:00
kent@mysql.com/kent-amd64.(none)
413d1e1aa4 CMakeLists.txt (many), win/README, mysql_manifest.cmake, configure.js:
Additional changes for bug#29903
  - Changed to do embedded build part as normal build, when
    WITH_EMBEDDED_SERVER is set.
  - Allow both normal and debug build with embedded.
  - Build static embedded library by pointing out all source and compile
    it all, i.e. not building libraries from libraries, not portable.
  - Let embedded use generated files from the "sql" directory, added
    dependencies to make sure built before embedded.
  - Mark library "dbug" in TARGET_LINK_LIBRARIES() with "debug", so only
    linked in when debug target is used.
  - Removed change of target name with "mysqld${MYSQLD_EXE_SUFFIX}", as
    others can't depend on it, not defined at configure time. Instead
    set the output file name.
  - Created work around for bug in CMake 2.4.6 and output names, to
    set the "mysqld<suffix>.pdb" name to the same base name.
  - Set the correct manifest "name" (patch by iggy)
2007-08-06 23:16:01 +02:00
malff/marcsql@weblab.(none)
c7bbd8917c WL#3984 (Revise locking of mysql.general_log and mysql.slow_log)
Bug#25422 (Hang with log tables)
Bug 17876 (Truncating mysql.slow_log in a SP after using cursor locks the
          thread)
Bug 23044 (Warnings on flush of a log table)
Bug 29129 (Resetting general_log while the GLOBAL READ LOCK is set causes
           a deadlock)

Prior to this fix, the server would hang when performing concurrent
ALTER TABLE or TRUNCATE TABLE statements against the LOG TABLES,
which are mysql.general_log and mysql.slow_log.

The root cause traces to the following code:
in sql_base.cc, open_table()
  if (table->in_use != thd)
  {
    /* wait_for_condition will unlock LOCK_open for us */
    wait_for_condition(thd, &LOCK_open, &COND_refresh);
  }
The problem with this code is that the current implementation of the
LOGGER creates 'fake' THD objects, like
- Log_to_csv_event_handler::general_log_thd
- Log_to_csv_event_handler::slow_log_thd
which are not associated to a real thread running in the server,
so that waiting for these non-existing threads to release table locks
cause the dead lock.

In general, the design of Log_to_csv_event_handler does not fit into the
general architecture of the server, so that the concept of general_log_thd
and slow_log_thd has to be abandoned:
- this implementation does not work with table locking
- it will not work with commands like SHOW PROCESSLIST
- having the log tables always opened does not integrate well with DDL
operations / FLUSH TABLES / SET GLOBAL READ_ONLY

With this patch, the fundamental design of the LOGGER has been changed to:
- always open and close a log table when writing a log
- remove totally the usage of fake THD objects
- clarify how locking of log tables is implemented in general.

See WL#3984 for details related to the new locking design.

Additional changes (misc bugs exposed and fixed):

1)

mysqldump which would ignore some tables in dump_all_tables_in_db(),
 but forget to ignore the same in dump_all_views_in_db().

2)

mysqldump would also issue an empty "LOCK TABLE" command when all the tables
to lock are to be ignored (numrows == 0), instead of not issuing the query.

3)

Internal errors handlers could intercept errors but not warnings
(see sql_error.cc).

4)

Implementing a nested call to open tables, for the performance schema tables,
exposed an existing bug in remove_table_from_cache(), which would perform:
  in_use->some_tables_deleted=1;
against another thread, without any consideration about thread locking.
This call inside remove_table_from_cache() was not required anyway,
since calling mysql_lock_abort() takes care of aborting -- cleanly -- threads
that might hold a lock on a table.
This line (in_use->some_tables_deleted=1) has been removed.
2007-07-27 00:31:06 -06:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
11a0cf3a6f Fix for bug #29253: csv table reportedly marked as crashed
Problem: the data file changes made during delete/update are not visible to 
other threads as the file is reopened, so reading data 
with old descriptors might miss the changes.

Fix: reopen the data file before reading if it was reopened during 
delete/update to ensure there's no data behind.

Note: there's no simple test case.
2007-07-14 00:13:37 +05:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
5fb5f2a9a5 Fix for bug #29652: csv.test failure: two changes conflict after merge
Problem: we don't take into account the length of the data written
to the temporary data file during update on a CSV table.

Fix: properly calculate the data file length during update.
2007-07-10 13:09:07 +05:00
tsmith@sita.local
5f12f35c34 Merge sita.local:/Users/tsmith/m/bk/51
into  sita.local:/Users/tsmith/m/bk/maint/51

This merge requires a post-merge fix to remove rpl_udf from
suite/rpl/t/disabled.def.
2007-07-09 03:27:03 -06:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
ba650762d1 Fix for bug #29411: deleting from a csv table leads to the table corruption
Problem: we don't adjust share->rows_recorded and local_saved_data_file_length
deleting rows from a CSV table, so following table check may fail.

Fix: properly adjust those values.
2007-07-05 11:55:06 +05:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
ee5403110d Complementary fix for bug #29353: inserting a negative value to a csv table
leads to the table corruption

New Field::store() method implemented to explicitly set thd->count_cuted_fields
before value storing, instead of (incorrectly) setting it in the CSV storage engine.
Thread row counter now properly incremented during check and repair in the CSV engine.
2007-07-03 17:17:58 +05:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
2ca3289e3e Fix for bug #29353: inserting a negative value to a csv table leads to the table corruption
Problem: we believe a number cannot start with '-' ['+'] sign reading rows.

Fix: let field->store() check given values.
2007-06-27 16:20:00 +05:00
istruewing@chilla.local
9d3c6858af Merge chilla.local:/home/mydev/mysql-5.1-amain
into  chilla.local:/home/mydev/mysql-5.1-axmrg
2007-06-24 16:46:16 +02:00
svoj@april.(none)
c62450bbb9 Merge mysql.com:/home/svoj/devel/bk/mysql-5.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG28971/mysql-5.1-engines
2007-06-22 23:14:59 +05:00
lars/lthalmann@dl145h.mysql.com
a2d93c53db Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.1-new-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.1-merge
2007-06-18 12:10:36 +02:00
bar@bar.myoffice.izhnet.ru
615297df8b Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b28862
into  mysql.com:/home/bar/mysql-work/mysql-5.1.b28862
2007-06-15 11:27:10 +05:00
svoj@mysql.com/april.(none)
8f5b6ec237 BUG#28971 - ALTER TABLE followed by UPDATE for a CSV table
make server crash

UPDATE against CSV table may cause server crash or update a table with wrong
values.

CSV can write only a whole row at once. That means it must read all columns,
that it is not going to update, and write them along with updated columns.
But only limited set of columns was read, those that were needed for the
UPDATE query.

With this fix all columns are read in case we're performing an UPDATE.
2007-06-15 03:22:40 +05:00
mats@kindahl-laptop.dnsalias.net
143a895b4f Merge kindahl-laptop.dnsalias.net:/home/bkroot/mysql-5.1-rpl
into  kindahl-laptop.dnsalias.net:/home/bk/b23051-mysql-5.1-rpl
2007-06-12 22:14:54 +02:00
mats@kindahl-laptop.dnsalias.net
9a92325c02 WL#3303 (RBR: Engine-controlled logging format):
Adding support to allow engines to tell what formats they can handle.
The server will generate an error if it is not possible to log the
statement according to the logging mode in effect.

Adding flags to several storage engines to state what they can handle.

Changes to NDB handler removing code that forces row-based mode and
adding flag saying that NDB can only handle row format.

Adding check that binlog flags are only used for real tables that are
opened for writing.
2007-05-28 12:50:29 +02:00
monty@mysql.com/narttu.mysql.fi
088e2395f1 WL#3817: Simplify string / memory area types and make things more consistent (first part)
The following type conversions was done:

- Changed byte to uchar
- Changed gptr to uchar*
- Change my_string to char *
- Change my_size_t to size_t
- Change size_s to size_t

Removed declaration of byte, gptr, my_string, my_size_t and size_s. 

Following function parameter changes was done:
- All string functions in mysys/strings was changed to use size_t
  instead of uint for string lengths.
- All read()/write() functions changed to use size_t (including vio).
- All protocoll functions changed to use size_t instead of uint
- Functions that used a pointer to a string length was changed to use size_t*
- Changed malloc(), free() and related functions from using gptr to use void *
  as this requires fewer casts in the code and is more in line with how the
  standard functions work.
- Added extra length argument to dirname_part() to return the length of the
  created string.
- Changed (at least) following functions to take uchar* as argument:
  - db_dump()
  - my_net_write()
  - net_write_command()
  - net_store_data()
  - DBUG_DUMP()
  - decimal2bin() & bin2decimal()
- Changed my_compress() and my_uncompress() to use size_t. Changed one
  argument to my_uncompress() from a pointer to a value as we only return
  one value (makes function easier to use).
- Changed type of 'pack_data' argument to packfrm() to avoid casts.
- Changed in readfrm() and writefrom(), ha_discover and handler::discover()
  the type for argument 'frmdata' to uchar** to avoid casts.
- Changed most Field functions to use uchar* instead of char* (reduced a lot of
  casts).
- Changed field->val_xxx(xxx, new_ptr) to take const pointers.

Other changes:
- Removed a lot of not needed casts
- Added a few new cast required by other changes
- Added some cast to my_multi_malloc() arguments for safety (as string lengths
  needs to be uint, not size_t).
- Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done
  explicitely as this conflict was often hided by casting the function to
  hash_get_key).
- Changed some buffers to memory regions to uchar* to avoid casts.
- Changed some string lengths from uint to size_t.
- Changed field->ptr to be uchar* instead of char*. This allowed us to
  get rid of a lot of casts.
- Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar
- Include zlib.h in some files as we needed declaration of crc32()
- Changed MY_FILE_ERROR to be (size_t) -1.
- Changed many variables to hold the result of my_read() / my_write() to be
  size_t. This was needed to properly detect errors (which are
  returned as (size_t) -1).
- Removed some very old VMS code
- Changed packfrm()/unpackfrm() to not be depending on uint size
  (portability fix)
- Removed windows specific code to restore cursor position as this
  causes slowdown on windows and we should not mix read() and pread()
  calls anyway as this is not thread safe. Updated function comment to
  reflect this. Changed function that depended on original behavior of
  my_pwrite() to itself restore the cursor position (one such case).
- Added some missing checking of return value of malloc().
- Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow.
- Changed type of table_def::m_size from my_size_t to ulong to reflect that
  m_size is the number of elements in the array, not a string/memory
  length.
- Moved THD::max_row_length() to table.cc (as it's not depending on THD).
  Inlined max_row_length_blob() into this function.
- More function comments
- Fixed some compiler warnings when compiled without partitions.
- Removed setting of LEX_STRING() arguments in declaration (portability fix).
- Some trivial indentation/variable name changes.
- Some trivial code simplifications:
  - Replaced some calls to alloc_root + memcpy to use
    strmake_root()/strdup_root().
  - Changed some calls from memdup() to strmake() (Safety fix)
  - Simpler loops in client-simple.c
2007-05-10 12:59:39 +03:00
kroki/tomash@moonlight.home
c19affef54 BUG#9953: CONVERT_TZ requires mysql.time_zone_name to be locked
The problem was that some facilities (like CONVERT_TZ() function or
server HELP statement) may require implicit access to some tables in
'mysql' database.  This access was done by ordinary means of adding
such tables to the list of tables the query is going to open.
However, if we issued LOCK TABLES before that, we would get "table
was not locked" error trying to open such implicit tables.

The solution is to treat certain tables as MySQL system tables, like
we already do for mysql.proc.  Such tables may be opened for reading
at any moment regardless of any locks in effect.  The cost of this is
that system table may be locked for writing only together with other
system tables, it is disallowed to lock system tables for writing and
have any other lock on any other table.

After this patch the following tables are treated as MySQL system
tables:
  mysql.help_category
  mysql.help_keyword
  mysql.help_relation
  mysql.help_topic
  mysql.proc (it already was)
  mysql.time_zone
  mysql.time_zone_leap_second
  mysql.time_zone_name
  mysql.time_zone_transition
  mysql.time_zone_transition_type

These tables are now opened with open_system_tables_for_read() and
closed with close_system_tables(), or one table may be opened with
open_system_table_for_update() and closed with close_thread_tables()
(the latter is used for mysql.proc table, which is updated as part of
normal MySQL server operation).  These functions may be used when
some tables were opened and locked already.

NOTE: online update of time zone tables is not possible during
replication, because there's no time zone cache flush neither on LOCK
TABLES, nor on FLUSH TABLES, so the master may serve stale time zone
data from cache, while on slave updated data will be loaded from the
time zone tables.
2007-03-09 13:12:31 +03:00
kostja@bodhi.local
b72c2771dc Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.local:/opt/local/work/mysql-5.1-runtime
2007-01-11 22:15:20 +03:00
brian@zim.(none)
c578350e05 Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.1-arch
into  zim.(none):/home/brian/mysql/merge-5.1
2007-01-04 12:06:40 -08:00
brian@zim.(none)
452a1331b2 The CSV format has always relied on numbers being quoted, which doesn't always happen. This fixes that so that numbers can now be unquoted (and the output does this as well so that the log takes up less space). 2007-01-04 11:41:17 -08:00
baker@bk-internal.mysql.com
9ffaf185f0 Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-arch
2007-01-04 19:54:52 +01:00
brian@zim.(none)
6ff7092698 Split out the hidden class from the ha_tina file (probably should have just deleted it...) but this is a bit better. 2007-01-03 17:26:45 -08:00
malff/marcsql@weblab.(none)
0055056c91 Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-merge
2007-01-02 14:18:13 -07:00
kent@mysql.com/kent-amd64.(none)
67868597bb Many files:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
  Adjusted year(s) in copyright header 
  Added GPL copyright text
my_vle.h, rpl_utility.h, my_vle.c, base64-t.c, rpl_utility.cc:
  Changed copyright header formatting some
plugin_example.c, daemon_example.c:
  Added "Copyright (C) 2006 MySQL AB" to GPL header
2006-12-31 02:29:11 +01:00
kent@mysql.com/kent-amd64.(none)
1e3237fefa Many files:
Changed header to GPL version 2 only
2006-12-27 02:23:51 +01:00
kent@kent-amd64.(none)
be15e3bc15 Merge mysql.com:/home/kent/bk/main/mysql-5.0
into  mysql.com:/home/kent/bk/main/mysql-5.1
2006-12-23 20:20:40 +01:00
petr/cps@outpost.site
dd8ff0ad33 Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  outpost.site:/home/cps/mysql/trees/5.1-runtime-19044
2006-12-04 18:47:16 +03:00