Commit graph

106 commits

Author SHA1 Message Date
Staale Smedseng
27eff2bcac Merge from 5.0-bugteam for 43414 2009-06-09 18:44:26 +02:00
Staale Smedseng
dae006c17f Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
Compiling MySQL with gcc 4.3.2 and later produces a number of 
warnings, many of which are new with the recent compiler
versions.
      
This bug will be resolved in more than one patch to limit the
size of changesets. This is the first patch, fixing a number 
of the warnings, predominantly "suggest using parentheses 
around && in ||", and empty for and while bodies.
2009-06-09 18:11:21 +02:00
Staale Smedseng
53d9b3d92d Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2

Compiling MySQL with gcc 4.3.2 and later produces a number of 
warnings, many of which are new with the recent compiler
versions.

This bug will be resolved in more than one patch to limit the
size of changesets. This is the first patch, fixing a number 
of the warnings, predominantly "suggest using parentheses 
around && in ||", and empty for and while bodies.
2009-06-09 14:55:30 +02:00
cmiller@zippy.cornsilk.net
91b5c11922 Doxygenization of comments. 2007-10-11 13:29:09 -04:00
kostja@bodhi.(none)
beb61609a1 Fix doxygen warnings. 2007-08-16 21:14:47 +04:00
gshchepa/uchum@gleb.loc
1674d8dc35 Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.1-opt
2007-07-13 19:36:10 +05:00
gshchepa/uchum@gleb.loc
b01237b9cb field_conv.cc:
Additional fix for bug #29360.
2007-07-12 00:55:40 +05:00
gshchepa/uchum@gleb.loc
13844b2533 Fixed bug #29360.
The special `zero' enum value was coerced to the normal
empty string enum value during a field-to-field copy.
This bug affected CREATE ... SELECT statements and
SELECT aggregate GROUP BY enum field statements.

Also this bug made unnecessary warnings during
the execution of CREATE ... SELECT statements:
Warning       1265    Data truncated for column...
2007-07-12 00:03:08 +05:00
igor@olga.mysql.com
259fdbf9ca Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.1-opt
2007-06-30 20:49:28 -07:00
igor@olga.mysql.com
38deea2496 Merge olga.mysql.com:/home/igor/mysql-4.1-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt
2007-06-30 16:24:09 -07:00
gshchepa/uchum@gleb.loc
f8bf427ba4 Fixed bug #29251.
Sometimes special 0 ENUM values was ALTERed to normal
empty string ENUM values.

Special 0 ENUM value has the same string representation
as normal ENUM value defined as '' (empty string).
The do_field_string function was used to convert
ENUM data at an ALTER TABLE request, but this
function doesn't care about numerical "indices" of
ENUM values, i.e. do_field_string doesn't distinguish
a special 0 value from an empty string value.

A new copy function called do_field_enum has been added to
copy special 0 ENUM values without conversion to an empty
string.
2007-06-27 03:41:50 +05:00
ibabaev@bk-internal.mysql.com
d460dc700a Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-opt
2007-06-01 06:33:37 +02:00
gluh@mysql.com/eagle.(none)
cdbdc4e745 backport of Bug#11491 Misleading error message if not NULL column set to NULL, SQL mode TRADITIONAL 2007-05-30 17:04:04 +05:00
mhansson@dl145s.mysql.com
2abc880b82 Merge dl145s.mysql.com:/users/mhansson/mysql/push/bug23856/my50-bug23856
into  dl145s.mysql.com:/users/mhansson/mysql/push/bug23856/my51-bug23856
2007-05-21 14:28:31 +02:00
mhansson@dl145s.mysql.com
6530f6806a bug#23856 2007-05-21 10:27:33 +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
bar@bar.myoffice.izhnet.ru
37b467a43c Merge mysql.com:/home/bar/mysql-5.0.b20095
into  mysql.com:/home/bar/mysql-5.1-new-rpl
2007-04-13 10:08:52 +05:00
bar@mysql.com
be8fc46db6 Bug#20095 Changing length of VARCHAR field with UTF8 collation does not truncate values
Problem: single byte do_varstring1() function was called, which didn't
check limit on "number of character", and checked only "number of bytes".
Fix: adding a multi-byte aware function do_varstring1_mb(),
to limit on "number of characters"
2007-04-13 10:05:55 +05:00
evgen@moonbone.local
f470ac2000 Merge moonbone.local:/mnt/gentoo64/work/bk-trees/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/bk-trees/mysql-5.1-opt
2007-03-31 02:42:40 +04:00
evgen@sunlight.local
7c42232d1d Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the
NO_AUTO_VALUE_ON_ZERO mode.

In the NO_AUTO_VALUE_ON_ZERO mode the table->auto_increment_field_not_null
variable is used to indicate that a non-NULL value was specified by the user
for an auto_increment column. When an INSERT .. ON DUPLICATE updates the
auto_increment field this variable is set to true and stays unchanged for the
next insert operation. This makes the next inserted row sometimes wrongly have
0 as the value of the auto_increment field.

Now the fill_record() function resets the table->auto_increment_field_not_null
variable before filling the record.
The table->auto_increment_field_not_null variable is also reset by the
open_table() function for a case if we missed some auto_increment_field_not_null
handling bug.
Now the table->auto_increment_field_not_null is reset at the end of the
mysql_load() function.

Reset the table->auto_increment_field_not_null variable after each
write_row() call in the copy_data_between_tables() function.
2007-03-30 18:13:33 +04:00
ramil/ram@ramil.myoffice.izhnet.ru
3a70edc321 Merge mysql.com:/home/ram/work/b24558/b24558.5.0
into  mysql.com:/home/ram/work/b24558/b24558.5.1
2007-03-15 13:08:24 +04:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
ffed36222d Fix for bug #24558: Increasing decimal column length causes data loss
Altering to a decimal field we get double value then store it 
that may cause data loss. 
Fix: use store_decimal() instead.
2007-03-15 12:06:06 +04:00
igor@olga.mysql.com
fb9e0ad3be Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.1-opt
2007-02-13 01:34:36 -08:00
gkodinov/kgeorge@macbook.gmz
5092f7ab26 Bug #22344: InnoDB keys act strange on datetime vs timestamp comparison
Ignoring error codes from type conversion allows default (wrong) values to
 go unnoticed in the formation of index search conditions.
 Fixed by correctly checking for conversion errors.
2007-02-06 11:08:57 +02:00
gluh@mysql.com/eagle.(none)
010dc0b55c Valgrind error fixes
Notes:
This patch doesn't fix all issues in the tree and we need jani's fix for that
This patch shoud not be merged into 5.0
2007-02-01 18:00:24 +04: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
kent@mysql.com/kent-amd64.(none)
226a5c833f Many files:
Changed header to GPL version 2 only
2006-12-23 20:17:15 +01:00
pgalbraith@bk-internal.mysql.com
23f0c6d765 Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-arch
2006-12-09 02:34:42 +01:00
brian@zim.(none)
31d67280f7 This finishes the work (someone) started to remove FIELD_ types and use the Enum MYSQL types. The second part to this is to actually deprecate the FIELD defines in mysql_com.h 2006-12-01 17:26:52 -08:00
msvensson@neptunus.(none)
b5603af7d5 Merge 192.168.0.5:mysql/mysql-5.1-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-maint
2006-11-29 23:53:07 +01:00
msvensson@neptunus.(none)
a50f80636c Merge neptunus.(none):/home/msvensson/mysql/bug19731/my50-bug19731
into  neptunus.(none):/home/msvensson/mysql/bug19731/my51-bug19731
2006-11-29 23:05:33 +01:00
monty@mysql.com/nosik.monty.fi
f6682e2743 Added --debug-info to most clients to detect memory leaks in mysql-test-run
Moved .progress files into the log directory
Moved 'cluster' database tables into the MySQL database, to not have 'cluster' beeing a reserved database name
Fixed bug where mysqld got a core dump when trying to use a table created by MySQL 3.23
Fixed some compiler warnings
Fixed small memory leak in libmysql
Note that this doesn't changeset doesn't include the new mysqldump.c code required to run some tests. This will be added when I merge 5.0 to 5.1
2006-11-21 22:32:58 +02:00
msvensson@neptunus.(none)
4c26bf9c1d Bug#19371 VARBINARY() have trailing zeros after upgrade from 4.1
- Detect if a table has field of type MYSQL_TYPE_VAR_STRING while running
   "CHECK TABLE t FOR UPGRADE" and indicate it need to be fixed
   with "REPAIR TABLE t".
 - When running a "REPAIR TABLE t" or "ALTER TABLE t FORCE" on the above
   table, install a special copy function to trim off the trailing spaces
   which we safely can say that the pre 5.0 mysqld didn't put there.
2006-11-09 12:00:27 +01:00
bar@bar.intranet.mysql.r18.ru
3cfbe36adc After merge fix 2006-10-03 16:00:09 +05:00
bar@mysql.com/bar.intranet.mysql.r18.ru
15887b602b Bug#19960 Inconsistent results when joining InnoDB tables using partial UTF8 indexes
Adding a multibyte-aware VARCHAR copying function, to put correct column prefix,
  taking in account number of characters (instead just limiting on number of bytes).
  For example, for a KEY(col(3)) on a UTF8 column when copying the string 'foo bar foo',
  we should put only 3 leftmost characters: 'foo'.
  9 characters were incorrectly put before this fix.
2006-09-29 16:15:57 +05:00
kostja@bodhi.local
f536f361d9 Merge bodhi.local:/opt/local/work/tmp_merge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge-5.0
2006-07-15 01:04:51 +04:00
kroki@mysql.com
96bddcafe7 Bug#17226: Variable set in cursor on first iteration is assigned
second iterations value

During assignment to the BLOB variable in routine body the value
wasn't copied.
2006-06-30 18:14:22 +04:00
knielsen@mysql.com
a061c90d8a Merge mysql.com:/usr/local/mysql/tmp_merge
into  mysql.com:/usr/local/mysql/merge-5.1
2006-05-18 11:56:50 +02:00
anozdrin@mysql.com
65b87b86a3 Fix for BUG#18587: Function that accepts and returns TEXT
garbles data if longer than 766 chars.

The problem is that a stored routine returns BLOBs to the previous
caller, BLOBs are shallow-copied (i.e. only pointers to the data are
copied). The fix is to also copy data of BLOBs.
2006-05-10 23:16:30 +04:00
jani@ibmlab.site
18b2c36d3e Re commit of previous fix as the bk tree was broken. 2006-03-14 17:46:25 +02:00
pem@mysql.com
015ab71a50 Merge mysql.com:/extern/mysql/5.0/bug17476/mysql-5.0
into  mysql.com:/extern/mysql/5.1/generic/mysql-5.1-new
2006-03-03 12:03:27 +01:00
cmiller@zippy.(none)
5147bb8e9b Expanding a binary field should result in 0x00-filled positions, not 0x20
(ASCII space).  For Bug#16857.
2006-03-02 19:59:49 -05:00
gluh@eagle.intranet.mysql.r18.ru
21cc3ae561 Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
  Message is chenged from 'ER_WARN_NULL_TO_NOTNULL' to 'ER_BAD_NULL_ERROR'
2005-12-01 15:30:11 +04:00
ramil@mysql.com
986a51e447 a fix (bug #7589: Decimal types are ignored when updating data from another column). 2005-09-21 14:32:19 +05:00
monty@mishka.mysql.fi
f348f62cc3 Added option --valgrind-mysqltest to mysql-test-run
Added flag to Field::store(longlong) to specify if value is unsigned.
This fixes bug #12750: Incorrect storage of 9999999999999999999 in DECIMAL(19, 0)
Fixed warning from valgrind in CREATE ... SELECT
Fixed double free of mysql.options if reconnect failed
2005-09-14 01:41:44 +03:00
evgen@moonbone.local
eb6135a765 Fix bug #11398 Bug in field_conv() results in wrong result of join with index
When copying varchar fields with field_conv() it's not taken into account
that length_bytes of source and destination fields may be different.
This results in saving wrong data in field and making wrong key later.

Added check so if fields are varchar and have different length_bytes they
are not copied by memcpy().
2005-08-16 22:13:43 +04:00
jimw@mysql.com
63c6ece728 Cleanups after merge from 4.1. 2005-07-19 16:32:38 -07:00
jimw@mysql.com
80c1c6b33f Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-07-19 11:05:49 -07:00
monty@mishka.local
7e83d09ce7 Simple fixes during review of new code 2005-07-19 19:25:05 +03:00
bar@mysql.com
2204effda1 Merge mysql.com:/usr/home/bar/mysql-4.1
into  mysql.com:/usr/home/bar/mysql-5.0
2005-07-12 13:18:25 +05:00