Commit graph

59 commits

Author SHA1 Message Date
Alexander Barkov
6075f12c65 MDEV-31071 Refactor case folding data types in Unicode collations
This is a non-functional change. It changes the way how case folding data
and weight data (for simple Unicode collations) are stored:

- Removing data types MY_UNICASE_CHARACTER, MY_UNICASE_INFO
- Using data types MY_CASEFOLD_CHARACTER, MY_CASEFOLD_INFO instead.

This patch changes simple Unicode collations in a similar way
how MDEV-30695 previously changed Asian collations.

No new MTR tests are needed. The underlying code is thoroughly
covered by a number of ctype_*_ws.test and ctype_*_casefold.test
files, which were added recently as a preparation
for this change.

Old and new Unicode data layout
-------------------------------

Case folding data is now stored in separate tables
consisting of MY_CASEFOLD_CHARACTER elements with two members:

    typedef struct casefold_info_char_t
    {
      uint32 toupper;
      uint32 tolower;
    } MY_CASEFOLD_CHARACTER;

while weight data (for simple non-UCA collations xxx_general_ci
and xxx_general_mysql500_ci) is stored in separate arrays of
uint16 elements.

Before this change case folding data and simple weight data were
stored together, in tables of the following elements with three members:

    typedef struct unicase_info_char_st
    {
      uint32 toupper;
      uint32 tolower;
      uint32 sort;          /* weights for simple collations */
    } MY_UNICASE_CHARACTER;

This data format was redundant, because weights (the "sort" member) were
needed only for these two simple Unicode collations:
- xxx_general_ci
- xxx_general_mysql500_ci

Adding case folding information for Unicode-14.0.0 using the old
format would waste memory without purpose.

Detailed changes
----------------
- Changing the underlying data types as described above

- Including unidata-dump.c into the sources.
  This program was earlier used to dump UnicodeData.txt
  (e.g. https://www.unicode.org/Public/14.0.0/ucd/UnicodeData.txt)
  into MySQL / MariaDB source files.
  It was originally written in 2002, but has not been distributed yet
  together with MySQL / MariaDB sources.

- Removing the old format Unicode data earlier dumped from UnicodeData.txt
  (versions 3.0.0 and 5.2.0) from ctype-utf8.c.
  Adding Unicode data in the new format into separate header files,
  to maintain the code easier:

    - ctype-unicode300-casefold.h
    - ctype-unicode300-casefold-tr.h
    - ctype-unicode300-general_ci.h
    - ctype-unicode300-general_mysql500_ci.h
    - ctype-unicode520-casefold.h

- Adding a new file ctype-unidata.c as an aggregator for
  the header files listed above.
2023-04-18 11:29:25 +04:00
Helmut Grohne
6f6fa3bec2 MDEV-30694: Cross building on x86_64 to arch i686 fails
Currently cross compilation on x86_64 to arch i686 fails
with error:

> ctype-uca1400data.h
/bin/sh: 1: uca-dump: not found

Commit makes sure that uca-dump is treated correctly
when cross compiling MariaDB to another architecture
2023-02-22 16:01:46 +00:00
Alexander Barkov
133446828c MDEV-27009 Add UCA-14.0.0 collations
- Added one neutral and 22 tailored (language specific) collations based on
  Unicode Collation Algorithm version 14.0.0.

  Collations were added for Unicode character sets
  utf8mb3, utf8mb4, ucs2, utf16, utf32.

  Every tailoring was added with four accent and case
  sensitivity flag combinations, e.g:

  * utf8mb4_uca1400_swedish_as_cs
  * utf8mb4_uca1400_swedish_as_ci
  * utf8mb4_uca1400_swedish_ai_cs
  * utf8mb4_uca1400_swedish_ai_ci

  and their _nopad_ variants:

  * utf8mb4_uca1400_swedish_nopad_as_cs
  * utf8mb4_uca1400_swedish_nopad_as_ci
  * utf8mb4_uca1400_swedish_nopad_ai_cs
  * utf8mb4_uca1400_swedish_nopad_ai_ci

- Introducing a conception of contextually typed named collations:

  CREATE DATABASE db1 CHARACTER SET utf8mb4;
  CREATE TABLE db1.t1 (a CHAR(10) COLLATE uca1400_as_ci);

  The idea is that there is no a need to specify the character set prefix
  in the new collation names. It's enough to type just the suffix
  "uca1400_as_ci". The character set is taken from the context.

  In the above example script the context character set is utf8mb4.
  So the CREATE TABLE will make a column with the collation
  utf8mb4_uca1400_as_ci.

  Short collations names can be used in any parts of the SQL syntax
  where the COLLATE clause is understood.

- New collations are displayed only one time
  (without character set combinations) by these statements:

     SELECT * FROM INFORMATION_SCHEMA.COLLATIONS;
     SHOW COLLATION;

  For example, all these collations:
  - utf8mb3_uca1400_swedish_as_ci
  - utf8mb4_uca1400_swedish_as_ci
  - ucs2_uca1400_swedish_as_ci
  - utf16_uca1400_swedish_as_ci
  - utf32_uca1400_swedish_as_ci
  have just one entry in INFORMATION_SCHEMA.COLLATIONS and SHOW COLLATION,
  with COLLATION_NAME equal to "uca1400_swedish_as_ci", which is the suffix
  without the character set name:

SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLLATIONS
WHERE COLLATION_NAME LIKE '%uca1400_swedish_as_ci';

+-----------------------+
| COLLATION_NAME        |
+-----------------------+
| uca1400_swedish_as_ci |
+-----------------------+

  Note, the behaviour of old collations did not change.
  Non-unicode collations (e.g. latin1_swedish_ci) and
  old UCA-4.0.0 collations (e.g. utf8mb4_unicode_ci)
  are still displayed with the character set prefix, as before.

- The structure of the table INFORMATION_SCHEMA.COLLATIONS was changed.

  The NOT NULL constraint was removed from these columns:
  - CHARACTER_SET_NAME
  - ID
  - IS_DEFAULT
  and from the corresponding columns in SHOW COLLATION.

  For example:

SELECT COLLATION_NAME, CHARACTER_SET_NAME, ID, IS_DEFAULT
FROM INFORMATION_SCHEMA.COLLATIONS
WHERE COLLATION_NAME LIKE '%uca1400_swedish_as_ci';
+-----------------------+--------------------+------+------------+
| COLLATION_NAME        | CHARACTER_SET_NAME | ID   | IS_DEFAULT |
+-----------------------+--------------------+------+------------+
| uca1400_swedish_as_ci | NULL               | NULL | NULL       |
+-----------------------+--------------------+------+------------+

  The NULL value in these columns now means that the collation
  is applicable to multiple character sets.
  The behavioir of old collations did not change.
  Make sure your client programs can handle NULL values in these columns.

- The structure of the table
  INFORMATION_SCHEMA.COLLATION_CHARACTER_SET_APPLICABILITY was changed.

  Three new NOT NULL columns were added:
  - FULL_COLLATION_NAME
  - ID
  - IS_DEFAULT

  New collations have multiple entries in COLLATION_CHARACTER_SET_APPLICABILITY.
  The column COLLATION_NAME contains the collation name without the character
  set prefix. The column FULL_COLLATION_NAME contains the collation name with
  the character set prefix.

  Old collations have full collation name in both FULL_COLLATION_NAME and
  COLLATION_NAME.

SELECT COLLATION_NAME, FULL_COLLATION_NAME, CHARACTER_SET_NAME, ID, IS_DEFAULT
FROM INFORMATION_SCHEMA.COLLATION_CHARACTER_SET_APPLICABILITY
WHERE FULL_COLLATION_NAME RLIKE '^(utf8mb4|latin1).*swedish.*ci$';
+-----------------------------+-------------------------------------+--------------------+------+------------+
| COLLATION_NAME              | FULL_COLLATION_NAME                 | CHARACTER_SET_NAME | ID   | IS_DEFAULT |
+-----------------------------+-------------------------------------+--------------------+------+------------+
| latin1_swedish_ci           | latin1_swedish_ci                   | latin1             |    8 | Yes        |
| latin1_swedish_nopad_ci     | latin1_swedish_nopad_ci             | latin1             | 1032 |            |
| utf8mb4_swedish_ci          | utf8mb4_swedish_ci                  | utf8mb4            |  232 |            |
| uca1400_swedish_ai_ci       | utf8mb4_uca1400_swedish_ai_ci       | utf8mb4            | 2368 |            |
| uca1400_swedish_as_ci       | utf8mb4_uca1400_swedish_as_ci       | utf8mb4            | 2370 |            |
| uca1400_swedish_nopad_ai_ci | utf8mb4_uca1400_swedish_nopad_ai_ci | utf8mb4            | 2372 |            |
| uca1400_swedish_nopad_as_ci | utf8mb4_uca1400_swedish_nopad_as_ci | utf8mb4            | 2374 |            |
+-----------------------------+-------------------------------------+--------------------+------+------------+

- Other INFORMATION_SCHEMA queries:

  SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS;
  SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.PARAMETERS;
  SELECT TABLE_COLLATION FROM INFORMATION_SCHEMA.TABLES;
  SELECT DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA;
  SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.ROUTINES;
  SELECT COLLATION_CONNECTION FROM INFORMATION_SCHEMA.EVENTS;
  SELECT DATABASE_COLLATION FROM INFORMATION_SCHEMA.EVENTS;
  SELECT COLLATION_CONNECTION FROM INFORMATION_SCHEMA.ROUTINES;
  SELECT DATABASE_COLLATION FROM INFORMATION_SCHEMA.ROUTINES;
  SELECT COLLATION_CONNECTION FROM INFORMATION_SCHEMA.TRIGGERS;
  SELECT DATABASE_COLLATION FROM INFORMATION_SCHEMA.TRIGGERS;
  SELECT COLLATION_CONNECTION FROM INFORMATION_SCHEMA.VIEWS;

  display full collation names, including character sets prefix,
  for all collations, including new collations.

  Corresponding SHOW commands also display full collation names
  in collation related columns:

  SHOW CREATE TABLE t1;
  SHOW CREATE DATABASE db1;
  SHOW TABLE STATUS;
  SHOW CREATE FUNCTION f1;
  SHOW CREATE PROCEDURE p1;
  SHOW CREATE EVENT ev1;
  SHOW CREATE TRIGGER tr1;
  SHOW CREATE VIEW;

  These INFORMATION_SCHEMA queries and SHOW statements may change in
  the future, to display show collation names.
2022-08-10 15:04:24 +02:00
Alexander Barkov
bb84f61a26 MDEV-27009 Add UCA-14.0.0 collations - adding uca-dump into build targets
- Adding uca-dump into build targets
- Adding ctype-uca.h and moving implicit weight related routines there
- Reusing implicit weight routines in ctype-uca.c and uca-dump.c
- Adding handling of command line arguments to uca-dump
- Fixing some compile-time warnings in uca-dump.c
2022-08-10 15:03:35 +02:00
Eric Herman
105e4148bf Add json_normalize function to json_lib
This patch implements a library for normalizing json documents.
The algorithm is:
* Recursively sort json keys according to utf8mb4_bin collation.
* Normalize numbers to be of the form [-]<digit>.<frac>E<exponent>
* All unneeded whitespace and line endings are removed.
* Arrays are not sorted.

Co-authored-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
2021-07-21 16:32:11 +03:00
Vladislav Vaintroub
d50f776930 MDEV-22454 Allow -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
Disable IPO (interprocedural optimization, aka /GL) on Windows
on libraries, from which server.dll exports symbols -  exporting symbols
does not work for objects compiled with /GL.
2020-05-04 14:17:06 +02:00
Marko Mäkelä
26a14ee130 Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
Vicențiu Ciorbaru
cb248f8806 Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
Vicențiu Ciorbaru
5543b75550 Update FSF Address
* Update wrong zip-code
2019-05-11 21:29:06 +03:00
Vladislav Vaintroub
59990747bc Merge remote-tracking branch 'origin/10.1' into 10.2 2018-01-06 17:39:50 +00:00
Vladislav Vaintroub
3a22d6c136 Fix conf_to_src build.
2cd3169113 broke conf_to_src,
because strings library is now dependend on mysys (my_alloc etc are used
now directly in string lib)

Fix by adding appropriate dependency.

Also exclude conf_to_src from VS IDE builds. EXCLUDE_FROM_ALL
is not enough for that.
2018-01-05 18:22:57 +00:00
Vicențiu Ciorbaru
985d2d393c Merge remote-tracking branch 'origin/10.1' into 10.2 2017-12-22 12:23:39 +02:00
Sergey Vojtovich
2cd3169113 MDEV-14265 - RPMLint warning: shared-lib-calls-exit
find_type_or_exit() client helper did exit(1) on error, exit(1) moved to
clients.

mysql_read_default_options() did exit(1) on error, error is passed through and
handled now.

my_str_malloc_default() did exit(1) on error, replaced my_str_ allocator
functions with normal my_malloc()/my_realloc()/my_free().

sql_connect.cc did many exit(1) on hash initialisation failure. Removed error
check since my_hash_init() never fails.

my_malloc() did exit(1) on error. Replaced with abort().

my_load_defaults() did exit(1) on error, replaced with return 2.

my_load_defaults() still does exit(0) when invoked with --print-defaults.
2017-12-19 19:10:54 +04:00
Vicențiu Ciorbaru
22c322c649 Merge branch '10.1' into 10.2 2017-09-19 12:43:02 +03:00
Vladislav Vaintroub
a46679dcf7 Build improvements and cleanups.
- the probably ultimate fix for dependencies on VS
- remove some GET_TARGET_PROPERTY(LOCATION ...), they are deprecated in
cmake 3.9
- simplify signing targets on Windows.
- remove INSTALL_DEBUG_TARGET, we do not mix binaries from different builds
in the same package
2017-09-08 18:22:15 +00:00
Alexey Botchkov
27025221fe MDEV-9143 JSON_xxx functions.
strings/json_lib.c added as a JSON library.
        SQL frunction added with sql/item_jsonfunc.h/cc
2016-10-19 14:10:03 +04:00
Sergei Golubchik
36bf482db1 MDEV-8285 compile fails under Mac OS X 10.6.8 due to use of strnlen
#include <m_string.h> where strnlen() is used
2015-06-14 15:51:34 +02:00
Sergei Golubchik
1c6ad62a26 mysql-5.5.39 merge
~40% bugfixed(*) applied
~40$ bugfixed reverted (incorrect or we're not buggy)
~20% bugfixed applied, despite us being not buggy
(*) only changes in the server code, e.g. not cmakefiles
2014-08-02 21:26:16 +02:00
Sergei Golubchik
6fb17a0601 5.5.39 merge 2014-08-07 18:06:56 +02:00
Tor Didriksen
918837f728 Backport from trunk:
Bug#18187290 ISSUE WITH BUILDING MYSQL USING CMAKE 2.8.12

We want to upgrade to VS2013 on Windows.
In order to do this, we need to upgrade to cmake 2.8.12
This has introduced some incompatibilities for .pdb files,
and "make install" no longer works.

To reproduce:
  cmake --build . --target package --config debug

The fix:
Rather than installing .pdb files for static libraries, we use the /Z7 flag
to store symbolic debugging information in the .obj files.
2014-05-07 17:09:14 +02:00
Sergei Golubchik
0dc23679c8 10.0-base merge 2014-02-26 15:28:07 +01: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
Sergei Golubchik
72c20282db 10.0-base merge 2014-02-03 15:22:39 +01:00
Sergei Golubchik
37d240ecf9 MySQL-5.5.35 merge 2014-01-22 15:29:36 +01:00
Murthy Narkedimilli
c92223e198 Updated/added copyright headers 2014-01-06 10:52:35 +05:30
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
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
4f435bddfd 5.3 merge 2012-01-13 15:50:02 +01:00
Michael Widenius
6920457142 Merge with MariaDB 5.1 2011-11-24 18:48:58 +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
Kent Boortz
68f00a5686 Updated/added copyright headers 2011-06-30 17:37:13 +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
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
Sergei Golubchik
65ca700def merge.
checkpoint.
does not compile.
2010-11-25 18:17:28 +01:00
Michael Widenius
ad6d95d3cb Merge with MySQL 5.1.50
- Changed to still use bcmp() in certain cases becasue
  - Faster for short unaligneed strings than memcmp()
  - Bettern when using valgrind
- Changed to use my_sprintf() instead of sprintf() to get higher portability for old systems
- Changed code to use MariaDB version of select->skip_record()
- Removed -%::SCCS/s.% from Makefile.am:s to remove automake warnings
2010-08-27 17:12:44 +03:00
Alexander Nozdrin
8b645bed97 Patch for Bug#55854 (MySQL AB should not be AUTHOR, copyright incorrect).
Fixing copyright text.
2010-08-12 19:19:57 +04:00
Vladislav Vaintroub
568c26631c Cleanup after bild team push.
* Fixed obvious errors (HAVE_BROKEN_PREAD is not true for on any
of systems we use, definitely not on HPUX)

* Remove other junk flags for OSX and HPUX

* Avoid checking type sizes in universal builds on OSX, again 
(CMake2.8.0 fails is different architectures return different results)

* Do not compile template instantiation stuff unless 
EXPLICIT_TEMPLATE_INSTANTIATION is used.

* Some cleanup (make gen_lex_hash simpler, avoid dependencies)

* Exclude some unused files from compilation (strtol.c etc)
2010-07-25 19:30:18 +02:00
Davi Arnaut
507ca08ff6 WL#5498: Remove dead and unused source code
Remove unused string functions.

include/m_string.h:
  Remove prototypes for unused string functions and for functions
  that do not exist anymore.
2010-07-23 17:17:14 -03:00
Davi Arnaut
7a344b6106 WL#5498: Remove dead and unused source code
Remove the obsolete and buggy bmove512, use memcpy instead.
2010-07-23 17:15:41 -03:00
Davi Arnaut
54a5c00de9 Unset the execute bit where it's not needed. 2010-07-03 20:17:03 -03:00
Davi Arnaut
5641fb64b4 Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-07-02 16:38:04 -03:00
Davi Arnaut
0eb26fdfa8 Bug#53445: Build with -Wall and fix warnings that it generates
Apart strict-aliasing warnings, fix the remaining warnings
generated by GCC 4.4.4 -Wall and -Wextra flags.

One major source of warnings was the in-house function my_bcmp
which (unconventionally) took pointers to unsigned characters
as the byte sequences to be compared. Since my_bcmp and bcmp
are deprecated functions whose only difference with memcmp is
the return value, every use of the function is replaced with
memcmp as the special return value wasn't actually being used
by any caller.

There were also various other warnings, mostly due to type
mismatches, missing return values, missing prototypes, dead
code (unreachable) and ignored return values.

BUILD/SETUP.sh:
  Remove flags that are implied by -Wall and -Wextra.
  Do not warn about unused parameters in C++.
BUILD/check-cpu:
  Print only the compiler version instead of verbose banner.
  Although the option is gcc specific, the check was only
  being used for GCC specific checks anyway.
client/mysql.cc:
  bcmp is no longer defined.
client/mysqltest.cc:
  Pass a string to function expecting a format string.
  Replace use of bcmp with memcmp.
cmd-line-utils/readline/Makefile.am:
  Always define _GNU_SOURCE when compiling GNU readline.
  Required to make certain prototypes visible.
cmd-line-utils/readline/input.c:
  Condition for the code to be meaningful.
configure.in:
  Remove check for bcmp.
extra/comp_err.c:
  Use appropriate type.
extra/replace.c:
  Replace use of bcmp with memcmp.
extra/yassl/src/crypto_wrapper.cpp:
  Do not ignore the return value of fgets. Retrieve the file
  position if fgets succeed -- if it fails, the function will
  bail out and return a error.
extra/yassl/taocrypt/include/blowfish.hpp:
  Use a single array instead of accessing positions of the sbox_
  through a subscript to pbox_.
extra/yassl/taocrypt/include/runtime.hpp:
  One definition of such functions is enough.
extra/yassl/taocrypt/src/aes.cpp:
  Avoid potentially ambiguous conditions.
extra/yassl/taocrypt/src/algebra.cpp:
  Rename arguments to avoid shadowing related warnings.
extra/yassl/taocrypt/src/blowfish.cpp:
  Avoid potentially ambiguous conditions.
extra/yassl/taocrypt/src/integer.cpp:
  Do not define type within a anonymous union.
  Use a variable to return a value instead of
  leaving the result in a register -- compiler
  does not know the logic inside the asm.
extra/yassl/taocrypt/src/misc.cpp:
  Define handler for pure virtual functions.
  Remove unused code.
extra/yassl/taocrypt/src/twofish.cpp:
  Avoid potentially ambiguous conditions.
extra/yassl/testsuite/test.hpp:
  Function must have C language linkage.
include/m_string.h:
  Remove check which relied on bcmp being defined -- they weren't
  being used as bcmp is only visible when _BSD_SOURCE is defined.
include/my_bitmap.h:
  Remove bogus helpers which were used only in a few files and
  were causing warnings about dead code.
include/my_global.h:
  Due to G++ bug, always silence false-positive uninitialized
  variables warnings when compiling C++ code with G++.
  Remove bogus helper.
libmysql/Makefile.shared:
  Remove built-in implementation of bcmp.
mysql-test/lib/My/SafeProcess/safe_process.cc:
  Cast pid to largest possible type for a process identifier.
mysys/mf_loadpath.c:
  Leave space of the ending nul.
mysys/mf_pack.c:
  Replace bcmp with memcmp.
mysys/my_bitmap.c:
  Dead code removal.
mysys/my_gethwaddr.c:
  Remove unused variable.
mysys/my_getopt.c:
  Silence bogus uninitialized variable warning.
  Do not cast away the constant qualifier.
mysys/safemalloc.c:
  Cast to expected type.
mysys/thr_lock.c:
  Silence bogus uninitialized variable warning.
sql/field.cc:
  Replace bogus helper with a more appropriate logic which is
  used throughout the code.
sql/item.cc:
  Remove bogus logical condition which always evaluates to TRUE.
sql/item_create.cc:
  Simplify code to avoid signedness related warnings.
sql/log_event.cc:
  Replace use of bcmp with memcmp.
  No need to use helpers for simple bit operations.
sql/log_event_old.cc:
  Replace bmove_align with memcpy.
sql/mysqld.cc:
  Move use declaration of variable to the ifdef block where it
  is used. Remove now-unnecessary casts and arguments.
sql/set_var.cc:
  Replace bogus helpers with simple and classic bit operations.
sql/slave.cc:
  Cast to expected type and silence bogus warning.
sql/sql_class.h:
  Don't use enum values as bit flags, the supposed type safety is
  bogus as the combined bit flags are not a value in the enumeration.
sql/udf_example.c:
  Only declare variable when necessary.
sql/unireg.h:
  Replace use of bmove_align with memcpy.
storage/innobase/os/os0file.c:
  Silence bogus warning.
storage/myisam/mi_open.c:
  Remove bogus cast, DBUG_DUMP expects a pointer to unsigned
  char.
storage/myisam/mi_page.c:
  Remove bogus cast, DBUG_DUMP expects a pointer to unsigned
  char.
strings/bcmp.c:
  Remove built-in bcmp.
strings/ctype-ucs2.c:
  Silence bogus warning.
tests/mysql_client_test.c:
  Use a appropriate type as expected by simple_command().
2010-07-02 15:30:47 -03:00
Bo Thorsen
5c4e95f83b Implement an NSIS based installer 2010-06-25 15:09:45 +02:00
Vladislav Vaintroub
cd45a44180 Post-merge fixes , define HAVE_RWLOCK_T on Solaris define
DISABLE_MYSQL_THREAD_H for strings
Also, enable unittests for perfschema
2010-01-14 18:42:28 +00:00
Vladislav Vaintroub
541edcc2e4 merge 2009-12-25 16:49:21 +01:00
Alexey Kopytov
12f364ece7 Backport of WL #2934: Make/find library for doing float/double
to string conversions and vice versa" 
Initial import of the dtoa.c code and custom wrappers around it 
to allow its usage from the server code. 
 
Conversion of FLOAT/DOUBLE values to DECIMAL ones or strings 
and vice versa has been significantly reworked. As the new 
algoritms are more precise than the older ones, results of such 
conversions may not always match those obtained from older 
server versions. This in turn may break compatibility for some 
applications. 
 
This patch also fixes the following bugs: 
- bug #12860 "Difference in zero padding of exponent between 
Unix and Windows" 
- bug #21497 "DOUBLE truncated to unusable value" 
- bug #26788 "mysqld (debug) aborts when inserting specific 
numbers into char fields" 
- bug #24541 "Data truncated..." on decimal type columns 
without any good reason"
2009-12-22 19:23:13 +03:00
Vladislav Vaintroub
23cd3cec41 Remove STATIC from ADD_CONVENIENCE_LIBRARY on 2 places 2009-11-25 02:11:01 +01:00
Vladislav Vaintroub
7377c50cb4 implement convenience libraries 2009-11-24 23:15:47 +00:00
Vladislav Vaintroub
bc76ad8f6b WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
  WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
  Add new file
BUILD/autorun.sh:
  WL#5161 : use choose_configure instead of autotools configure script
  (choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
  WL#5161 : use choose_configure instead of autotools configure script
  (choose configure will call cmake if cmake is available)
CMakeLists.txt:
  WL#5161 : Rewrite top-level CMakeLists.txt. 
  Remove  Windows specifics
  - compiler flags handling moved to configure.cmake
  - storage engine/plugin stuff moved into cmake/plugin.cmake
  - copy docs
Makefile.am:
  Added new files
client/CMakeLists.txt:
  WL#5161 : Rewrite CMakeLists.txt to be platform-independent
  Handle packagng (add INSTALL commands)
cmake/Makefile.am:
  WL#5161 : use choose_configure instead of autotools configure script
  (choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
  Custom targets for abi_check (for cmake)
cmake/bison.cmake:
  - Check bison availability
  - Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
  Add helper script to concatenate files.
cmake/character_sets.cmake:
  Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
  Helper script to check the minimum required version of cmake
cmake/configure.pl:
  Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
  Add script helper to create initial database. 
  (on Windows, we pack initial db with the redistribution
  package)
cmake/do_abi_check.cmake:
  Perform abi check
cmake/dtrace.cmake:
  Handle dtrace in CMake Build.
  Check for dtrace availablility,
  run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
  Run dtrace -G on Solaris in pre-link step,
  link the object it creates together with library or
  executable
cmake/install_macros.cmake:
  Helper macros for packaging
  (install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
  "make dist" - 
  - pack autotools ./configure script with the source
  (renamed to configure.am)
  - pack bison output
cmake/merge_archives_unix.cmake.in:
  script to merge static libraries on Unix
cmake/misc.cmake:
  Build helper macros
  - MERGE_STATIC_LIBS 
  We use it when building client library and embedded
  (avoid recompilation)
  
  - Convert source file paths to absolute names.
  We use it in  to locate files of a different project,
  when the files need to be recompiled (e.g in embedded
  several storage engines are recompiled with 
  -DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
  Extract version info from configure.in
  Handle package names.
cmake/plugin.cmake:
  Rewrote storage/mysql_storage_engine.cmake to handle 
  other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
  Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
  Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
  Helper to check stack direction.
cmake/zlib.cmake:
  Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
  Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
  Add new file
cmd-line-utils/readline/CMakeLists.txt:
  Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
  Add new file
config.h.cmake:
  WL#5161 : Add config.h template for cmake
configure.cmake:
  WL#5161 : Add platform tests ( for cmake)
configure.in:
  Added new subdirectories
dbug/CMakeLists.txt:
  WL#5161
extra/CMakeLists.txt:
  WL#5161
extra/yassl/CMakeLists.txt:
  WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
  WL#5161
include/Makefile.am:
  Add new file
include/keycache.h:
  remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
  use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
  - Move thread_safe_increment from config-win.h to other headers
  (config-win.h is not used anymore)
  - Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
  Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and 
  with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
  Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
  remove rf_SetTimer that used to be defined in config-win.h
  Replace with UINT_PTR (we do not use config-win.h anymore
  and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
  Avoid pointless recompilation of source files 
  in client library if possible. Merge static 
  libs (dbug, mysys) to create static client 
  library.
libmysqld/CMakeLists.txt:
  Avoid pointless recompilation of source files 
  when building embedded. Instead, merge dbug and 
  mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
  Embedded compilation on Unix
libmysqld/lib_sql.cc:
  Do not define THD::clear_error() in lib_sql.cc
  for embedded. Instead, use the same inline 
  definition from sql_class.h as in none-embedded 
  case (fixes duplicate symbol errors on Windows
  and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
  Install man files.
man/Makefile.am:
  Add new file.
mysql-test/CMakeLists.txt:
  Install mysql-test files
mysql-test/Makefile.am:
  Add new files
mysql-test/lib/My/ConfigFactory.pm:
  Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
  the build configurations are now also available on Unix
  Xcode on Mac uses the Release, RelwithDebinfo and Debug 
  subdirectories for executables. Earlier, build configurations 
  were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
  Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
  Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
  add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
  Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
  define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined 
  (can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
  Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
  Allow testing with mtr in out-of-source builds.
  Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
  This test can now run on Windows as well.
mysys/CMakeLists.txt:
  Port CMakeLists.txt to Unix
mysys/my_create.c:
  config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
  config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
  Add  win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
  config-win.h is dead => include <sys/stat.h> where it is used
  fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
  Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
  Add new file
plugin/fulltext/CMakeLists.txt:
  Compile full-text example with CMake
plugin/fulltext/Makefile.am:
  Add new file.
plugin/semisync/CMakeLists.txt:
  Fix semisync to use common  macro for plugins.
regex/CMakeLists.txt:
  Use absolute filenames, when adding regex library 
  (we recompile files in embedded, and want to locate 
  sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
  Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
  Add configure/install for scripts
sql-bench/CMakeLists.txt:
  install sql-bench files
sql-bench/Makefile.am:
  Add new file
sql/CMakeLists.txt:
  Port CmakeLists.txt to Unix
sql/nt_servc.cc:
  compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
  Install charsets
sql/share/Makefile.am:
  Add new file
sql/sql_builtin.cc.in:
  Handle pure-C plugins on Windows.
sql/sql_class.h:
  Use the same clear_error macro in embedded and not embedded.
  Fixes pointless #ifdef and avoids duplicate symbols when linking
  on Windows.
storage/Makefile.am:
  storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
  Add names for static and dynamic plugin libraries.
  Link archive with zlib
storage/blackhole/CMakeLists.txt:
  Add names for static and dynamic storage 
  engine libraries
storage/csv/CMakeLists.txt:
  Add names for static and dynamic storage engine
  libraries
storage/example/CMakeLists.txt:
  Add names for static and dynamic storage engine 
  libraries
storage/federated/CMakeLists.txt:
  Add names for static and dynamic storage engine 
  libraries
storage/heap/CMakeLists.txt:
  Add names for static and dynamic storage engine 
  libraries
storage/ibmdb2i/CMakeLists.txt:
  Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
  Run system checks.
  
  Add names for static and dynamic storage engine 
  libraries.
storage/innobase/include/page0page.ic:
  Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
  Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
  Add names for static and dynamic storage engine 
  libraries
storage/mysql_storage_engine.cmake:
  storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
  Configure and install some files from support-files.
support-files/Makefile.am:
  Add new file
tests/CMakeLists.txt:
  In general case, mysqlclient library can be dependent
  on C++ runtime(if it includes yassl and is not compiled
  with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
  Add unit tests
unittest/mysys/Makefile.am:
  Add new file
unittest/mytap/CMakeLists.txt:
  Add library for unit tests
unittest/mytap/Makefile.am:
  Add new file
unittest/mytap/tap.c:
  fix function definitions to match declarations
win/create_def_file.js:
  Fix link error with intel compiler (icl 
  defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
Vladislav Vaintroub
eaba74fee5 Backport http://lists.mysql.com/commits/57778
2677 Vladislav Vaintroub	2008-11-04
CMakeLists.txt files cleanup
- remove SAFEMALLOC and SAFE_MUTEX definitions that were 
present in *each* CMakeLists.txt. Instead, put them into top level 
CMakeLists.txt, but disable on Windows, because
a) SAFEMALLOC does not add any functionality that is not already
present in Debug C runtime ( and 2 safe malloc one on top of the other 
only unnecessarily slows down the server) 
      
b)SAFE_MUTEX does not work on Windows  and have been
explicitely  disabled on Windows with #undef previously.  Fortunately,
ntdll does  pretty good  job identifying l problems with 
CRITICAL_SECTIONs.
DebugBreak()s on using uninited critical section, unlocking unowned 
critical section)
      
-Also, remove occationally used -D_DEBUG (added by compiler 
anyway)


sql/udf_example.c:
  use unixish end of line
2009-09-30 15:35:01 +02:00