Commit graph

1429 commits

Author SHA1 Message Date
Sergei Golubchik
0b9a0a3517 5.5 merge 2014-02-25 16:04:35 +01:00
Sergey Vojtovich
d12c7adf71 MDEV-5314 - Compiling fails on OSX using clang
This is port of fix for MySQL BUG#17647863.

revno: 5572
revision-id: jon.hauglid@oracle.com-20131030232243-b0pw98oy72uka2sj
committer: Jon Olav Hauglid <jon.hauglid@oracle.com>
timestamp: Thu 2013-10-31 00:22:43 +0100
message:
  Bug#17647863: MYSQL DOES NOT COMPILE ON OSX 10.9 GM

  Rename test() macro to MY_TEST() to avoid conflict with libc++.
2014-02-19 14:05:15 +04:00
Sergei Golubchik
84651126c0 MySQL-5.5.36 merge
(without few incorrect bugfixes and with 1250 files where only a copyright year was changed)
2014-02-17 11:00:51 +01:00
Michael Widenius
313f18be5a Fixed errors and warnings found by buildbot
mysql-test/r/lowercase_table2.result:
  Updated result
  (The change happend because we don't try to open the table anymore as part of create table)
mysql-test/suite/rpl/r/create_or_replace_mix.result:
  Fixed result file
mysql-test/suite/rpl/r/create_or_replace_row.result:
  Fixed result file
mysql-test/suite/rpl/r/create_or_replace_statement.result:
  Fixed result file
mysql-test/suite/rpl/t/create_or_replace.inc:
  Drop open temporary table
mysys/my_delete.c:
  Added missing newline
plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/user_lock.result:
  Fixed result
  (Lock names was before off by one. Was corrected by my previous patch)
sql/sql_select.cc:
  Fixed compiler warnings by adding missing casts
storage/connect/ha_connect.cc:
  Fixed compiler warnings
storage/innobase/os/os0file.cc:
  Fixed compiler warnings
storage/xtradb/btr/btr0btr.cc:
  Fixed compiler warnings
storage/xtradb/handler/ha_innodb.cc:
  removed not used function
strings/ctype-uca.c:
  Fixed compiler warnings
support-files/compiler_warnings.supp:
  Added suppression for warnings that are wrong or are not serious andthat we don't plan to fix.
2014-02-06 16:14:09 +02:00
Sergei Golubchik
72c20282db 10.0-base merge 2014-02-03 15:22:39 +01:00
Sergei Golubchik
59d9d08e2b 5.5 merge 2014-02-01 00:54:03 +01:00
Sergei Golubchik
37d240ecf9 MySQL-5.5.35 merge 2014-01-22 15:29:36 +01:00
Venkata Sidagam
ff6b117c36 Bug #17760379 COLLATIONS WITH CONTRACTIONS BUFFER-OVERFLOW THEMSELVES IN THE FOOT
Description: A typo in create_tailoring() causes the "contraction_flags" to be written
into cs->contractions in the wrong place. This causes two problems:
(1) Anyone relying on `contraction_flags` to decide "could this character be
part of a contraction" is 100% broken.
(2) Anyone relying on `contractions` to determine the weight of a contraction
is mostly broken

Analysis: When we are preparing the contraction in create_tailoring(), we are corrupting the 
cs->contractions memory location which is supposed to store the weights(8k) + contraction information(256 bytes). We started storing the contraction information after the 4k location. This is because of logic flaw in the code.

Fix: When we create the contractions, we need to calculate the contraction with (char*) (cs->contractions + 0x40*0x40) from ((char*) cs->contractions) + 0x40*0x40. This makes the "cs->contractions" to move to 8k bytes and stores the contraction information from there. Similarly when we are calculating it for like range queries we need to calculate it from the 8k bytes onwards, this can be done by changing the logic to (const char*) (cs->contractions + 0x40*0x40). And for ucs2 charsets we need to modify the my_cs_can_be_contraction_head() and my_cs_can_be_contraction_tail() to point to 8k+ locations.
2014-01-11 14:48:29 +05:30
Murthy Narkedimilli
c92223e198 Updated/added copyright headers 2014-01-06 10:52:35 +05:30
Alexander Barkov
a6e5ac2279 MDEV-4929 Myanmar collation 2013-12-20 12:42:33 +04:00
Alexander Barkov
9f4dd86c2e Merge 10.0-base->10.0 2013-12-17 17:28:48 +04:00
Alexander Barkov
768751c786 Merge 5.5->10.0-base 2013-12-17 16:23:08 +04:00
Alexander Barkov
dc407270a1 MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP
Fixed a wrong assertion.
2013-12-17 15:19:26 +04:00
Sergei Golubchik
d28d3ba40d 10.0-base merge 2013-12-16 13:02:21 +01:00
Sergei Golubchik
ab3604989c MDEV-4243 [PATCH] Warnings/errors while compiling with clang
fix the code to compile with clang. fix warnings too.

include/probes_mysql_nodtrace.h:
  clang++ doesn't like numeric _constants_ being used in ||
  (it suspects that the intention was | ). Boolean constants are ok.
sql/hostname.cc:
  only used in DBUG_ASSERT
sql/item.cc:
  str_to_time and str_to_datetime return bool, not MYSQL_TIMESTAMP_xxx
sql/item_func.cc:
  str_to_datetime_with_warn() returns bool, not MYSQL_TIMESTAMP_xxx
storage/cassandra/CMakeLists.txt:
  CMAKE_CXX_FLAGS can be empty
storage/connect/odbconn.cpp:
  HWND is void*
storage/connect/user_connect.h:
  deprecated on FreeBSD and unused anyway
storage/connect/value.cpp:
  bad characters inside. unused.
storage/spider/spd_trx.cc:
  clang++ warns that memset will also overwrite vtbl. it might be as well a good idea,
  as it asserts that the object will only be used as a storage.
  silence the warning.
2013-11-28 22:35:59 +01:00
Sergei Golubchik
c6d30805db 5.5 merge 2013-11-23 00:50:54 +01:00
Alexander Barkov
9ac1130e13 An upstream bug fixed:
"mtr ctype_ldml" failed when compiled with "gcc -funsigned-char".
Changing the code not to depend on the signed/unsigned compiler defaults
for the "char" data type.
2013-12-11 12:30:12 +04:00
Alexander Barkov
0afd292073 Fixing an MSVC warning about double "const" data type qualifier
in the code merged from MySQL-5.6:

  const CHARSET_INFO* -> CHARSET_INFO*

(CHARSET_INFO already has the "const" qualifier in MariaDB, inlike in MySQL)
2013-12-05 16:54:50 +04:00
Sergei Golubchik
fa3f8a18b2 mysql-5.5.34 merge
(some patches reverted, test case added)
2013-11-19 13:16:25 +01:00
Alexander Barkov
fad7371191 Merging xxx_unicode_520_ci and xxx_vietnamese_ci from MySQL-5.6. 2013-11-12 16:48:57 +04:00
mithun
7c9112b9c7 Bug #14057034 : WASTED CPU CYCLES IN MY_UTF8_UNI WHERE
RESULTING MY_WC_T RESULT IS NOT USED
Issue         : handler functions my_ismbchar_utf8,
              my_well_formed_len_mb for charset utf8
              is calling unicode converion function
              to validate and to find the character
              length. Because of this, instructions
              which will convert the utf8 to unicode
              are executed for no use.
              A similar issue exist with charset utf8mb4
Solution      : reorganized the code such that character
              validation part of unicode conversion
              handler is extracted(duplicated) in to
              separate function. Hence
              my_ismbchar_utf8, my_well_formed_len_mb
              will call the new function which only
              validates and return the length of mb(utf8).
              A similar fix for charset utf8mb4.

strings/ctype-utf8.c:
  New functions has been added for charset utf8 and utf8mb4
  to validate and to get the length of the character.
2013-11-12 16:42:46 +05:30
Michael Widenius
192678e7bf MDEV-5241: Collation incompatibilities with MySQL-5.6
- Character set code & tests from Alexander Barkov
- Integration with ALTER TABLE, REPAIR and open_table from Monty

The problem was that MySQL 5.6 added some croatian and vitanamese character set collations that are incompatible with MariaDB.

The fix is to move the MariaDB conflicting collation numbers out of the region that MySQL is likely to use.
mysql_upgrade, REPAIR TABLE or ALTER TABLE will fix the collations.
If one tries to access and old incompatible table, one will get the error "Table upgrade required...."
After this patch, MariaDB supports all the MySQL character set collations and the old MariaDB croatian collations, which are closer to the latest standard than the MySQL versions.

New character sets:
ucs2_croatian_mysql561_uca_ci
utf8_croatian_mysql561_uca_ci
utf16_croatian_mysql561_uca_ci
utf32_croatian_mysql561_uca_ci
utf8mb4_croatian_mysql561_uca_ci

Other things:
- Fixed some compiler warnings
- mysql_upgrade prints information about repaired tables.
- Increased version number

VERSION:
  Increased VERSION number
client/mysqlcheck.c:
  Print repaired table name when using --verbose
include/m_ctype.h:
  Add new MariaDB collation regions that are not likely to conflict with MySQL
include/my_base.h:
  Added flag to detect if table was opened for ALTER TABLE
mysql-test/r/ctype_ldml.result:
  Updated result
mysql-test/r/ctype_uca.result:
  Updated result
mysql-test/r/ctype_upgrade.result:
  Updated result
mysql-test/r/ctype_utf16_uca.result:
  Updated result
mysql-test/r/ctype_utf32_uca.result:
  Updated result
mysql-test/r/ctype_utf8mb4_uca.result:
  Updated result
mysql-test/std_data/ctype_upgrade:
  Test files for testing upgrading of conflicting collations
mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result:
  New collations added
mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result:
  New collations added
mysql-test/suite/innodb/r/innodb_ctype_ldml.result:
  Updated test result
mysql-test/suite/innodb/t/innodb_ctype_ldml.test:
  Updated test result
mysql-test/suite/plugins/r/show_all_plugins.result:
  Updated version number
mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result:
  Updated version number
mysql-test/t/ctype_ldml.test:
  Updated test
mysql-test/t/ctype_uca.test:
  Testing of new collations
mysql-test/t/ctype_upgrade.test:
  Testing of upgrading tables with old collations
  The test ensures that:
  - We will get an error if we try to open a table with old collations.
  - CHECK TABLE will detect that the table needs to be upgraded.
  - ALTER TABLE and REPAIR will fix the table.
  - mysql_upgrade works as expected
mysql-test/t/ctype_utf16_uca.test:
  Testing of new collations
mysql-test/t/ctype_utf32_uca.test:
  Testing of new collations
mysql-test/t/ctype_utf8mb4_uca.test:
  Testing of new collations
mysys/charset-def.c:
  Added new character sets
mysys/charset.c:
  Always give an error, if requested, if a character set didn't exist
sql/handler.cc:
  - Added upgrade_collation() to check if collation is compatible with old version
  - check_collation_compatibility() checks if we are using an old collation from MariaDB 5.5 or MySQL 5.6
  - ha_check_for_upgrade() returns HA_ADMIN_NEEDS_ALTER if we have an incompatible collation
sql/handler.h:
  Added new prototypes
sql/sql_table.cc:
  - Mark that tables are opened for ALTER TABLE
  - If table needs to be upgraded, ensure we are not using online alter table.
sql/table.cc:
  - If we are using an old incompatible collation, change to use the new one and mark table as incompatible.
  - Give an error if we try to open an incompatible table.
sql/table.h:
  Added error that table needs to be rebuild
storage/connect/ha_connect.cc:
  Fixed compiler warning
strings/ctype-uca.c:
  New character sets
2013-11-09 00:20:07 +02:00
Neeraj Bisht
88680a99c6 Bug#16691598 - ORDER BY LOWER(COLUMN) PRODUCES OUT-OF-ORDER RESULTS
Problem:-
We have created a table with UTF8_BIN collation.
In case, when in our query we have ORDER BY clause over a function 
call we are getting result in incorrect order.
Note:the bug is not there in 5.5.

Analysis:
In 5.5, for UTF16_BIN, we have min and max multi-byte length is 2 and 4 
respectively.In make_sortkey(),for 2 byte character character we are 
assuming that the resultant length will be 2 byte/character. But when we 
use my_strnxfrm_unicode_full_bin(), we store sorting weights using 3 bytes 
per character.This result in truncated result.

Same thing happen for UTF8MB4, where we have 1 byte min multi-byte and 
4 byte max multi-byte.We will accsume resultant data as 1 byte/character, 
which result in truncated result.

Solution:-
use strnxfrm(means use of MY_CS_STRNXFRM macro) is used for sort, in 
which the resultant length is not dependent on source length.
2013-11-07 16:46:24 +05:30
Alexander Barkov
bd3dc54261 A few minor Unicode collation customization improvements were made,
which makes it possible to add more world language collations
with very complex collation rules (e.g. Myanmar):
- Weight string for a single character in a user defined collation
  was erroneously limited to 7 weights (instead of 8 weights).
  Added an extra element in the user-defined weight arrays,
  to fit 8 non-zero weights.
- Weight string limit for contractions was made two times longer (16 weights),
  which allows longer contractions without affecting the performance
  of filesort.
- A user-defined collation now refuses to initialize and reports an error
  in case if a weight string gets longer than 8 weights for a single character,
  or longer than 16 weights for a contraction. Previously weight strings
  for such characters (and contractions) were cut, so a collation
  could silently start with wrong rules.
- Fixed a bug in handling rules like "&a << b" in combination with
  shift-after-method="expand". The primary weight for "b" was not
  correctly calculated, which erroneously made "b" primary greater than "a"
  instead of primary equal to "a".
2013-10-31 14:24:24 +04:00
Alexander Barkov
71f8ca654e MDEV-5180 Data type for WEIGHT_STRING is too short in some cases
(a bug in upstream)
2013-10-25 15:01:03 +04:00
Sreedhar.S
c8c948ffa6 Bug 13878021 - WINDOWS PACKAGE THAT INCLUDES .PDB FILES FOR INTERMEDIATE LIBRARIES USED 2013-10-09 11:10:46 +05:30
Alexander Barkov
426d246f5b MDEV-5163 Merge WEIGHT_STRING function from MySQL-5.6 2013-10-23 20:25:52 +04:00
Alexander Barkov
0b6c4bb34f MDEV-4928 Merge collation customization improvements
Merging the following MySQL-5.6 changes:
- WL#5624: Collation customization improvements
  http://dev.mysql.com/worklog/task/?id=5624

- WL#4013: Unicode german2 collation
  http://dev.mysql.com/worklog/task/?id=4013

- Bug#62429 XML: ExtractValue, UpdateXML max arg length 127 chars
  http://bugs.mysql.com/bug.php?id=62429
  (required by WL#5624)
2013-10-02 15:04:07 +04:00
Sergei Golubchik
9af177042e 10.0-base merge.
Partitioning/InnoDB changes are *not* merged (they'll come from 5.6)
TokuDB does not compile (not updated to 10.0 SE API)
2013-09-21 10:14:42 +02:00
Sergei Golubchik
4ec2e9d7ed 5.5 merge and fixes for compiler/test errors 2013-09-18 13:07:31 +02:00
Tor Didriksen
d4ccf905be Bug#16765410 FTS: STACK AROUND THE VARIABLE 'MYSTR' WAS CORRUPTED IN INNOBASE_STRNXFRM
my_strnxfrm_win1250ch could write into dest[destlen]
i.e. write a byte to the past-the-end of dest.
2013-09-17 12:43:34 +02:00
Sergei Golubchik
b838d081ad mysql-5.5.33 merge 2013-09-06 22:31:30 +02:00
Alexander Barkov
4d15abf25a MDEV-4786 merge 10.0-monty > 10.0
Workaround for a possible GCC bug happening in my_fill_ucs2:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58039

Commenting out the optimized loop.
Using the original MySQL version.

modified:
  strings/ctype-ucs2.c
2013-08-02 13:36:25 +04:00
Joao Gramacho
b79864ae31 Bug#16997513 MY_STRTOLL10 ACCEPTING OVERFLOWED UNSIGNED LONG LONG VALUES AS NORMAL ONES
Merge from mysql-5.1 into mysql-5.5
2013-07-31 17:59:06 +01:00
Joao Gramacho
e5a1966bca Bug#16997513 MY_STRTOLL10 ACCEPTING OVERFLOWED UNSIGNED LONG LONG VALUES AS NORMAL ONES
Problem:
=======
It was detected an incorrect behavior of my_strtoll10 function when 
converting strings with numbers in the following format:
"184467440XXXXXXXXXYY"

Where XXXXXXXXX > 737095516 and YY <= 15

Samples of problematic numbers:
"18446744073709551915"
"18446744073709552001"

Instead of returning the larger unsigned long long value and setting overflow
in the returned error code, my_strtoll10 function returns the lower 64-bits 
of the evaluated number and did not set overflow in the returned error code.

Analysis:
========
Once trying to fix bug 16820156, I've found this bug in the overflow check of
my_strtoll10 function.

This function, once receiving a string with an integer number larger than
18446744073709551615 (the larger unsigned long long number) should return the
larger unsigned long long number and set overflow in the returned error code.

Because of a wrong overflow evaluation, the function didn't catch the
overflow cases where (i == cutoff) && (j > cutoff2) && (k <= cutoff3). When
the overflow evaluation fails, the function return the lower 64-bits of the
evaluated number and do not set overflow in the returned error code.

Fix:
===
Corrected the overflow evaluation in my_strtoll10.
2013-07-31 17:54:40 +01:00
Sergei Golubchik
b7b5f6f1ab 10.0-monty merge
includes:
* remove some remnants of "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING"
* introduce LOCK_share, now LOCK_ha_data is strictly for engines
* rea_create_table() always creates .par file (even in "frm-only" mode)
* fix a 5.6 bug, temp file leak on dummy ALTER TABLE
2013-07-21 16:39:19 +02:00
Sergei Golubchik
5f6380adde 10.0-base merge 2013-07-18 16:46:57 +02:00
Sergei Golubchik
97e640b9ae 5.5 merge 2013-07-17 21:24:29 +02:00
Sergei Golubchik
005c7e5421 mysql-5.5.32 merge 2013-07-16 19:09:54 +02:00
Vladislav Vaintroub
36519b8a83 Fix compiler warning - using "const" twice for CHARSET_INFO.
CHARSET_INFO is already typedef'ed as "const" strúcture, thus "const CHARSET_INFO"  generates  multiple type modifier warning.
2013-07-13 15:13:24 +02:00
Venkata Sidagam
ae59c57758 Bug #16567381 DATETIME FIELD COMPARISONS DO NOT WORK PROPERLY
WITH UTF8_UNICODE_CI COLLATION
Problem Description:
When comparing datetime values with strings, the utf8_unicode_ci collation 
prevents correct comparisons. Consider the below set of queries, it is not 
showing any results on a table which has tuples that satisfies the query. 
But for collation utf8_general_ci it shows one tuple.
set names utf8 collate utf8_unicode_ci;;
select * from lang where dt='1979-12-09';

Analysis:
The comparison function is not chosen in case of collation utf8_unicode_ci.
In agg_item_set_converter() because the collation state is having 
"MY_CS_NONASCII" for collation type "utf8_unicode_ci". The conversion 
of the collation is happening for the date field. And because of that 
it is unable to pickup proper compare function(i.e CMP_DATE_WITH_STR).

Actually the bug is accidentally introduced by the WL#3759 in 5.5. 
And in 5.6 it is been fixed by the WL#3664.

Fix:
I have backported the changes from the file strings/ctype-uca.c which 
are related to "utf8" introduced by the WL#3664.
This change helps in choosing the correct comparison function for all 
the collations of utf8 charset.
2013-07-04 16:59:09 +05:30
Michael Widenius
ecf9b1b754 Fixed some wrong format strings.
Fixed OPTIMIZE with innodb


include/my_sys.h:
  Removed ATTRIBUTE_FORMAT() as it gave warnings for %'s
sql/log_event.cc:
  Optimization: 
  use my_b_write() and my_b_write_byte() instead of my_b_printf()
  use strmake() instead of my_snprintf()
sql/sql_admin.cc:
  Fixed bug in admin_recreate_table()
  Fixed OPTIMIZE with innodb
sql/sql_table.cc:
  Indentation fixes
strings/my_vsnprintf.c:
  Changed fprintf() to fputs()
2013-06-28 01:53:41 +03:00
Tor Didriksen
45f739bd9d Bug#14834378 ADDRESSSANITIZER BUG IN FILENAME_TO_TABLENAME
Backport to 5.5


sql/sql_table.cc:
  gcc asan crashes in filename_to_tablename() on this: memcmp("-@", "#sql", 4)
  during loading of the innobase plugin
2013-06-14 16:38:27 +02:00
Sergei Golubchik
72ba95873a 10.0-base merge
(without InnoDB - all InnoDB changes were ignored)
2013-06-06 21:32:29 +02:00
Sergei Golubchik
4749d40c63 5.5 merge 2013-06-06 17:51:28 +02:00
Chaithra Gopalareddy
0c903fb5c9 Bug#11766191:INVALID MEMORY READ IN DO_DIV_MOD WITH DOUBLY ASSIGNED VARIABLES
Bug#12608543: CRASHES WITH DECIMALS AND STATEMENT NEEDS TO BE REPREPARED ERRORS

Backporting these two fixes to 5.1 
Added unittest to test my_decimal construtor and assignment operators

sql/my_decimal.h:
  Added constructor and assignment operators for my_decimal
unittest/my_decimal/my_decimal-t.cc:
  Added test to check constructor and assignment operators for my_decimal
2013-05-22 14:36:43 +05:30
Sergei Golubchik
b381cf843c mysql-5.5.31 merge 2013-05-07 13:05:09 +02:00
Sergei Golubchik
a9035be5b7 10.0-base merge 2013-04-15 15:09:22 +02:00
Sergei Golubchik
f57ecb7786 5.5 merge 2013-04-14 10:04:07 +02:00
Sergei Golubchik
ce926c90ac 5.3 merge 2013-04-12 01:01:18 +02:00
Sergei Golubchik
ea4a417a8d 5.2 merge 2013-04-11 19:35:39 +02:00
Sergei Golubchik
61ed0ebe73 5.1 merge 2013-04-11 19:30:59 +02:00
Sergei Golubchik
4ec6fe10e5 remove ULL() and LL(), because they're totally unnecessary
and sometimes harmful (used with expressions)
2013-04-07 14:00:16 +02:00
Sergei Golubchik
7b55b59b57 MDEV-4244 [PATCH] Buffer overruns and use-after-free errors
fixes for gcc 4.8 - compilation warnings and -fsanitize=address
2013-04-06 21:29:12 +02:00
Sergei Golubchik
2901497b18 MDEV-4243 Warnings/errors while compiling with clang 2013-03-28 20:04:14 +01:00
Alexander Barkov
d1e162e011 Merging utf16le from MySQL-5.6
added:
  mysql-test/include/ctype_heap.inc
  mysql-test/include/ctype_strtoll10.inc
  mysql-test/r/ctype_utf16le.result
  mysql-test/t/ctype_utf16le.test
modified:
  cmake/character_sets.cmake
  include/m_ctype.h
  mysql-test/r/ctype_ucs.result
  mysql-test/r/ctype_utf16.result
  mysql-test/r/ctype_utf32.result
  mysql-test/suite/funcs_1/r/innodb_func_view.result
  mysql-test/suite/funcs_1/r/memory_func_view.result
  mysql-test/suite/funcs_1/r/myisam_func_view.result
  mysql-test/suite/sys_vars/r/character_set_client_basic.result
  mysql-test/suite/sys_vars/r/character_set_connection_basic.result
  mysql-test/suite/sys_vars/r/character_set_database_basic.result
  mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result
  mysql-test/suite/sys_vars/r/character_set_results_basic.result
  mysql-test/t/ctype_ucs.test
  mysql-test/t/ctype_utf16.test
  mysql-test/t/ctype_utf32.test
  mysys/charset-def.c
  sql/item_func.cc
  sql/sys_vars.cc
  strings/ctype-latin1.c
  strings/ctype-ucs2.c
2013-03-28 17:19:09 +04:00
Sergei Golubchik
993ea79f2d 5.5 merge 2013-03-27 23:41:02 +01:00
Michael Widenius
068c61978e Temporary commit of 10.0-merge 2013-03-26 00:03:13 +02:00
Murthy Narkedimilli
8afe262ae5 Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 15:53:48 +01:00
Murthy Narkedimilli
fe85f54640 Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 13:29:12 +01:00
Alexander Barkov
f5c3c2855d Performance improvements in "from latin1" and "to utf8" conversion.
Mini-benchmarking demonstrates up to 10% improvement in latin1->utf8
conversion.

modified:
  @ strings/ctype-latin1.c
  redundant test in ctype-latin1.c removed

  @ strings/ctype-utf8.c
  my_uni_utf8 rewritten in a more efficient way
2013-03-12 18:33:19 +04:00
unknown
108a0a1823 MDEV-4241 fix.
Field_enum incorrectly inherited decimals() from Field_string.
Field_enum should be always integer in numeric context.
2013-03-06 21:10:58 +02:00
Sergei Golubchik
8dad7dfa6a 5.3->5.5 merge 2013-03-10 12:46:56 +01:00
Sergei Golubchik
8161c6772d merge with mysql-5.5.30 minus few incorrect or not applicable changesets 2013-02-28 18:42:49 +01:00
Murthy Narkedimilli
053d7e775c Updated/added copyright headers. 2013-02-25 15:26:00 +01:00
Sergei Golubchik
ab83952f29 10.0-base merge 2013-01-31 09:48:19 +01:00
Mattias Jonsson
d92a7cb76a Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING
Due to an internal change in the server code in between 5.1 and 5.5
(wl#2649) the hash function used in KEY partitioning changed
for numeric and date/time columns (from binary hash calculation
to character based hash calculation).

Also enum/set changed from latin1 ci based hash calculation to
binary hash between 5.1 and 5.5. (bug#11759782).

These changes makes KEY [sub]partitioned tables on any of
the affected column types incompatible with 5.5 and above,
since the calculation of partition id differs.

Also since InnoDB asserts that a deleted row was previously
read (positioned), the server asserts on delete of a row that
is in the wrong partition.

The solution for this situation is:

1) The partitioning engine will check that delete/update will go to the
partition the row was read from and give an error otherwise, consisting
of the rows partitioning fields. This will avoid asserts in InnoDB and
also alert the user that there is a misplaced row. A detailed error
message will be given, including an entry to the error log consisting
of both table name, partition and row content (PK if exists, otherwise
all partitioning columns).


2) A new optional syntax for KEY () partitioning in 5.5 is allowed:
[SUB]PARTITION BY KEY [ALGORITHM = N] (list_of_cols)
Where N = 1 uses the same hashing as 5.1 (Numeric/date/time fields uses
binary hashing, ENUM/SET uses charset hashing) N = 2 uses the same
hashing as 5.5 (Numeric/date/time fields uses charset hashing,
ENUM/SET uses binary hashing). If not set on CREATE/ALTER it will
default to 2.

This new syntax should probably be ignored by NDB.


3) Since there is a demand for avoiding scanning through the full
table, during upgrade the ALTER TABLE t PARTITION BY ... command is
considered a no-op (only .frm change) if everything except ALGORITHM
is the same and ALGORITHM was not set before, which allows manually
upgrading such table by something like:
ALTER TABLE t PARTITION BY KEY ALGORITHM = 1 () or
ALTER TABLE t PARTITION BY KEY ALGORITHM = 2 ()


4) Enhanced partitioning with CHECK/REPAIR to also check for/repair
misplaced rows. (Also works for ALTER TABLE t CHECK/REPAIR PARTITION)

CHECK FOR UPGRADE:
If the .frm version is < 5.5.3
and uses KEY [sub]partitioning
and an affected column type
then it will fail with an message:
KEY () partitioning changed, please run:
ALTER TABLE `test`.`t1`  PARTITION BY KEY ALGORITHM = 1 (a)
PARTITIONS 12
(i.e. current partitioning clause, with the addition of
ALGORITHM = 1)

CHECK without FOR UPGRADE:
if MEDIUM (default) or EXTENDED options are given:
Scan all rows and verify that it is in the correct partition.
Fail for the first misplaced row.

REPAIR:
if default or EXTENDED (i.e. not QUICK/USE_FRM):
Scan all rows and every misplaced row is moved into its correct
partitions.


5) Updated mysqlcheck (called by mysql_upgrade) to handle the
new output from CHECK FOR UPGRADE, to run the ALTER statement
instead of running REPAIR.

This will allow mysql_upgrade (or CHECK TABLE t FOR UPGRADE) to upgrade
a KEY [sub]partitioned table that has any affected field type
and a .frm version < 5.5.3 to ALGORITHM = 1 without rebuild.


Also notice that if the .frm has a version of >= 5.5.3 and ALGORITHM
is not set, it is not possible to know if it consists of rows from
5.1 or 5.5! In these cases I suggest that the user does:
(optional)
LOCK TABLE t WRITE;
SHOW CREATE TABLE t;
(verify that it has no ALGORITHM = N, and to be safe, I would suggest
backing up the .frm file, to be used if one need to change to another
ALGORITHM = N, without needing to rebuild/repair)
ALTER TABLE t <old partitioning clause, but with ALGORITHM = N>;
which should set the ALGORITHM to N (if the table has rows from
5.1 I would suggest N = 1, otherwise N = 2)
CHECK TABLE t;
(here one could use the backed up .frm instead and change to a new N
and run CHECK again and see if it passes)
and if there are misplaced rows:
REPAIR TABLE t;
(optional)
UNLOCK TABLES;
2013-01-30 17:51:52 +01:00
Sergei Golubchik
0af4b6c6ee 5.5 merge 2013-01-29 15:10:47 +01:00
Sergei Golubchik
fa2e68aaa4 main.partition_myisam crashes in embedded.
long error message with %M fails the assertion in my_vsnprintf
2013-01-23 19:17:13 +01:00
Michael Widenius
c4e00d03e7 Fixed compiler warning 2013-01-17 01:08:49 +02:00
Neeraj Bisht
84d798a1d5 BUG#14303860 - EXECUTING A SELECT QUERY WITH TOO
MANY WILDCARDS CAUSES A SEGFAULT
      Back port from 5.6 and trunk
2013-01-14 16:51:52 +05:30
Neeraj Bisht
99645e5be5 BUG#14303860 - EXECUTING A SELECT QUERY WITH TOO
MANY WILDCARDS CAUSES A SEGFAULT

Back port from 5.6 and trunk
2013-01-14 14:59:48 +05:30
Vladislav Vaintroub
d8acafcbf2 MDEV-4020 : Make sure strmov symbol is exported by client library on Linux (even if the server and libraries itself use stpcpy instead of it)
It is a workaround that allows myodbc built by certain distributions' (CentOS,Fedora) to peacefully coexist with mariadb client libraries.
The problem is that MyODBC in these distros needs strmov() to be exported by mysql client shared library, or else myodbc fails to load.
2013-01-11 12:44:21 +01:00
unknown
701419b02f Merge MariaDB 10.0-base to MariaDB 10.0 2012-12-18 15:01:58 +01:00
Igor Babaev
7760efad74 Merge mariadb-5.5 -> 10.0-base. 2012-12-16 16:49:19 -08:00
Tor Didriksen
8cd6099371 Bug#15960005 VALGRIND WARNINGS IN PROCESS_ARGS
Both <width> and <precision> can be specified as numbers or '*'.
  If an asterisk is used, an argument of type int is consumed.
2012-12-10 09:55:08 +01:00
Tor Didriksen
6cbbe2392f Bug#11754279 SIGNIFICANT INACCURACY IN DECIMAL MULTIPLICATION CALCULATIONS
frac is the number of decimal digits after the point
For each multiplication in the expression, decimal_mul() does this:
  to->frac= from1->frac + from2->frac;              /* store size in digits */
which will eventually overflow.
The code for handling the overflow, will truncate the two digits in "1.75" to "1"

Solution:
Truncate to 31 significant fractional digits, when doing decimal multiplication.
2012-11-29 17:21:36 +01:00
Sergei Golubchik
a48a91d90f 5.3->5.5 merge 2012-11-22 10:19:31 +01:00
Sergei Golubchik
13ba0dd286 MDEV-736 LP:1004615 - Unexpected warnings "Encountered illegal value '' when converting to DECIMAL" on a query with aggregate functions and GROUP BY
fix: don't call field->val_decimal() if the field->is_null()
because the buffer at field->ptr might not hold a valid decimal value

sql/item_sum.cc:
  do not call field->val_decimal() if the field->is_null()
storage/maria/ma_blockrec.c:
  cleanup
storage/maria/ma_rrnd.c:
  cleanup
strings/decimal.c:
  typo
2012-11-17 16:50:15 +01:00
Sergei Golubchik
3f1290340e correct truncation in my_vsnprintf %M format
(because of a width or a short buffer)
2012-10-25 19:16:18 +02:00
Michael Widenius
5eccc400b1 Implementation of Multi-source replication (MDEV:253)
Documentation of the feature can be found at: http://kb.askmonty.org/en/multi-source-replication/
This code is based on code from Taobao, developed by Plinux

Other things:
- Added new commands: START ALL SLAVES, STOP ALL SLAVES and SHOW FULL SLAVE STATUS
- Almost all usage of 'active_mi' is deleted.
- Added parameter to reset_logs() so that one can specify if new logs should be created.
- Check wildcard match as early as possible for SHOW STATUS. This makes SHOW STATUS like 'xxx' a lot faster and use less mutex
- Made max_relay_log_size depending on master connection.
- Added sys_vars.default_master_connection_basic to fix a failure in sys_vars.all_vars, modified sql_slave_skip_counter_basic to allow session-level settings
- Added commands to mysqladmin: start-all-slaves & stop-all-slaves
- Removed logging of "next log '%s' is currently active | not active"
- Fixed bug in my_vsnprintf() when using positional parameters with length
- Added fn_ext2(), which returns pointer to last '.' in file name
- max_relay_log_size now acts as a normal slave specific variable
- Don't store replication position if innobase_overwrite_relay_log_info is not set
- max_relay_log_size copies it's values from max_binlog_size at startup



BUILD/SETUP.sh:
  Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it)
client/mysqladmin.cc:
  Added commands start-all-slaves & stop-all-slaves
client/mysqltest.cc:
  Added support for error names starting with 'W'
  Added connection_name support to --sync_with_master
cmake/maintainer.cmake:
  Added -Wno-invalid-offsetof to get rid of warning of offsetof() on C++ class (safe in the contex we use it)
include/my_sys.h:
  Added fn_ext2(), which returns pointer to last '.' in file name
include/mysql/plugin.h:
  Added SHOW_SIMPLE_FUNC
include/mysql/plugin_audit.h.pp:
  Updated signature file
include/mysql/plugin_auth.h.pp:
  Updated signature file
include/mysql/plugin_ftparser.h.pp:
  Updated signature file
mysql-test/extra/rpl_tests/rpl_max_relay_size.test:
  Updated test
mysql-test/include/setup_fake_relay_log.inc:
  There is no orphan relay log files anymore
mysql-test/mysql-test-run.pl:
  Added multi_source to test suite
mysql-test/r/flush.result:
  Added test for new syntax of flush relay logs (can't repeat relay logs or slave)
mysql-test/r/mysqld--help.result:
  Updated result
mysql-test/r/mysqltest.result:
  Updated result
mysql-test/r/parser.result:
  Updated result
mysql-test/r/signal_code.result:
  Updated result after introducing new commands
mysql-test/r/sp-code.result:
  Updated result after introducing new commands
mysql-test/suite/multi_source:
  Tests for multi-source
mysql-test/suite/multi_source/info_logs-master.opt:
  Test with strange file names
mysql-test/suite/multi_source/info_logs.result:
  Test of logs
mysql-test/suite/multi_source/info_logs.test:
  Test of logs
mysql-test/suite/multi_source/my.cnf:
  Setup of multi-master tests
  Added log-warnings to get more information to the log files
mysql-test/suite/multi_source/relaylog_events.result:
  Test relay log handling
mysql-test/suite/multi_source/relaylog_events.test:
  Test relay log handling
mysql-test/suite/multi_source/reset_slave.result:
  Test RESET SLAVE
mysql-test/suite/multi_source/reset_slave.test:
  Test RESET SLAVE
mysql-test/suite/multi_source/simple.result:
  Simple basic test of multi-source functionality
mysql-test/suite/multi_source/simple.test:
  Simple basic test of multi-source functionality
mysql-test/suite/multi_source/skip_counter.result:
  Testing skip_counter and max_relay_log_size
mysql-test/suite/multi_source/skip_counter.test:
  Testing skip_counter and max_relay_log_size
mysql-test/suite/multi_source/syntax.result:
  Test of multi-source syntax
mysql-test/suite/multi_source/syntax.test:
  Test of multi-source syntax
mysql-test/suite/rpl/r/rpl_deadlock_innodb.result:
  New warnings
mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result:
  Improved error texts
mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result:
  Improved error texts
mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result:
  Improved error texts
mysql-test/suite/rpl/r/rpl_flush_logs.result:
  Update results
mysql-test/suite/rpl/r/rpl_heartbeat.result:
  Warning was removed
mysql-test/suite/rpl/r/rpl_heartbeat_basic.result:
  Warning was removed
mysql-test/suite/rpl/r/rpl_rotate_logs.result:
  Updated results because of new error messages
mysql-test/suite/rpl/r/rpl_row_max_relay_size.result:
  Updated results
mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result:
  Updated results after improved RESET SLAVE (we now use less relay log files)
mysql-test/suite/rpl/r/rpl_skip_replication.result:
  New error message
mysql-test/suite/rpl/r/rpl_start_slave_deadlock_sys_vars.result:
  Test removed as the old DBUG_SYNC entries doesn't exist anymore
mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result:
  Updated results
mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result:
  Updated results after improved RESET SLAVE (we now use less relay log files)
mysql-test/suite/rpl/t/rpl_flush_logs.test:
  Updated tests as relay log files is created a bit differently than before
mysql-test/suite/rpl/t/rpl_start_slave_deadlock_sys_vars.test:
  Test removed as the old DBUG_SYNC entries doesn't exist anymore
mysql-test/suite/sys_vars/r/default_master_connection_basic.result:
  New test to test usage of default_master_connection
mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result:
  Updated results
mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result:
  Updated usage of sql_slave_skip_counter
mysql-test/suite/sys_vars/t/default_master_connection_basic.test:
  New test to test usage of default_master_connection
mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test:
  Updated results
mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test:
  Updated test for multi-source
mysql-test/t/flush.test:
  Added test for new syntax of flush relay logs (can't repeat relay logs or slave)
mysql-test/t/parser.test:
  Updated test as master_pos_wait() now takes more arguments than before
mysys/mf_fn_ext.c:
  Added fn_ext2(), which returns pointer to last '.' in file name
plugin/semisync/semisync_master_plugin.cc:
  Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS
sql/event_scheduler.cc:
  No reason to initialize slave_thread (it's guaranteed to be zero here)
sql/item_create.cc:
  Added connection_name argument to master_pos_wait()
  Simplified code
sql/item_func.cc:
  Added connection_name argument to master_pos_wait()
sql/item_func.h:
  Added connection_name argument to master_pos_wait()
sql/lex.h:
  Added SLAVES keyword
sql/log.cc:
  Added tag "Master 'connection_name'" to slave errors that has a connection name.
  Added parameter to reset_logs() so that one can specify if new logs should be created.
  Removed some wrong casts
  Changed some constants to defines
sql/log.h:
  Added parameter to reset_logs()
  Updated comment to reflect new code
sql/log_event.cc:
  Updated DBUG_PRINT
sql/mysqld.cc:
  Added variable mysqld_server_initialized so that other functions can test if server is fully initialized.
  Free all slave data in one place (fewer ifdef's)
  Removed not needed call to close_active_mi()
  Initialize slaves() later in startup to ensure that everthing is really initialized when slaves start.
  Made status variable slave_running multi-source safe
  max_relay_log_size copies it's values from max_binlog_size at startup
  SHOW_FUNC -> SHOW_SIMPLE_FUNC
sql/mysqld.h:
  Added mysqld_server_initialized
  Removed max_relay_log_size
sql/rpl_mi.cc:
  Store connection name and cmp_connection_name (only used for show full slave status) in Master_info
  Added code for Master_info_index, which handles storage of multi-master information
  Don't write the empty "" connection_name to multi-master.info file. This is handled by the original code.
  Create Master_info_index::index_file_names once at init
  More DBUG_PRINT
  Give error if Master_info_index::check_duplicate_master_info fails
  Added start|stop all slaves
sql/rpl_mi.h:
  Added connection_name and Master_info_index
  Updated prototypes
sql/rpl_rli.cc:
  Added connection_name to relay log files.
  If we do a full reset, don't create any new relay log files.
  Updated comment to reflect new code
  Made max_relay_log_size depending on master connection.
sql/rpl_rli.h:
  Fixed type of slave_skip_counter as we now access it directly in sys_vars.cc, so it must be ulong
  Made executed_entries and max_relay_log_size depending on master connection.
sql/set_var.cc:
  Fixed that one can get variable name also when one uses DEFAULT
sql/set_var.h:
  Made option global so that one can check and change min & max values (sorry Sergei)
sql/share/errmsg-utf8.txt:
  Added new error messages needed for multi-source
  Added multi-source name to error ER_MASTER_INFO and WARN_NO_MASTER_INFO
  Improved error message if connection exists
sql/slave.cc:
  Moved things a bit around to make it easier to handle error conditions.
  Create a global master_info_index and add the "" connection to it
  Ensure that new Master_info doesn't fail.
  Don't call terminate_slave_threads(active_mi..) on end_slave() as this is now done automaticly when deleting master_info_index.
  Delete not needed function close_active_mi(). One can achive same thing by calling end_slave().
  Added support for SHOW FULL SLAVE STATUS (show status for all master connections with connection_name as first column)
  Removed logging of "next log '%s' is currently active | not active"
  Added Slave_received_heartbeats and Slave_heartbeat_period
sql/slave.h:
  Added new defines and prototypes
sql/sql_base.cc:
  More DBUG_PRINT
sql/sql_class.cc:
  Reset thd->connection_name and thd-->default_master_connection
sql/sql_class.h:
  Added thd->connection_name and thd-->default_master_connection
  Made slave_skip_count and max_relay_log_size depending on master connection. These variables are in THD to make changing them thread safe.
sql/sql_const.h:
  Added MAX_CONNECTION_NAME
sql/sql_insert.cc:
  thd->slave_thread -> thd->rli_slave
  Removed usage of active_mi
sql/sql_lex.cc:
  Reset 'lex->verbose' (to simplify some sql_yacc.yy code)
sql/sql_lex.h:
  Added connection_name, relay_log_connection_name, SQLCOM_SLAVE_ALL_START and SQLCOM_SLAVE_ALL_STOP
sql/sql_load.cc:
  thd->slave_thread -> thd->rli_slave
  Removed usage of active_mi
sql/sql_parse.cc:
  Added support for connection_name to all SLAVE commands.
  - Instead of using active_mi, we now get the current Master_info from master_info_index.
  - Create new replication threads with CHANGE MASTER
  - Added support for show_all_master_info()-
sql/sql_prepare.cc:
  Added SQLCOM_SLAVE_ALL_START and SQLCOM_SLAVE_ALL_STOP
sql/sql_reload.cc:
  Made reset/full slave use master_info_index->get_master_info() instead of active_mi.
  If one uses 'RESET SLAVE "connection_name" all' the connection is removed from master_info_index.
  Fixed issues with FLUSH RELAY LOGS
sql/sql_repl.cc:
  sql_slave_skip_counter is moved to thd->variables to make it thread safe and fix some bugs with it
  Add connection name to relay log files.
  Added connection name to errors.
  Added some logging for multi-master if log_warnings > 1
  stop_slave():
  - Don't check if thd is set. It's guaranteed to always be set.
  change_master():
  - Check for duplicate connection names in change_master()
  - Check for wrong arguments first in file (to simplify error handling)
  - Register new connections in master_info_index
  
  
  
  
  
  
  ******
  Added multi-source support to show relaylog events
  ******
  check_duplicate_master_info() now generates an error
  Added parameter to reset_logs()
  ******
  Updated calls to create_signed_file_name()
sql/sql_show.cc:
  Check wildcard match as early as possible for SHOW STATUS. This makes SHOW STATUS like 'xxx' a lot faster and use less mutex
sql/sql_yacc.yy:
  Added optional connection_name to a all relevant master/slave commands
  Added multi-source support to show relaylog events
  Added new commands START ALL SLAVES, STOP ALL SLAVES and SHOW FULL SLAVE STATUS
sql/strfunc.cc:
  my_global.h shoud always be included first.
sql/sys_vars.cc:
  Added variable default_master_connection
  Made variable sql_slave_skip_counter multi-source safe
  Made max_relay_log_size depending on master connection.
  Made old code more reusable
sql/sys_vars.h:
  Added Sys_var_session_lexstring (needed for default_master_connection)
  Added Sys_var_multi_source_uint (needed for sql_slave_skip_counter).
  Changed Sys_var_multi_source_uint to ulong to be able to handle max_relay_log_size
  Made old code more reusable
storage/example/ha_example.cc:
  Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS
storage/sphinx/ha_sphinx.cc:
  Use SHOW_SIMPLE_FUNC to optimize SHOW STATUS
storage/xtradb/handler/ha_innodb.cc:
  Don't store replication position if innobase_overwrite_relay_log_info is not set
strings/my_vsnprintf.c:
  Fixed bug when using positional parameters with length
2012-10-04 01:37:58 +03:00
unknown
ced3907c02 Merge from 5.3 2012-08-24 15:29:01 +02:00
unknown
fc666a0df6 merge from 5.2 2012-08-24 14:02:32 +02:00
unknown
96703a63da Merge from 5.1. 2012-08-24 12:32:46 +02:00
unknown
cdeabcfd43 MDEV-382: Incorrect quoting
Various places in the server replication code was incorrectly quoting
strings, which could lead to incorrect SQL on the slave/mysqlbinlog.
2012-08-24 10:06:16 +02:00
Michael Widenius
b886cac712 Fixed compiler errors
Updated test to also work on 32 bit

mysql-test/suite/heap/heap.test:
  Updated test to also work on 32 bit
2012-08-14 19:59:28 +03:00
Georgi Kodinov
048577429f Bug #13889741: HANDLE_FATAL_SIGNAL IN _DB_ENTER_ |
HANDLE_FATAL_SIGNAL IN STRNLEN

Fixed the following bounds checking problems :
1. in check_if_legal_filename() make sure the null terminated
string is long enough before accessing the bytes in it.
Prevents pottential read-past-buffer-end
2. in my_wc_mb_filename() of the filename charset check
for the end of the destination buffer before sending single
byte characters into it.
Prevents write-past-end-of-buffer (and garbaling stack in
the cases reported here) errors.

Added test cases.
2012-07-05 13:41:16 +03:00
Georgi Kodinov
5a496caeb5 merge 2012-07-05 14:41:04 +03:00
Michael Widenius
1999be8d4e Automatic merge with 5.5 2012-09-01 00:54:54 +03:00
Michael Widenius
9ebda8764d Fixes after Serg's review of %M extenstions
- Changed output to be error "error-text" instead of error - error-text


extra/perror.c:
  Move my_handler_errors.h into include
include/my_handler_errors.h:
  Move my_handler_errors.h into include
mysql-test/r/errors.result:
  Updated result
mysql-test/r/innodb_mysql_sync.result:
  Updated result
mysql-test/r/myisam-system.result:
  Updated result
mysql-test/r/myisampack.result:
  Updated result
mysql-test/r/partition_innodb_plugin.result:
  Updated result
mysql-test/r/ps_1general.result:
  Updated result
mysql-test/r/trigger.result:
  Updated result
mysql-test/r/type_bit.result:
  Updated result
mysql-test/r/type_bit_innodb.result:
  Updated result
mysql-test/r/type_blob.result:
  Updated result
mysql-test/suite/archive/archive.result:
  Updated result
mysql-test/suite/binlog/r/binlog_index.result:
  Updated result
mysql-test/suite/binlog/r/binlog_ioerr.result:
  Updated result
mysql-test/suite/csv/csv.result:
  Updated result
mysql-test/suite/engines/iuds/r/type_bit_iuds.result:
  Updated result
mysql-test/suite/federated/federated_bug_35333.result:
  Updated result
mysql-test/suite/innodb/r/innodb-create-options.result:
  Updated result
mysql-test/suite/innodb/r/innodb-index.result:
  Updated result
mysql-test/suite/innodb/r/innodb-zip.result:
  Updated result
mysql-test/suite/innodb/r/innodb.result:
  Updated result
mysql-test/suite/innodb/r/innodb_bug13635833.result:
  Updated result
mysql-test/suite/innodb/r/innodb_bug21704.result:
  Updated result
mysql-test/suite/innodb/r/innodb_bug46000.result:
  Updated result
mysql-test/suite/parts/r/partition_bit_innodb.result:
  Updated result
mysql-test/suite/parts/r/partition_bit_myisam.result:
  Updated result
mysql-test/suite/percona/percona_innodb_fake_changes.result:
  Updated result
mysql-test/suite/perfschema/r/misc.result:
  Updated result
mysql-test/suite/perfschema/r/privilege.result:
  Updated result
mysql-test/suite/rpl/r/rpl_EE_err.result:
  Updated result
mysql-test/suite/rpl/r/rpl_binlog_errors.result:
  Updated result
mysql-test/suite/rpl/r/rpl_drop_db.result:
  Updated result
sql/share/errmsg-utf8.txt:
  Removed 'column' from error text that was used in different context
strings/my_vsnprintf.c:
  Move my_handler_errors.h into include
  Minor cleanups
  Changed output of %M to be error "error-text" instead of error - error-text
unittest/mysys/my_vsnprintf-t.c:
  Updated error text
2012-06-17 15:34:39 +03:00
Michael Widenius
56ea8e9c05 Fixed build failures found by buildbot
- Added suppression of warnings
- Fixed some test cases


BUILD/FINISH.sh:
  Added AM_EXTRA_MAKEFLAGS
BUILD/SETUP.sh:
  Added option --extra-makeflags
client/mysqldump.c:
  Added suppression
mysql-test/r/mysql.result:
  Updated results
mysql-test/r/mysql_upgrade.result:
  Updated results
mysql-test/r/partition_innodb_plugin.result:
  Updated results
mysql-test/r/partition_open_files_limit.result:
  Updated results
mysql-test/r/symlink.result:
  Updated results
mysql-test/suite/innodb/r/innodb-create-options.result:
  Updated results
mysql-test/suite/innodb/t/innodb-create-options.test:
  Don't print error message (as it's varies on different system)
mysql-test/t/mysql.test:
  Don't print error message (as it's varies on different system)
mysql-test/t/mysql_upgrade.test:
  Fixed checking of error number
mysql-test/t/partition_innodb_plugin.test:
  Don't print error message (as it's varies on different system)
plugin/semisync/semisync_master.cc:
  Added suppression
sql/ha_partition.cc:
  Added suppression
sql/item_subselect.cc:
  Added suppression
sql/multi_range_read.cc:
  Added suppression
sql/sql_parse.cc:
  Added suppression
sql/sql_select.cc:
  Added suppression
storage/innobase/handler/ha_innodb.cc:
  Removed not used variable
storage/maria/ma_delete.c:
  Added suppression
storage/maria/ma_key_recover.c:
  Added suppression
storage/maria/ma_write.c:
  Added suppression
strings/ctype-ucs2.c:
  Added suppression
support-files/compiler_warnings.supp:
  Added suppressions
unittest/mysys/my_vsnprintf-t.c:
  Fixed test case with %M to also work on Solaris
2012-06-05 14:09:18 +03:00
Michael Widenius
aa81e025a8 Added text for errno in error messages by:
- Adding %M my_sprintf() modifier that prints error number - system-error-text
- Modified mysys, mysql_client and SQL error messages to use %M instead of %d
- Added my_strerror()
Updated handler errors to 5.6 error numbers
Updated text for a few error messages (to match 5.6)
Increased length of command name in error output

extra/comp_err.c:
  Added support for %M
include/my_base.h:
  Updated handler errors to 5.6 error numbers
include/my_sys.h:
  Added my_strerror()
libmysql/errmsg.c:
  Updated error messages to use %M
mysql-test/r/errors.result:
  Updated result as error message have changed
mysql-test/r/innodb_mysql_sync.result:
  Updated result with text for errno
mysql-test/r/myisam-system.result:
  Updated result with text for errno
mysql-test/r/myisam.result:
  Updated result as error message have changed
mysql-test/r/myisampack.result:
  Updated result with text for errno
mysql-test/r/mysql.result:
  Updated result with text for errno
mysql-test/r/mysql_upgrade.result:
  Updated result with text for errno
mysql-test/r/partition_datatype.result:
  Updated result as error message have changed
mysql-test/r/partition_innodb_plugin.result:
  Updated result with text for errno
mysql-test/r/ps_1general.result:
  Updated result with text for errno
mysql-test/r/trigger.result:
  Updated result with text for errno
mysql-test/r/type_bit.result:
  Updated result as error message have changed
mysql-test/r/type_bit_innodb.result:
  Updated result as error message have changed
mysql-test/r/type_blob.result:
  Updated result as error message have changed
mysql-test/suite/archive/archive.result:
  Updated result with text for errno
mysql-test/suite/binlog/r/binlog_index.result:
  Updated result with text for errno
mysql-test/suite/binlog/r/binlog_ioerr.result:
  Updated result with text for errno
mysql-test/suite/csv/csv.result:
  Updated result with text for errno
mysql-test/suite/federated/federated_bug_35333.result:
  Updated result with text for errno
mysql-test/suite/innodb/r/innodb-create-options.result:
  Updated result with text for errno
mysql-test/suite/innodb/r/innodb-index.result:
  Updated result with text for errno
mysql-test/suite/innodb/r/innodb-zip.result:
  Updated result as error message have changed
mysql-test/suite/innodb/r/innodb.result:
  Updated result with text for errno
mysql-test/suite/innodb/r/innodb_bug21704.result:
  Updated result with text for errno
mysql-test/suite/innodb/r/innodb_bug46000.result:
  Updated result with text for errno
mysql-test/suite/innodb/r/innodb_bug53591.result:
  Updated result as error message have changed
mysql-test/suite/innodb/r/innodb_corrupt_bit.result:
  New error numbers
mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result:
  Updated result as error message have changed
mysql-test/suite/innodb/t/innodb-create-options.test:
  Added regexp to avoid system error text
mysql-test/suite/innodb/t/innodb-zip.test:
  Added regexp to avoid system error text
mysql-test/suite/maria/maria-recovery2.result:
  Updated supression rule
mysql-test/suite/maria/maria-recovery2.test:
  Updated supression rule
mysql-test/suite/maria/maria.result:
  Updated result as error message have changed
mysql-test/suite/parts/r/partition_bit_innodb.result:
  
  Updated result as error message have changed
mysql-test/suite/parts/r/partition_bit_myisam.result:
  
  Updated result as error message have changed
mysql-test/suite/percona/percona_innodb_fake_changes.result:
  Updated result with text for errno
mysql-test/suite/perfschema/r/dml_cond_instances.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_events_waits_current.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_events_waits_history.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_events_waits_history_long.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_ews_by_instance.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_file_instances.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_mutex_instances.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_performance_timers.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_rwlock_instances.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_threads.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/misc.result:
  Updated result with text for errno
mysql-test/suite/perfschema/r/privilege.result:
  Updated result with text for errno
mysql-test/suite/rpl/r/rpl_EE_err.result:
  Updated result with text for errno
mysql-test/suite/rpl/r/rpl_binlog_errors.result:
  Updated result with text for errno
mysql-test/suite/rpl/r/rpl_drop_db.result:
  Updated result with text for errno
mysys/errors.c:
  Updated error messages to use %M
  Changed all errors to use Errcode: consistenly
mysys/my_handler_errors.h:
  Updated handler errors to 5.6 error numbers
sql/share/errmsg-utf8.txt:
  Updated error messages to use %M
sql/sys_vars.cc:
  Added error number to ER_EVENT_SET_VAR_ERROR
strings/my_vsnprintf.c:
  Added %M my_sprintf() modifier that prints error number - system-error-text
  Simplify code
  Movied common code to function
  Removed some casts that was not necessary when reading integer/unsigned int stored in longlong
  Added my_strerror()
unittest/mysys/my_vsnprintf-t.c:
  Added testing of %M
2012-05-30 00:37:55 +03:00
Tor Didriksen
02f90402c8 Bug#14039955 RPAD FUNCTION LEADS TO UNINITIALIZED VALUES WARNING IN MY_STRTOD
Rewrite the "parser" in my_strtod_int() to avoid
reading past the end of the input string.
2012-05-18 12:57:38 +02:00
Sergei Golubchik
f860b2aad4 merge 2012-04-07 15:58:46 +02:00
Sergei Golubchik
a3073ecd96 merge 2012-04-05 23:07:18 +02:00
Sergei Golubchik
cbd52a42ee merge 2012-04-05 12:01:52 +02:00
Sergei Golubchik
dea3544b2d mysql-5.1.62 merge 2012-04-05 10:49:38 +02:00
Sergei Golubchik
20e706689d mysql-5.5.22 merge
mysql-test/suite/innodb/t/group_commit_crash.test:
  remove autoincrement to avoid rbr being used for insert ... select
mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test:
  remove autoincrement to avoid rbr being used for insert ... select
mysys/my_addr_resolve.c:
  a pointer to a buffer is returned to the caller -> the buffer cannot be on the stack
mysys/stacktrace.c:
  my_vsnprintf() is ok here, in 5.5
2012-03-28 01:04:46 +02:00
unknown
8e0afbd8af Backport some simple performance patches from 5.5. 2012-03-22 13:21:15 +01:00
unknown
07de9ab7fc Few simple performance fixes found with sysbench oltp.lua and Oprofile:
- Avoid needless load/stores in my_hash_sort_simple due to possible aliasing
 - Avoid expensive Join_plan_state constructor in choose_subquery_plan when no subquery
 - Avoid calling update_virtual_fields for every row when no virtual fields.
2012-03-21 09:55:48 +01:00
Alexey Botchkov
07a82c58a7 MDEV-15 Log all SQL errors.
Added the logger service that provides us with the rotating logs.
              The plugin SQL_ERROR_LOG added. It logs the errors using the 'logger service'
                      for the rotating log files.
              the example record from the log:
                2012-03-09 15:07:29 root[root] @ localhost [] ERROR 1146: Table 'test.xyz' doesn't exist : select * from test.xyz
2012-03-14 00:55:56 +04:00
Sergei Golubchik
4933d21e5d merge with mysql-5.5.21 2012-03-09 08:06:59 +01:00
MySQL Build Team
7a35cb9150 Updated/added copyright headers 2012-02-16 10:48:16 +01:00
Kent Boortz
6a003dd8ef Updated/added copyright headers 2012-02-15 17:21:38 +01:00
MySQL Build Team
7177a2b9d7 Updated/added copyright headers 2012-02-15 17:13:47 +01:00
unknown
9f9ecc0626 MDEV-135: work-around a GCC bug seen on Debian 5 "lenny" 64-bit. 2012-02-06 13:30:39 +01:00
Tor Didriksen
4172d5e9a9 Bug#13359121 LARGE NUMBERS, /STRINGS/DTOA.C:662
Bug#12985021 SIMPLE QUERY WITH DECIMAL NUMBERS TAKE AN

When parsing the fractional part of a string which
is to be converted to double, we can stop after a few digits:
the extra digits will not contribute to the actual result anyways.


mysql-test/r/func_str.result:
  New tests.
mysql-test/t/func_str.test:
  New tests.
strings/dtoa.c:
  The problem was s2b() multiplying and adding hundreds-of-thousands
  of ever smaller fractions.
2012-01-25 16:11:03 +01:00
Alexander Barkov
31a1f8ef54 Merging Bug#11752408 from mysql-5.1 2012-01-23 13:23:50 +04:00
Alexander Barkov
e449cf48af Bug#11752408 - 43593: DUMP/BACKUP/RESTORE/UPGRADE TOOLS FAILS BECAUSE OF UTF8_GENERAL_CI
Introducing new collations:
utf8_general_mysql500_ci and ucs2_general_mysql500_ci,
to reproduce behaviour of utf8_general_ci and ucs2_general_ci
from mysql-5.1.23 (and earlier).

The collations are added to simplify upgrade from mysql-5.1.23 and earlier.

Note: The patch does not make new server start over old data automatically.
Some manual upgrade procedures are assumed.

Paul: please get in touch with me to discuss upgrade procedures
when documenting this bug.

modified:
  include/m_ctype.h
  mysql-test/r/ctype_utf8.result
  mysql-test/t/ctype_utf8.test
  mysys/charset-def.c
  strings/ctype-ucs2.c
  strings/ctype-utf8.c
2012-01-23 13:07:10 +04:00
Sergei Golubchik
4f435bddfd 5.3 merge 2012-01-13 15:50:02 +01:00
Michael Widenius
e6f5fc1c02 Fixed lp:909051 Options --debug and --disable-debug are known but ambiguous in RelWithDebInfo build
Fixed memory leak printing when doing 'mysqld --version', 'mysqld --debug --help' and 'mysqld --debug --help --verbose'


mysys/my_init.c:
  Moved checking if we should call DBUG_END() before my_thread_end() as otherwise we will not free DBUG variables and files.
mysys/thr_lock.c:
  Fixed compiler warning
sql/mysqld.cc:
  Fixed memory leaks when using mysqld --help and mysqld --version
  Added --debug as an option that works for all builds. For non debug builds we now get a warning.
strings/dtoa.c:
  Fixed valgrind warning (c could contain data outside of the given string)
2011-12-27 20:55:21 +02:00
Michael Widenius
6d4224a31c Merge with 5.2.
no_error handling for select (used by INSERT ... SELECT) still needs to be fixed, but I will do that in a separate commit
2011-12-11 11:34:44 +02:00
Michael Widenius
6920457142 Merge with MariaDB 5.1 2011-11-24 18:48:58 +02:00
Michael Widenius
7b368e3810 Merge with MySQL 5.1.60 2011-11-23 19:32:14 +02:00
Michael Widenius
a8d03ab235 Initail merge with MySQL 5.1 (XtraDB still needs to be merged)
Fixed up copyright messages.
2011-11-21 19:13:14 +02:00
Sergei Golubchik
6edd76785c merge 2011-11-03 23:39:53 +01:00
Sergei Golubchik
0e007344ea mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
Sergei Golubchik
90b43902b0 compilation warnings on Windows 2011-11-02 12:55:46 +01:00
Sergei Golubchik
76f0b94bb0 merge with 5.3
sql/sql_insert.cc:
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
  ******
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
sql/sql_table.cc:
  small cleanup
  ******
  small cleanup
2011-10-19 21:45:18 +02:00
Tor Didriksen
d6d11c8eb1 merge 5.1-security => 5.5-security 2011-10-14 11:14:44 +02:00
Tor Didriksen
5dc553cd28 merge 5.0-security => 5.1 security 2011-10-14 10:44:27 +02:00
Tor Didriksen
a6145f4b62 Bug#12563865 ROUNDED,TMP_BUF,DECIMAL_VALUE STACK CORRUPTION IN ALL VERSIONS >=5.0
Buffer over-run on all platforms, crash on windows, wrong result on other platforms,
when rounding numbers which start with 999999999 and have
precision = 9 or 18 or 27 or 36 ...


mysql-test/r/type_newdecimal.result:
  New test cases.
mysql-test/t/type_newdecimal.test:
  New test cases.
sql/my_decimal.h:
  Add sanity checking code, to catch buffer over/under-run.
strings/decimal.c:
  The original initialization of intg1 (add 1 if buf[0] == DIG_MAX)
  will set p1 to point outside the buffer, and the loop to copy the original value
      while (buf0 < p0)
        *(--p1) = *(--p0);
  will overwrite memory outside the my_decimal object.
2011-10-14 10:09:53 +02:00
Daniel Fischer
64d914cedb merge 2011-09-23 12:18:15 +02:00
Tor Didriksen
f9b064a406 Bug#12985030 SIMPLE QUERY WITH DECIMAL NUMBERS LEAKS MEMORY
Extra fix: 'if (p5 < p5_a + P5A_MAX)' is not portable.
p5 starts out pointing to a static array, then may point
to a buffer on the stack, then may point to malloc()ed memory.
2011-09-21 13:46:49 +02:00
Daniel Fischer
7450044eb7 merge from 5.5.16 2011-09-21 12:40:41 +02:00
Tor Didriksen
dbcdad7d4a Bug#12985030 SIMPLE QUERY WITH DECIMAL NUMBERS LEAKS MEMORY
mysql-test/r/func_str.result:
  New test cases.
mysql-test/t/func_str.test:
  New test cases.
strings/dtoa.c:
  Increasing the buffer size slightly made some queries pass without leaks.
  Adding Bfree(p51, alloc) fixed the remaining leaks.
2011-09-20 10:59:48 +02:00
Tor Didriksen
3a493ae70f merge 5.1 => 5.5 2011-08-29 11:34:48 +02:00
Tor Didriksen
f610c56587 BUG#12911710 - VALGRIND FAILURE IN ROW-DEBUG:PERFSCHEMA.SOCKET_SUMMARY_BY_INSTANCE_FUNC
Converting the number zero to binary and back yielded the number zero,
but with no digits, i.e. zero precision.
This made the multiply algorithm go haywire in various ways.


include/decimal.h:
  Document struct st_decimal_t
mysql-test/r/type_newdecimal.result:
  New test case (valgrind warnings)
mysql-test/t/type_newdecimal.test:
  New test case (valgrind warnings)
sql/my_decimal.h:
  Remove the HAVE_purify enabled/disabled code.
strings/decimal.c:
  Make a proper zero, with non-zero precision.
2011-08-29 11:24:36 +02:00
Ramil Kalimullin
e557d8a5fd Manual merge from mysql-5.5. 2011-08-09 12:03:29 +04:00
Georgi Kodinov
50af230e65 Bug #12319710: INVALID MEMORY READ AND/OR CRASH IN MY_UCA_CHARCMP
WITH UTF32

The 5.5 version of the UTF32 collation was not enforcing the BMP range that 
it currently supports when comparing with LIKE. 
Fixed by backporting the checks for the BMP from trunk.
Added a named constant for the maximum character that can have a weight
in the weight table.
2011-07-22 15:54:47 +03:00
Tor Didriksen
1a02a37243 Bug#12537160 ASSERTION FAILED: STOP0 <= &TO->BUF[TO->LEN] WITH LARGE NUMBER.
Turns out the DBUG_ASSERT added by fix for Bug#11792200 was overly pessimistic:
'stop0' is used in the main loop of do_div_mod, but we only dereference 'buf0'
for div operations, not for mod.


mysql-test/r/func_math.result:
  New test case.
mysql-test/t/func_math.test:
  New test case.
strings/decimal.c:
  Move DBUG_ASSERT down to where we actually dereference the loop pointer.
2011-07-18 09:47:39 +02:00
Kent Boortz
027b5f1ed4 Updated/added copyright headers 2011-07-03 17:47:37 +02:00
Sergei Golubchik
b4a0b2c2f8 post-merge fixes.
most tests pass.
5.3 merge is next
2011-07-02 22:12:12 +02:00
Sergei Golubchik
9809f05199 5.5-merge 2011-07-02 22:08:51 +02:00
Kent Boortz
68f00a5686 Updated/added copyright headers 2011-06-30 17:37:13 +02:00
Kent Boortz
44135d4725 Updated/added copyright headers 2011-06-30 17:31:31 +02:00
Michael Widenius
9f6f04360a Merge with Sergei's tree to get in latest microsecond patches and also fixes to innodb_plugin. 2011-06-11 12:04:42 +03:00
Michael Widenius
163d7acc9f Fixed build failure on OpenSolaris
strings/ctype-simple.c:
  Fixed some compiler warnings
2011-06-09 11:13:03 +03:00
Sergei Golubchik
9b98cae4cc merge with 5.1-micro 2011-06-07 18:13:02 +02:00
Sergei Golubchik
4d128777dd revert a suggested "optimization" that introduced a bug
compilation error in mysys/my_getsystime.c fixed
some redundant code removed
sec_to_time, time_to_sec, from_unixtime, unix_timestamp, @@timestamp now
  use decimal, not double for numbers with a fractional part.
purge_master_logs_before_date() fixed
many bugs in corner cases fixed

mysys/my_getsystime.c:
  compilation failure fixed
sql/sql_parse.cc:
  don't cut corners. it backfires.
2011-06-06 20:28:15 +02:00
Michael Widenius
f197991f41 Merge with 5.1-microseconds
A lot of small fixes and new test cases.

client/mysqlbinlog.cc:
  Cast removed
client/mysqltest.cc:
  Added missing DBUG_RETURN
include/my_pthread.h:
  set_timespec_time_nsec() now only takes one argument
mysql-test/t/date_formats.test:
  Remove --disable_ps_protocl as now also ps supports microseconds
mysys/my_uuid.c:
  Changed to use my_interval_timer() instead of my_getsystime()
mysys/waiting_threads.c:
  Changed to use my_hrtime()
sql/field.h:
  Added bool special_const_compare() for fields that may convert values before compare (like year)
sql/field_conv.cc:
  Added test to get optimal copying of identical temporal values.
sql/item.cc:
  Return that item_int is equal if it's positive, even if unsigned flag is different.
  Fixed Item_cache_str::save_in_field() to have identical null check as other similar functions
  Added proper NULL check to Item_cache_int::save_in_field()
sql/item_cmpfunc.cc:
  Don't call convert_constant_item() if there is nothing that is worth converting.
  Simplified test when years should be converted
sql/item_sum.cc:
  Mark cache values in Item_sum_hybrid as not constants to ensure they are not replaced by other cache values in compare_datetime()
sql/item_timefunc.cc:
  Changed sec_to_time() to take a my_decimal argument to ensure we don't loose any sub seconds.
  Added Item_temporal_func::get_time() (This simplifies some things)
sql/mysql_priv.h:
  Added Lazy_string_decimal()
sql/mysqld.cc:
  Added my_decimal constants max_seconds_for_time_type, time_second_part_factor
sql/table.cc:
  Changed expr_arena to be of type CONVENTIONAL_EXECUTION to ensure that we don't loose any items that are created by fix_fields()
sql/tztime.cc:
  TIME_to_gmt_sec() now sets *in_dst_time_gap in case of errors
  This is needed to be able to detect if timestamp is 0
storage/maria/lockman.c:
  Changed from my_getsystime() to set_timespec_time_nsec()
storage/maria/ma_loghandler.c:
  Changed from my_getsystime() to my_hrtime()
storage/maria/ma_recovery.c:
  Changed from my_getsystime() to mmicrosecond_interval_timer()
storage/maria/unittest/trnman-t.c:
  Changed from my_getsystime() to mmicrosecond_interval_timer()
storage/xtradb/handler/ha_innodb.cc:
  Added support for new time,datetime and timestamp
unittest/mysys/thr_template.c:
  my_getsystime() -> my_interval_timer()
unittest/mysys/waiting_threads-t.c:
  my_getsystime() -> my_interval_timer()
2011-05-28 05:11:32 +03:00
Kent Boortz
02e07e3b51 Updated/added copyright headers 2011-06-30 17:46:53 +02:00
Michael Widenius
f09f1c7c7d Merge with dynamic column code 2011-05-12 14:30:34 +03:00
Tatjana Azundris Nuernberg
d439f959dd auto-merge 2011-05-12 05:32:06 +01:00
Tatjana Azundris Nuernberg
e0c0bf323b auto-merge Bug#11762799/Bug#55436 2011-05-12 04:05:12 +01:00
Tatjana Azundris Nuernberg
9990ab901b auto-merge Bug#11762799/Bug#55436 2011-05-12 03:41:51 +01:00
Michael Widenius
5ab92b1f85 Adding support for Dynamic columns (WL#34):
- COLUMN_CREATE(column_nr, value, [column_nr,value]...)
- COLUMN_ADD(blob,column_nr, value, column_nr,value]...)
- COLUMN_DELETE(blob, column_nr, column_nr...)
- COLUMN_EXISTS(blob, column_nr)
- COLUMN_LIST(blob, column_nr)
- COLUMN_GET(string, column_nr AS type)

Added cast(X as DOUBLE) and cast(x as INT)
Better warning and error messages for wrong cast's
Created some sub functions to simplify and reuse code.
Added a lot of conversation functions with error/warnings for what went wrong.
Fixed some issues when casting time to datetime.
Added functions to dynamic strings and Strings to allow one to move a string buffer from dynamic strings to String (to save malloc+ copy)
Added dynamic columns library to libmysqlclient


include/Makefile.am:
  Added ma_dyncol.h
include/decimal.h:
  Added 'const' to arguments for some functions.
include/my_sys.h:
  Added dynstr_reassociate()
include/my_time.h:
  Added TIME_SUBSECOND_RANGE
  Added double_to_datetime()
  Added flag argument to str_to_time()
libmysql/CMakeLists.txt:
  Added mysys/ma_dyncol.c
libmysql/Makefile.shared:
  Added ma_dyncol
libmysql/libmysql.c:
  Added argument to str_to_time()
mysql-test/r/bigint.result:
  Better error messages
mysql-test/r/cast.result:
  Better warning and error messages
  A lot of new cast() tests
mysql-test/r/func_math.result:
  Better warning messages
mysql-test/r/func_str.result:
  Better warning messages
mysql-test/r/func_time.result:
  Better warning messages
mysql-test/r/sp-vars.result:
  Better warning messages
mysql-test/r/strict.result:
  Better warning messages
  New test result
mysql-test/r/type_newdecimal.result:
  Better warning messages
mysql-test/r/warnings.result:
  Better warning messages
mysql-test/suite/funcs_1/r/innodb_func_view.result:
  Updated results after better cast warnings
mysql-test/suite/funcs_1/r/memory_func_view.result:
  Updated results after better cast warnings
mysql-test/suite/funcs_1/r/myisam_func_view.result:
  Updated results after better cast warnings
mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test:
  Added begin...commit to speed up test.
mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc:
  Added begin...commit to speed up test.
mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc:
  Added begin...commit to speed up test.
mysql-test/suite/parts/r/part_supported_sql_func_innodb.result:
  Added begin...commit to speed up test.
mysql-test/suite/parts/r/part_supported_sql_func_myisam.result:
  Added begin...commit to speed up test.
mysql-test/suite/parts/r/rpl_partition.result:
  Added begin...commit to speed up test.
mysql-test/suite/parts/t/part_supported_sql_func_innodb.test:
  Removed duplicated --big_test
mysql-test/suite/parts/t/rpl_partition.test:
  Added begin...commit to speed up test.
mysql-test/suite/pbxt/r/cast.result:
  Updated results after better cast warnings
mysql-test/suite/pbxt/r/func_str.result:
  Updated results after better cast warnings
mysql-test/suite/pbxt/r/type_newdecimal.result:
  Updated results after better cast warnings
mysql-test/suite/rpl/r/rpl_innodb_bug28430.result:
  Added begin...commit to speed up test.
mysql-test/suite/rpl/t/rpl_innodb_bug28430.test:
  Added begin...commit to speed up test.
mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result:
  More warnings
mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result:
  More warnings
mysql-test/t/cast.test:
  A lot of new cast() tests
mysql-test/t/strict.test:
  Added new test
mysys/CMakeLists.txt:
  Added ma_dyncol.c
mysys/Makefile.am:
  Added ma_dyncol.c
mysys/string.c:
  Added dynstr_reassociate() to move a buffer from dynamic_strings to some other allocator
sql-common/my_time.c:
  Added 'fuzzydate' flag to str_to_time()
  Added support for microseconds to my_time_to_str() and my_datetime_to_str()
  Reset second_parts in number_to_datetime()
  Added double_to_datetime()
sql/field.cc:
  Added double_to_longlong() and truncate_double() to simplify and reuse code
sql/field.h:
  New prototypes
sql/item.cc:
  Changed Item::get_date(MYSQL_TIME *ltime,uint fuzzydate) to be aware of type of argument.
  (Needed to make it microsecond safe and get better warnings).
  Updated call to str_to_time_with_warn()
sql/item.h:
  Added struct st_dyncall_create_def used by dynamic columns
  Added virtual bool dynamic_result() to tell if type of argument may change over calls.
sql/item_cmpfunc.cc:
  Added Item_func_dyncol_exists()
sql/item_cmpfunc.h:
  Added class Item_func_dyncol_exists
sql/item_create.cc:
  Added get_length_and_scale() to simplify other functions
  Simplified and extended create_func_cast()
  Added support for cast(X as double(X,Y))
  Added functions to create dynamic column functions.
sql/item_create.h:
  Added prototypes
sql/item_func.cc:
  Extended cast functions Item_func_signed() and Item_func_unsigned() to work with dynamic types
  Added Item_double_typecast()
sql/item_func.h:
  Added class Item_double_typecast()
sql/item_strfunc.cc:
  Added functions for COLUMN_CREATE(), COLUMN_ADD(), COLUMN_GET() and COLUMN_LIST()
sql/item_strfunc.h:
  Added classes for COLUMN_CREATE(), COLUMN_ADD(), COLUMN_GET() and COLUMN_LIST()
sql/item_timefunc.cc:
  Added flag argument to str_to_time_with_warn()
  Updated Item_char_typecast() to handle result type that may change between calls (for dynamic columns)
  Added Item_time_typecast::get_date() to ensure that we cast a datetime to time properly.
sql/item_timefunc.h:
  Added get_date() to Item_time_typecast() to allow proper results for casting time to datetime
sql/lex.h:
  Added new SQL function names
sql/my_decimal.cc:
  Added 'const' to some arguments.
  Better error message in case of errors (we now print out the wrong value)
  Added my_decimal2int()
sql/my_decimal.h:
  Moved some constants to my_decimal_limits.h
  Updated prototypes.
  Made my_decimal2int() a function as it's rather long (no reason to have it inline)
  Added decimal2my_decimal() function.
sql/mysql_priv.h:
  Prototypes for new functions
sql/share/errmsg.txt:
  New error messages for wrong casts and dynamic columns
sql/sql_acl.cc:
  Fixed indentation
sql/sql_base.cc:
  Added dynamic_column_error_message()
sql/sql_string.h:
  Added reassociate() to move a buffer to be owned by String object.
sql/sql_yacc.yy:
  Added syntax for COLUMN_ functions.
sql/time.cc:
  Updated str_to_datetime_with_warn() flag argument to same type as other functions
  Added conversion flag to str_to_time_with_warn() (Similar to all datetime functions)
  Added conversion functions with warnings: double_to_datetime_with_warn() and decimal_to_datetime_with_warn()
strings/decimal.c:
  Added 'const' to arguments for some functions.
unittest/mysys/Makefile.am:
  Added test for dynamic columns code
2011-05-08 13:24:06 +03:00
Tatiana Azundris Nurnberg
9d80d48806 auto-merge conservative fix for Bug#55436/Bug#11762799 2011-05-05 06:39:38 +01:00
Michael Widenius
173820a553 Fixed typo that caused compiler warning 2011-05-04 11:31:06 +03:00
Michael Widenius
1be5462d59 Merge with MariaDB 5.1 2011-05-03 19:10:10 +03:00
Michael Widenius
e415ba0fb2 Merge with MySQL 5.1.57/58
Moved some BSD string functions from Unireg
2011-05-02 20:58:45 +03:00
Sergei Golubchik
0accbd0364 lots of post-merge changes 2011-04-25 17:22:25 +02:00
Vladislav Vaintroub
41d432462b merge 5.2 2011-03-10 09:39:14 +01:00
Tor Didriksen
ef19b3b6cf Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONS
This was a buffer overrun in do_div_mod(), overwriting the internal buffer
of auto variable 'tmp' in Item_func_int_div::val_int.
Result on windows: 'this' is set to zero, and crash.
Ran fine on other platforms (no valgrind warnings),
but this is undefined behaviour on any platform of course.

include/decimal.h:
  Add const qualifiers to function prototypes which are used by sql/my_decimal.h
mysql-test/r/func_math.result:
  New test case.
mysql-test/t/func_math.test:
  New test case.
sql/my_decimal.h:
  Remove several C-style casts:
   - some of the were up-casts, and thus un-necessary
   - some of them should have been const-casts, but it is better to make the
     underlying library functions in (decimal.[h|c]) const instead.
strings/decimal.c:
  Check for buffer overrun in do_div_mod()
  Add const qualifiers to functions which are used by sql/my_decimal.h
2011-03-03 15:25:41 +01:00
Alexander Barkov
561738dc10 Merging from mysql-5.1 2011-03-01 17:42:37 +03:00
Alexander Barkov
fd1e3b03ff Bug#11766725 (Bug#59901) EXTRACTVALUE STILL BROKEN AFTER FIX FOR BUG #44332
Problem: a byte behind the end of input string was read
in case of a broken XML not having a quote or doublequote
character closing a string value.

Fix: changing condition not to read behind the end of input string

  @ mysql-test/r/xml.result
  @ mysql-test/t/xml.test
  Adding tests

  @ strings/xml.c
  When checking if the closing quote/doublequote was found,
  using p->cur[0] us unsafe, as p->cur can point to the byte after the value.
  Comparing p->cur to p->beg instead.
2011-03-01 15:30:18 +03:00
Sergei Golubchik
a8a757c6bb wl#173 - temporal types with sub-second resolution
and collateral changes.

* introduce my_hrtime_t, my_timediff_t, and conversion macros
* inroduce TIME_RESULT, but it can only be returned from Item::cmp_type(),
  never from Item::result_type()
* pack_time/unpack_time function for "packed" representation of
  MYSQL_TIME in a longlong that can be compared
* ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
* numbers aren't quoted in EXPLAIN EXTENDED
* new column I_S.COLUMNS.DATETIME_PRECISION
* date/time values are compares to anything as date/time, not as strings or numbers.
* old timestamp(X) is no longer supported
* MYSQL_TIME to string conversion functions take precision as an argument
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* Lazy_string class to pass a value (string, number, time) polymorphically down the stack
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
* introduced Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* in many cases date/time types are treated like other types, not as special cases
* greatly simplified Arg_comparator (regarding date/time/year code)
* SEC_TO_TIME is real function, not integer.
* microsecond precision in NOW, CURTIME, etc
* Item_temporal. All items derived from it only provide get_date, but no val* methods
* replication of NOW(6)
* Protocol::store(time) now takes the precision as an argument
* @@TIMESTAMP is a double

client/mysqlbinlog.cc:
  remove unneded casts
include/my_sys.h:
  introduce my_hrtime_t, my_timediff_t, and conversion macros
include/my_time.h:
  pack_time/unpack_time, etc.
  convenience functions to work with MYSQL_TIME::second_part
libmysql/libmysql.c:
  str_to_time() is gone. str_to_datetime() does it now.
  my_TIME_to_str() takes the precision as an argument
mysql-test/include/ps_conv.inc:
  time is not equal to datetime anymore
mysql-test/r/distinct.result:
  a test for an old MySQL bug
mysql-test/r/explain.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_default.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_sapdb.result:
  when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/func_test.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_time.result:
  ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
mysql-test/r/having.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/information_schema.result:
  new column I_S.COLUMNS.DATETIME_PRECISION
mysql-test/r/join_outer.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/metadata.result:
  TIMESTAMP no longer has zerofill flag
mysql-test/r/range.result:
  invalid datetime is not compared with as a string
mysql-test/r/select.result:
  NO_ZERO_IN_DATE, etc only affect storage - according to the manual
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/subselect.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/sysdate_is_now.result:
  when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/type_blob.result:
  TIMESTAMP(N) is not deprecated
mysql-test/r/type_timestamp.result:
  old TIMESTAMP(X) semantics is not supported anymore
mysql-test/r/union.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/varbinary.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/t/distinct.test:
  test for an old MySQL bug
mysql-test/t/func_time.test:
  +- INTERVAL now works with TIME values
mysql-test/t/select.test:
  typo
mysql-test/t/subselect.test:
  only one error per statement, please
mysql-test/t/system_mysql_db_fix40123.test:
  old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50030.test:
  old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50117.test:
  old timestamp(X) is no longer supported
mysql-test/t/type_blob.test:
  old timestamp(X) is no longer supported
mysql-test/t/type_timestamp.test:
  old timestamp(X) is no longer supported
mysys/my_getsystime.c:
  functions to get the time with microsecond precision
mysys/my_init.c:
  move the my_getsystime.c initialization code to my_getsystime.c
mysys/my_static.c:
  no need to make these variables extern
mysys/my_static.h:
  no need to make these variables extern
scripts/mysql_system_tables.sql:
  old timestamp(X) is no longer supported
scripts/mysql_system_tables_fix.sql:
  old timestamp(X) is no longer supported
scripts/mysqlhotcopy.sh:
  old timestamp(X) is no longer supported
sql-common/my_time.c:
  * call str_to_time from str_to_datetime, as appropriate
  * date/time to string conversions take precision as an argument
  * number_to_time()
  * TIME_to_double()
  * pack_time() and unpack_time()
sql/event_data_objects.cc:
  cast is not needed
  my_datetime_to_str() takes precision as an argument
sql/event_db_repository.cc:
  avoid dangerous downcast (because the pointer is
  not always Field_timestamp, see events_1.test)
sql/event_queue.cc:
  avoid silly double-work for cond_wait
  (having an endpoint of wait, subtract the current time to get the timeout,
  and use set_timespec() macro to fill in struct timespec, by adding the current
  time to the timeout)
sql/field.cc:
  * remove virtual Field::get_time(), everyone should use only Field::get_date()
  * remove lots of #ifdef WORDS_BIGENDIAN
  * unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
  * Field_timestamp_hires, Field_datetime_hires, Field_time_hires
  * Field_temporal
  * make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
sql/field.h:
  * remove virtual Field::get_time(), everyone should use only Field::get_date()
  * remove lots of #ifdef WORDS_BIGENDIAN
  * unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
  * Field_timestamp_hires, Field_datetime_hires, Field_time_hires
  * Field_temporal
  * make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
  * removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
sql/filesort.cc:
  TIME_RESULT, cmp_time()
sql/item.cc:
  * numbers aren't quoted in EXPLAIN EXTENDED
  * Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
  * virtual Item::get_time() is gone
  * Item_param::field_type() is set correctly
  * Item_datetime, for a datetime constant
  * time to anything is compared as a time
  * Item_cache::print() prints the value is available
  * bug fixed in Item_cache_int::val_str()
sql/item.h:
  * Item::print_value(), to be used from Item_xxx::print() when needed
  * Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
  * virtual Item::get_time() is gone
  * Item_datetime, for a datetime constant
  * better default for cast_to_int_type()
  * Item_cache objects now *always* have the field_type() set
sql/item_cmpfunc.cc:
  * get_year_value, get_time_value are gone. get_datetime_value does it all
  * get_value_a_func, get_value_b_func are gone
  * can_compare_as_dates() is gone too, TIME_RESULT is used instead
  * cmp_type() instead or result_type() when doing a comparison
  * compare_datetime and compate_e_datetime in the comparator_matrix, is_nulls_eq is gone
  * Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
sql/item_cmpfunc.h:
  greatly simplified Arg_comparator
sql/item_create.cc:
  * fix a bug in error messages in CAST
sql/item_func.cc:
  Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
  mention all possibitiles in switch over Item_result values, or use default:
sql/item_row.h:
  overwrite the default cmp_type() for Item_row,
  as no MYSQL_TYPE_xxx value corresponds to ROW_RESULT
sql/item_timefunc.cc:
  rewrite make_datetime to support precision argument
  SEC_TO_TIME is real function, not integer.
  many functions that returned temporal values had duplicate code in val_* methods,
  some of them did not have get_date() which resulted in unnecessary date->str->date conversions. 
  Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
  many fixes to set decimals (datetime precision) correctly.
sql/item_timefunc.h:
  SEC_TO_TIME is real function, not integer.
  many functions that returned temporal values had duplicate code in val_* methods,
  some of them did not have get_date() which resulted in unnecessary date->str->date conversions. 
  Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
  many fixes to set decimals (datetime precision) correctly.
sql/log_event.cc:
  replication of NOW(6)
sql/log_event.h:
  replication of NOW(6)
sql/mysql_priv.h:
  Lazy_string class to pass a value (string, number, time) polymorphically down the stack.
  make_truncated_value_warning() that uses it.
sql/mysqld.cc:
  datetime in Arg_comparator::comparator_matrix
sql/opt_range.cc:
  cleanup: don't disable warnings before calling save_in_field_no_warnings()
sql/protocol.cc:
  Protocol::store(time) now takes the precision as an argument
sql/protocol.h:
  Protocol::store(time) now takes the precision as an argument
sql/rpl_rli.cc:
  small cleanup
sql/set_var.cc:
  SET TIMESTAMP=double
sql/set_var.h:
  @@TIMESTAMP is a double
sql/share/errmsg.txt:
  precision and scale are unsigned
sql/slave.cc:
  replication of NOW(6)
sql/sp_head.cc:
  cleanup
sql/sql_class.cc:
  support for NOW(6)
sql/sql_class.h:
  support for NOW(6)
sql/sql_insert.cc:
  support for NOW(6)
sql/sql_select.cc:
  use item->cmp_type().
  move a comment where it belongs
sql/sql_show.cc:
  new column I_S.COLUMNS.DATETIME_PRECISION
sql/sql_yacc.yy:
  TIME(X), DATETIME(X), cast, NOW(X), CURTIME(X), etc
sql/time.cc:
  fix date_add_interval() to support MYSQL_TIMESTAMP_TIME argument
storage/myisam/ha_myisam.cc:
  TIMESTAMP no longer carries ZEROFIELD flag, still we keep MYI file compatible.
strings/my_vsnprintf.c:
  warnings
tests/mysql_client_test.c:
  old timestamp(X) does not work anymore
  datetime is no longer equal to time
2011-03-01 13:24:36 +01:00
Michael Widenius
3358cdd504 Merge with 5.1 to get in changes from MySQL 5.1.55 2011-02-28 19:39:30 +02:00
Michael Widenius
58bb0769bd Merge with MySQL 5.1.55
- Fixed some issues with partitions and connection_string, which also fixed lp:716890 "Pre- and post-recovery crash in Aria"
- Fixed wrong assert in Aria

Now need to merge with latest xtradb before pushing 

sql/ha_partition.cc:
  Ensure that m_ordered_rec_buffer is not freed before close.
sql/mysqld.cc:
  Changed to use opt_stack_trace instead of opt_pstack.
  Removed references to pstack
sql/partition_element.h:
  Ensure that connect_string is initialized
storage/maria/ma_key_recover.c:
  Fixed wrong assert
2011-02-20 18:51:43 +02:00
Michael Widenius
47996dd780 Added missing header file strings_def.h to dist 2011-02-03 16:03:54 +02:00
Michael Widenius
2e75dda33e Merge with 5.1
Fixed a couple of compilation failures that was not detected before merge.
2011-01-30 16:43:23 +02:00
Michael Widenius
785695e7c3 Flush DBUG log in case of DBUG_ASSERT()
Added strings_def.h into strings library to be able to have a DBUG_ASSERT() version without _db_flush() call (as strings.a should not depend on dbug.a)
Remove include of m_string.h in all string files (as it's included by string_def.h).
Fixed include order.
Changed "m_ctype.h" -> <m_ctype.h>

 

include/my_dbug.h:
  Flush DBUG log in case of DBUG_ASSERT()
strings/bchange.c:
  Include strings_def.h
strings/bcmp.c:
  Include strings_def.h
strings/bfill.c:
  Include strings_def.h
strings/bmove.c:
  Include strings_def.h
strings/bmove512.c:
  Include strings_def.h
strings/bmove_upp.c:
  Include strings_def.h
strings/conf_to_src.c:
  Include strings_def.h
  Fixed copyright
strings/ctype-big5.c:
  Include strings_def.h
strings/ctype-bin.c:
  Include strings_def.h
strings/ctype-cp932.c:
  Include strings_def.h
strings/ctype-czech.c:
  Include strings_def.h
strings/ctype-euc_kr.c:
  Include strings_def.h
strings/ctype-eucjpms.c:
  Include strings_def.h
strings/ctype-extra.c:
  Include strings_def.h
strings/ctype-gbk.c:
  Include strings_def.h
strings/ctype-latin1.c:
  Include strings_def.h
strings/ctype-mb.c:
  Include strings_def.h
strings/ctype-simple.c:
  Include strings_def.h
strings/ctype-sjis.c:
  Include strings_def.h
strings/ctype-tis620.c:
  Include strings_def.h
strings/ctype-uca.c:
  Include strings_def.h
strings/ctype-ucs2.c:
  Include strings_def.h
strings/ctype-ujis.c:
  Include strings_def.h
strings/ctype-utf8.c:
  Include strings_def.h
strings/ctype-win1250ch.c:
  Include strings_def.h
strings/ctype.c:
  Include strings_def.h
strings/decimal.c:
  Include strings_def.h
strings/do_ctype.c:
  Include strings_def.h
strings/int2str.c:
  Include strings_def.h
strings/is_prefix.c:
  Include strings_def.h
strings/llstr.c:
  Include strings_def.h
strings/longlong2str.c:
  Include strings_def.h
strings/longlong2str_asm.c:
  Include strings_def.h
strings/my_strchr.c:
  Include strings_def.h
strings/my_strtoll10.c:
  Include strings_def.h
strings/my_vsnprintf.c:
  Include strings_def.h
strings/r_strinstr.c:
  Include strings_def.h
strings/str2int.c:
  Include strings_def.h
strings/str_alloc.c:
  Include strings_def.h
strings/str_test.c:
  Include strings_def.h
  Fixed compiler warnings
strings/strappend.c:
  Include strings_def.h
strings/strcend.c:
  Include strings_def.h
strings/strcont.c:
  Include strings_def.h
strings/strend.c:
  Include strings_def.h
strings/strfill.c:
  Include strings_def.h
strings/strinstr.c:
  Include strings_def.h
strings/strmake.c:
  Include strings_def.h
strings/strmov.c:
  Include strings_def.h
strings/strmov_overlapp.c:
  Include strings_def.h
strings/strnlen.c:
  Include strings_def.h
strings/strnmov.c:
  Include strings_def.h
strings/strstr.c:
  Include strings_def.h
strings/strto.c:
  Include strings_def.h
strings/strtod.c:
  Include strings_def.h
strings/strtol.c:
  Include strings_def.h
strings/strtoll.c:
  Include strings_def.h
strings/strtoul.c:
  Include strings_def.h
strings/strtoull.c:
  Include strings_def.h
strings/strxmov.c:
  Include strings_def.h
strings/strxnmov.c:
  Include strings_def.h
strings/uctypedump.c:
  Include strings_def.h
  Fixed compiler warnings
  Removed double include of m_ctype.h
strings/udiv.c:
  Include strings_def.h
strings/xml.c:
  Include strings_def.h
2011-01-30 12:41:44 +02:00
Vladislav Vaintroub
b19e99865c MWL#55 : cherrypick MySQL 5.5 CMake/build improvements in order
to be able to build MSI based installer
2011-01-29 18:51:12 +01:00
Michael Widenius
7057545699 Fixed some mysql-test-run failures and compile warnings/errors
Added logging of all possible fatal table errors if --log-warnings set to > 1


mysql-test/extra/rpl_tests/rpl_EE_err.test:
  Safety fix
mysql-test/extra/rpl_tests/rpl_row_basic.test:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/r/archive.result:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/r/csv.result:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/maria/r/maria-autozerofill.result:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/maria/t/maria-autozerofill.test:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/maria/t/maria-recover.test:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/parts/t/partition_recover_myisam.test:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_bug38694.result:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_idempotency.result:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_ignore_table.result:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_row_conflicts.result:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/r/rpl_temporary_errors.result:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_bug38694.test:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_idempotency.test:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_ignore_table.test:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_row_conflicts.test:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/t/archive.test:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
mysql-test/t/csv.test:
  Added suppression of possible error message (so that one can run test with --log-warnings=2)
sql/handler.cc:
  If running with --assert-of-crashed-table or --log-warnings > 1 then print engine error to log
sql/sql_select.cc:
  Disable not initialized warning from gcc
strings/Makefile.am:
  Fixed compiler error on Solaris 10 (duplicate strmov() function)
2011-01-20 19:08:12 +02:00
Alexander Barkov
435289acd4 Updating Copyright information 2011-01-19 16:17:52 +03:00
Alexander Barkov
5574a2cd91 Bug#44332 my_xml_scan reads behind the end of buffer
Problem: the scanner function tested for strings "<![CDATA[" and
"-->" without checking input string boundaries, which led to valgrind's
"Conditional jump or move depends on uninitialised value(s)" error.

Fix: Adding boundary checking.

  @ mysql-test/r/xml.result
  @ mysql-test/t/xml.test
  Adding test

  @ strings/xml.c
  Adding a helper function my_xml_parser_prefix_cmp(),
  with input string boundary check.
2011-01-18 09:38:41 +03:00
Alexander Barkov
dfb7930b33 Merging Copyright update from 5.1 2011-01-19 16:31:17 +03:00
Alexander Barkov
daf602a223 Merging from 5.1. 2011-01-18 09:50:03 +03:00
Tor Didriksen
7bf234032a Bug #59241 invalid memory read in do_div_mod with doubly assigned variables
Fix: copy my_decimal by value, to avoid dangling pointers.


mysql-test/r/func_math.result:
  New test case.
mysql-test/t/func_math.test:
  New test case.
sql/item_cmpfunc.cc:
  No need to call fix_buffer_pointer() anymore.
sql/item_func.cc:
  Copy my_decimal by value, to avoid dangling pointers.
sql/my_decimal.h:
  Implement proper copy constructor and assignment operator for my_decimal.
sql/sql_analyse.cc:
  No need to call fix_buffer_pointer() anymore.
strings/decimal.c:
  Remove #line directive: it messes up TAGS and it confuses gdb when debugging.
2011-01-14 10:05:14 +01:00
Kent Boortz
4acfdb9df1 Merge 2010-12-29 00:47:05 +01:00
Kent Boortz
85323eda8a - Added/updated copyright headers
- Removed files specific to compiling on OS/2
- Removed files specific to SCO Unix packaging
- Removed "libmysqld/copyright", text is included in documentation
- Removed LaTeX headers for NDB Doxygen documentation
- Removed obsolete NDB files
- Removed "mkisofs" binaries
- Removed the "cvs2cl.pl" script
- Changed a few GPL texts to use "program" instead of "library"
2010-12-28 19:57:23 +01:00
Georgi Kodinov
74e2520cd9 merge mysql-5.5->mysql-5.5-bugteam 2010-12-16 18:44:17 +02:00
Alexander Barkov
ac665ecf06 Bug#58321 No warning when characters outside BMP0 is converted to UCS2
Problem: when inserting supplementary characters to an UCS2 column,
character was silently shrinked to 16-bit value.

Fix: produce a warning on attempt to insert a supplementary character,
and convert to question mark.

  @ mysql-test/r/ctype_many.result
  @ mysql-test/t/ctype_many.test
  Adding tests

  @ strings/ctype-ucs2.c
  Check if wc is greater than the highest value supported (0xFFFF),
  return MY_CS_ILUNI if true.
2010-12-15 12:58:37 +03:00
Vladislav Vaintroub
bfcc62c748 merge 2010-12-06 13:16:49 +01:00
Vladislav Vaintroub
0eae06c430 Bug#473914: mysql_client_test fail with in debug compilaton on windows x64
Reason: inconsistent compilation, federatedx is compiled without SAFEMALLOC
flag, while anything else is compiled with SAFEMALLOC.

As a consequence, my_hash_init used inside federatedx initialization does not
provide correct caller info parameters (file, line) , so they are initialized with 
whatever is on stack. When info about allocated memory is output in
COM_DEBUG command, the server crashes trying to output string starting at
0xcccccccccccccccc.

The fix is to remove SAFEMALLOC  preprocessor flags 
from every CMakeLists.txt, except the top-level one.

Also, SAFEMALLOC is not defined by default now, instead
there is WITH_DEBUG_FULL CMake option which adds 
-DSAFEMALLOC to C and C++ flags in debug compilation. 
This option is off by  default, because 
1) Debug C runtime already has heap debugging builtin with 
 overwrite and leak detection
2)safemalloc considerably slows down the tests.


Note also  that 
- SAFEMALLOC is gone  in MySQL5.5
- On Windows, heap related overflows can also be found using free pageheap utility
(that is also part of application verifier). This is even more efficient if there are no other layers 
on top of Windows heap allocator, e.g  it is most efficient with release version.
2010-12-06 12:52:06 +01:00
Michael Widenius
b3c72b9a02 Removed compiler warning 2010-12-05 19:46:39 +02:00
Mats Kindahl
65faf729cd Merging patch for BUG#58246 into mysql-5.5-bugteam. 2010-12-01 23:15:14 +01:00
Mats Kindahl
9c87ae9ba7 Merging patch for BUG#58246 with mysql-5.1-bugteam. 2010-12-01 20:33:31 +01:00
Mats Kindahl
fc9f3efaec BUG#58246: INSTALL PLUGIN not secure & crashable
When installing plugins, there is a missing check
for slash (/) in the path on Windows. Note that on
Windows, both / and \ can be used to separate
directories.

This patch fixes the issue by:
- Adding a FN_DIRSEP symbol for all platforms
  consisting of a string of legal directory
  separators.
- Adding a charset-aware version of strcspn().
- Adding a check_valid_path() function that uses
  my_strcspn() to check if any FN_DIRSEP character
  is in the supplied string.
- Using the check_valid_path() function in
  sql_plugin.cc and sql_udf.cc (which means
  replacing the existing test there).

include/config-netware.h:
  Adding FN_DIRSEP
  ******
  Adding FN_DIRSEP
include/config-win.h:
  Adding FN_DIRSEP
  ******
  Adding FN_DIRSEP
include/m_ctype.h:
  Adding my_strspn() and my_strcspn().
  
  ******
  Adding my_strspn() and my_strcspn().
include/my_global.h:
  Adding FN_DIRSEP
  ******
  Adding FN_DIRSEP
mysql-test/t/plugin_not_embedded.test:
  Adding test that file names containing / is
  disallowed on *all* platforms.
  ******
  Adding test that file names containing / is
  disallowed on *all* platforms.
sql/sql_plugin.cc:
  Introducing check_if_path() function for
  checking if filename is a path to include
  / on Windows.
  ******
  Introducing check_if_path() function for
  checking if filename is a path to include
  / on Windows.
sql/sql_udf.cc:
  Switching to use check_if_path() function.
  ******
  Switching to use check_if_path() function.
strings/my_strchr.c:
  Adding my_strspn() and my_strcspn().
  ******
  Adding my_strspn() and my_strcspn().
2010-12-01 13:54:50 +01:00
Alexander Barkov
f826970656 Merging from mysql-5.1-bugteam 2010-11-26 17:22:06 +03:00
Alexander Barkov
a7c09ea9f8 Bug#56639 Character Euro (0x88) not converted from cp1251 to utf8
Problem: MySQL cp1251 did not support 'U+20AC EURO SIGN'
which was assigned a few years ago to 0x88.

Fix: adding mapping: 0x88 <-> U+20AC 

  @ mysql-test/include/ctype_8bit.inc
  New shared file to test 8bit character sets.

  @ mysql-test/r/ctype_cp1251.result
  @ mysql-test/t/ctype_cp1251.test
  Adding tests

  @ sql/share/charsets/cp1251.xml
  Adding mapping

  @ strings/ctype-extra.c
  Regenerating ctype-extra.c using strings/conf_to_src
  according to new cp1251.xml
2010-11-26 16:58:54 +03:00
Alexander Barkov
e3dee8a7fd Bug#57737 Character sets: search fails with like, contraction, index
Problem: LIKE over an indexed column optimized away good results,
because my_like_range_utf32/utf16 returned wrong ranges for contractions.
Contraction related code was missing in my_like_range_utf32/utf16,
but did exist in my_like_range_ucs2/utf8.
It was forgotten in utf32/utf16 versions (during mysql-6.0 push/revert mess).

Fix:
The patch removes individual functions my_like_range_ucs2,
my_like_range_utf16, my_like_range_utf32 and introduces a single function
my_like_range_generic() instead. The new function handles contractions
correctly. It can handle any character set with cs->min_sort_char and
cs->max_sort_char represented in Unicode code points.

added:
  @ mysql-test/include/ctype_czech.inc
  @ mysql-test/include/ctype_like_ignorable.inc
  @ mysql-test/r/ctype_like_range.result
  @ mysql-test/t/ctype_like_range.test
  Adding tests


modified:

  @ include/m_ctype.h
  - Adding helper functions for contractions.
  - Prototypes: removing ucs2,utf16,utf32 functions, adding generic function.
  @ mysql-test/r/ctype_uca.result
  @ mysql-test/r/ctype_utf16_uca.result
  @ mysql-test/r/ctype_utf32_uca.result
  @ mysql-test/t/ctype_uca.test
  @ mysql-test/t/ctype_utf16_uca.test
  @ mysql-test/t/ctype_utf32_uca.test
  - Adding tests.

  @ strings/ctype-mb.c
  - Pad function did not put the last character.
  - Implementing my_like_range_generic() - an universal replacement
    for three separate functions
    my_like_range_ucs2(), my_like_range_utf16() and my_like_range_utf32(),
    with correct contraction handling.

  @ strings/ctype-ucs2.c
  - my_fill_mb2 did not put the high byte, as previously
    it was used to put only characters in ASCII range.
    Now it puts high byte as well
    (needed to pupulate cs->max_sort_char correctly).
  - Adding DBUG_ASSERT()
  - Removing character set specific functions:
    my_like_range_ucs2(), my_like_range_utf16() and my_like_range_utf32().
  - Using my_like_range_generic() instead of the old functions.

  @ strings/ctype-uca.c
  - Using generic function instead of the old character set specific ones.

  @ sql/item_create.cc
  @ sql/item_strfunc.cc
  @ sql/item_strfunc.h
  - Adding SQL functions LIKE_RANGE_MIN and LIKE_RANGE_MAX,
    available only in debug build to make sure like_range()
    works correctly for all character sets and collations.
2010-11-26 13:44:39 +03:00
Sergei Golubchik
65ca700def merge.
checkpoint.
does not compile.
2010-11-25 18:17:28 +01:00
Tatiana A. Nurnberg
c24ec46986 merge some docs changes and a test case; null merge the code.
(we don't need to port the actual code from 5.1;
5.5+ do the relevant things differently, but correctly. the
test obviously is so it stays that way.)

mysql-test/r/variables.result:
  add test case.
mysql-test/t/variables.test:
  add test case.
strings/CHARSET_INFO.txt:
  clarify documentation
2010-11-25 03:50:16 +00:00
Alexander Nozdrin
39ce362885 Bug#55980 Character sets: supplementary character _bin ordering is wrong
Post-fix:
  Reverting the "utf16_bin did not sort supplementary characters
  between U+D700 and U+E000" part. We'll use code-point order.

Committing on behalf of Alexander Barkov.
2010-11-24 17:52:57 +03:00
Davi Arnaut
af67d8ae02 WL#5665: Removal of the autotools-based build system
Remove some more leftovers from the initial removal:

o Update relevant mentions of configure.in throughout
the source code.

o Remove win/configure.js, which at this point just
duplicates logic already present in CMake based build
system.

o Remove support files which relied on the autotools
build system. In any case, MySQL is no longer officially
supported on SCO.

o Remove files which are no longer part of the build.
2010-11-20 20:56:09 -02:00
Davi Arnaut
8664de2230 WL#5665: Removal of the autotools-based build system
The autotools-based build system has been superseded and
is being removed in order to ease the maintenance burden on
developers tweaking and maintaining the build system.

In order to support tools that need to extract the server
version, a new file that (only) contains the server version,
called VERSION, is introduced. The file contents are human
and machine-readable. The format is:

MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=8
MYSQL_VERSION_EXTRA=-rc

The CMake based version extraction in cmake/mysql_version.cmake
is changed to extract the version from this file. The configure
to CMake wrapper is retained for backwards compatibility and to
support the BUILD/ scripts. Also, a new a makefile target
show-dist-name that prints the server version is introduced.

VERSION:
  Add top-level version file.
cmake/mysql_version.cmake:
  Get version information from the top-level VERSION file.
  Do not cache the version components (MAJOR_VERSION, etc).
  Add MYSQL_RPM_VERSION as a replacement for MYSQL_U_SCORE_VERSION.
2010-11-20 12:47:50 -02:00
unknown
95b37a254b Merge MariaDB 5.1->5.2 2010-11-19 22:33:47 +01:00
unknown
0de9a4abab MWL#74: Shared libmysqld.so library.
Switch makefiles to use libtool to build libmysqld.so, as well as all its
dependencies.

The previous MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS() declaration is removed,
as it does not work well with a libtool build. Instead, plugins that need it
can specify an alternate object in MYSQL_PLUGIN_STATIC() that will be used for
embedded library. The plugin must then take care itself of compiling the
special object for embedded, rebuilding the source files previously listed in
MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS() with @plugin_embedded_defs@ in
CFLAGS/CXXFLAGS. The extra target @XXX_embedded_static_target@ is available
for the special object, this will be empty when --without-embedded-server.

All in-tree plugins are changed to build their static targets with libtool.
Additional plugins that want to work with libmysqld.so will need to be
similarly modified to build with libtool (or otherwise provide an -fPIC
object). Dynamically loaded plugins are not affected.

The old libraries like libmysys.a, libmyisam.a and similar libraries, which
were installed by `make install` though this is of little use, are still built
and installed to not break package scripts etc. that expect them. These
libraries are kept static to avoid introducing new .so dependencies.

The patch also fixes a handfull of duplicate symbol linker errors, where we
included some object twice during linking; these for one reason or another did
not produce errors before but caused problems on some platforms with this
patch (eg. Mac OS X linker is more strict for shared objects).

This patch only does what is necessary to build libmysqld.so. There are some
more cleanups that are possible now that we are using libtool more fully,
which could done in subsequent patches (though we may not bother as we are
switching from autotools to CMake anyway):

 - In libmysql_r/, we should be able to just link libmysys.la etc, instead of
   symlinking and re-compiling sources into the directory.

 - In libmysql/, we can similarly avoid symlinking and recompiling sources if
   we instead build a libmysys_nothread.la library with appropriate CFLAGS and
   link that.

 - In sql/, we can build a separate target libmysql_int.la with appropriate
   CFLAGS for embedded and use that in libmysqld/ instead of symlinking
   sources.

 - libmysys.a, libmyisam.a and similar libraries could be installed as .so
   also to save on code size; or alternatively could be not installed at all.


client/Makefile.am:
  Updated for using libtool
config/ac-macros/plugins.m4:
  Replace MUSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS with mechanism for plugins
  to specify alternate object for embedded.
configure.in:
  Fix linking duplicate objects related to THREAD_LOBJECTS.
dbug/Makefile.am:
  Updated for using libtool
extra/Makefile.am:
  Fix relative paths.
libmysqld/Makefile.am:
  Build libmysqld.la using libtool
libmysqld/examples/Makefile.am:
  Updated to use libtool
mysys/Makefile.am:
  Updated to use libtool.
  Fix linking duplicate objects related to THREAD_LOBJECTS.
mysys/my_uuid.c:
  Fix conflicting global mutex name by making it static.
regex/Makefile.am:
  Updated to use libtool
sql/Makefile.am:
  Updated to use libtool
sql/item_func.cc:
  Fix conflicting mutex name.
sql/mysql_priv.h:
  Fix conflicting mutex name
sql/mysqld.cc:
  Fix conflicting mutex name.
  Add missing call of my_uuid_end().
storage/archive/Makefile.am:
  Updated to use libtool
storage/archive/plug.in:
  Updated to use libtool
storage/blackhole/Makefile.am:
  Updated to use libtool
storage/blackhole/plug.in:
  Updated to use libtool
storage/csv/Makefile.am:
  Updated to use libtool
storage/csv/plug.in:
  Updated to use libtool
storage/example/Makefile.am:
  Updated to use libtool
storage/federated/Makefile.am:
  Updated to use libtool
storage/federated/plug.in:
  Updated to use libtool
storage/federatedx/Makefile.am:
  Updated to use libtool
storage/federatedx/plug.in:
  Updated to use libtool
storage/heap/Makefile.am:
  Updated to use libtool
storage/heap/plug.in:
  Updated to use libtool
storage/innobase/Makefile.am:
  Updated to use libtool
storage/innobase/plug.in.disabled:
  Updated to use libtool
storage/innodb_plugin/Makefile.am:
  Updated to use libtool
storage/maria/CMakeLists.txt:
  Fix linking duplicate object in maria_dump_log, causes failure on Mac OS X
storage/maria/Makefile.am:
  Updated to use libtool
  Fix linking duplicate object in maria_dump_log, causes link failure on Mac OS X
storage/maria/ma_loghandler.c:
  Move maria_dump_log code to separate file to fix duplicate object link failures.
storage/maria/ma_loghandler.h:
  Move maria_dump_log code to separate file to fix duplicate object link failures.
storage/maria/maria_dump_log.c:
  Move maria_dump_log code to separate file to fix duplicate object link failures.
storage/maria/plug.in:
  Updated to use libtool
storage/myisam/Makefile.am:
  Updated to use libtool
storage/myisam/plug.in:
  Updated to use libtool
storage/myisammrg/Makefile.am:
  Updated to use libtool
storage/myisammrg/plug.in:
  Updated to use libtool
storage/pbxt/plug.in:
  Updated to use libtool
storage/pbxt/src/Makefile.am:
  Updated to use libtool
storage/xtradb/Makefile.am:
  Updated to use libtool
storage/xtradb/plug.in:
  Updated to use libtool
strings/Makefile.am:
  Updated to use libtool
unittest/unit.pl:
  Don't attempt to run libtool internal files as unit tests.
vio/Makefile.am:
  Updated to use libtool
2010-11-17 13:24:20 +01:00
Tatiana A. Nurnberg
ccbc24b45a Bug#55436: buffer overflow in debug binary of dbug_buff in Field_new_decimal::store_value
There were some misunderstandings about parameters pertaining to buffer-size.

Patches fixes the reported off by one and
clarifies the documentation.

mysql-test/r/type_newdecimal.result:
  add test
mysql-test/t/type_newdecimal.test:
  add test
sql/field.cc:
  adjust buffer size by one to account for terminator.
sql/my_decimal.cc:
  adjust buffer size by one to account for terminator.
  clarify needs in comments.
sql/my_decimal.h:
  clarify buffer-size needs to prevent future off-by-one bugs.
strings/decimal.c:
  clarify buffer-size needs and parameters to prevent future off-by-one bugs
2010-11-11 09:46:49 +00:00
Tatiana A. Nurnberg
1c37eaaabf Bug #49752: 2469.126.2 unintentionally breaks authentication against
MySQL 5.1 server

Server used to clip overly long user-names. This was presumably lost
when code was made UTF8-clean.

Now we emulate the behaviour for backward compatibility, but UTF8-ly
correct.


mysql-test/r/connect.result:
  Show that user-names that are too long get clipped now.
mysql-test/t/connect.test:
  Show that user-names that are too long get clipped now.
sql/sql_connect.cc:
  Clip user-name to 16 characters (not bytes).
strings/CHARSET_INFO.txt:
  Clarify in docs.
2010-11-11 07:34:14 +00:00
Alexander Barkov
f91c6de211 Postfix for Bug#26474 Add Sinhala script (Sri Lanka) collation to MySQL 2010-11-09 11:08:02 +03:00
Davi Arnaut
6997cff459 Merge of mysql-5.1-bugteam into mysql-5.5-bugteam. 2010-10-20 17:02:59 -02:00
Davi Arnaut
f60106f82d Bug#45288: pb2 returns a lot of compilation warnings on linux
Fix assorted compiler warnings.

sql/mysqld.cc:
  Do not declare max_page_size twice. If large pages support
  is enabled, the code expects the size in max_desired_page_size.
storage/innobase/include/ibuf0ibuf.h:
  Remove trailing comma. Only present in C99.
  
  Approved by: Vasil (via IRC)
storage/innobase/include/row0row.h:
  Remove trailing comma. Only present in C99.
  
  Approved by: Vasil (via IRC)
strings/my_vsnprintf.c:
  No need to assert the obvious.
2010-10-08 11:52:39 -03:00
Michael Widenius
ca672e6b61 Automatic merge 2010-10-01 18:27:32 +03:00
Michael Widenius
bdba1d11c4 Change some my_bool in C++ classes and a few functions to bool to detect wrong usage of bool/my_bool.
Fix some bugs where we stored values other than 0 or 1 in my_bool
Fixed some compiler warnings


client/mysql.cc:
  Changed interrupted_query from my_bool to int, as we stored 2 in it.
client/mysqladmin.cc:
  Changed return variable type to same type as function value type
client/mysqltest.cc:
  Changed 'found' to int as we store other values than 0 or 1 into it
  Changed type for parameter of set_reconnect() to match usage.
extra/libevent/evbuffer.c:
  Added __attribute__((unused))
extra/libevent/event.c:
  Added __attribute__((unused))
extra/libevent/signal.c:
  Added __attribute__((unused))
sql/event_data_objects.h:
  my_bool -> bool
sql/event_db_repository.cc:
  my_bool -> bool
sql/event_db_repository.h:
  my_bool -> bool
sql/event_parse_data.h:
  my_bool -> bool
sql/events.cc:
  my_bool -> bool
sql/events.h:
  my_bool -> bool
sql/field.cc:
  my_bool -> bool
sql/field.h:
  my_bool -> bool
sql/hash_filo.h:
  my_bool -> bool
sql/item.cc:
  my_bool -> bool
sql/item.h:
  my_bool -> bool
sql/item_cmpfunc.h:
  my_bool -> bool
  Changed result_for_null_param from my_bool to int as we stored -1 in it.
sql/item_func.cc:
  my_bool -> bool
  Modified udf wrapper functions so that the UDF functions would continue to use my_bool. (To keep compatibility with UDF:s)
sql/item_func.h:
  my_bool -> bool
sql/item_subselect.h:
  my_bool -> bool
sql/item_sum.cc:
  Modified udf wrapper functions so that the UDF functions would continue to use my_bool. (To keep compatibility with UDF:s)
sql/parse_file.h:
  my_bool -> bool
sql/rpl_mi.h:
  my_bool -> bool
sql/sp_rcontext.h:
  my_bool -> bool
sql/sql_analyse.h:
  my_bool -> bool
sql/sql_base.cc:
  Change some assignments so that we don't initialize bool variables with int's.
sql/sql_bitmap.h:
  my_bool -> bool
sql/sql_cache.cc:
  my_bool -> bool
sql/sql_cache.h:
  my_bool -> bool
sql/sql_class.h:
  my_bool -> bool
sql/sql_insert.cc:
  Change some assignments so that we don't initialize bool variables with int's.
sql/sql_prepare.cc:
  my_bool -> bool
sql/table.h:
  my_bool -> bool
storage/maria/ma_check.c:
  Removed duplicate assignment
strings/decimal.c:
  Fixed wrong variable usage.
  Don't do complex arithmetic on bool when simple works.
2010-09-24 01:00:32 +03:00
Olav Sandstaa
77844bd10b Fix for Bug#54478 "mysqld crashes during boot when running mtr with --debug option"
The crash during boot was caused by a DBUG_PRINT statement in fill_schema_schemata() (in
sql_show.cc). This DBUG_PRINT statement contained several instances of %s in the format 
string and for one of these we gave a NULL pointer as the argument. This caused the
call to vsnprintf() to crash when running on Solaris.
      
The fix for this problem is to replace the call to vsnprintf() with my_vsnprintf()
which handles that a NULL pointer is passed as argumens for %s.

This patch also extends my_vsnprintf() to support %i in the format string.

dbug/dbug.c:
  Replace the use of vsnprintf() with my_vsnprintf(). On some platforms
  vsnprintf() did not handle that a NULL pointer was given as an argument
  for a %s in the format string.
include/mysql/service_my_snprintf.h:
  Add support for %i in format string to my_vsnprintf().
strings/my_vsnprintf.c:
  Add support for %i in format string to my_vsnprintf().
unittest/mysys/my_vsnprintf-t.c:
  Add unit tests for %i in format string to my_vsnprintf().
2010-09-15 13:33:22 +02:00
Sergei Golubchik
a3d80d952d merge with 5.1 2010-09-11 20:43:48 +02:00
Alexander Nozdrin
9e4928af69 Bug#55980 Character sets: supplementary character _bin ordering is wrong
Problem:
- ORDER BY for utf8mb4_bin, utf16_bin and utf32_bin returned
  results in a wrong order, because old functions
  (supporting only BMP range) were used to handle these collations.
- Additionally, utf16_bin did not sort supplementary characters
  between U+D700 and U+E000, as WL#1213 specification specified.

include/m_ctype.h:
  Adding prototypes.
mysql-test/include/ctype_filesort2.inc:
  Adding a new shared test file.
mysql-test/t/ctype_utf8mb4.test:
  Adding tests.
strings/ctype-ucs2.c:
  - Fixing my_strncoll[sp]_utf16_bin to compare
    binary representation instead of code points,
    to make columns with indexes sort correct.
  - Fixing my_collation_handler_utf32_bin and
    my_collation_handler_utf16_bin to use new
    functions.
strings/ctype-utf8.c:
  - Adding my_strnxfrm[len]_unicode_fill_bin()
    to handle utf8mb4_bin, utf16_bin and utf32_bin,
    using 3 bytes per weight.
    This function also performs special reordering in case of utf16_bin.
  - Fixing my_collation_utf8mb4_bin handler to use the
    new function.
2010-08-31 17:54:26 +04:00
Michael Widenius
7b91240bba Fixed build & test failures in buildbot
mysql-test/t/bug46080-master.opt:
  Lower limits to be able to run tests
regex/main.c:
  Fixed compiler warnings
storage/maria/ma_key_recover.c:
  Fixed compiler warnings
storage/maria/ma_recovery.c:
  Fixed compiler warnings
storage/maria/ma_unique.c:
  Fixed compiler warnings
strings/ctype-uca.c:
  Added comment
strings/xml.c:
  Fixed compiler warnings
support-files/compiler_warnings.supp:
  Added suppressions for windows
unittest/strings/strings-t.c:
  Added ifdef to fix compilation failure when compiling without UCA
2010-08-28 16:51:09 +03:00