- Removed SCCS rule from Makefile.am
- Made dummy rule in sql_yacc.yy to get rid of compiler warning about not used label.
Don't use maintainer mode with valgrind (as we don't want to initialize all variables)
config/ac-macros/maintainer.m4:
Don't use maintainer mode with valgrind (as we don't want to initialize all variables)
Force initialization of variables when using -Werror (To get rid of compiler warnings)
configure.in:
Don't use maintainer mode with valgrind (as we don't want to initialize all variables)
sql/sql_yacc.yy:
Made dummy rule in sql_yacc.yy to get rid of compiler warning about not used label.
The issue was that we didn't always check result of ha_rnd_init() which caused a problem for handlers that returned an error in this code.
- Changed prototype of ha_rnd_init() to ensure that we get a compile warning if result is not checked.
- Added ha_rnd_init_with_error() that prints error on failure.
- Checked all usage of ha_rnd_init() and ensure we generate an error message on failures.
- Changed init_read_record() to return 1 on failure.
sql/create_options.cc:
Fixed wrong printf
sql/event_db_repository.cc:
Check result from init_read_record()
sql/events.cc:
Check result from init_read_record()
sql/filesort.cc:
Check result from ha_rnd_init()
sql/ha_partition.cc:
Check result from ha_rnd_init()
sql/ha_partition.h:
Fixed compiler warning
sql/handler.cc:
Added ha_rnd_init_with_error()
Check result from ha_rnd_init()
sql/handler.h:
Added ha_rnd_init_with_error()
Changed prototype of ha_rnd_init() to ensure that we get a compile warning if result is not checked
sql/item_subselect.cc:
Check result from ha_rnd_init()
sql/log.cc:
Check result from ha_rnd_init()
sql/log_event.cc:
Check result from ha_rnd_init()
sql/log_event_old.cc:
Check result from ha_rnd_init()
sql/mysql_priv.h:
init_read_record() now returns error code on failure
sql/opt_range.cc:
Check result from ha_rnd_init()
sql/records.cc:
init_read_record() now returns error code on failure
Check result from ha_rnd_init()
sql/sql_acl.cc:
Check result from init_read_record()
sql/sql_cursor.cc:
Print error if ha_rnd_init() fails
sql/sql_delete.cc:
Check result from init_read_record()
sql/sql_help.cc:
Check result from init_read_record()
sql/sql_plugin.cc:
Check result from init_read_record()
sql/sql_select.cc:
Check result from ha_rnd_init()
Print error if ha_rnd_init() fails.
sql/sql_servers.cc:
Check result from init_read_record()
sql/sql_table.cc:
Check result from init_read_record()
sql/sql_udf.cc:
Check result from init_read_record()
sql/sql_update.cc:
Check result from init_read_record()
storage/example/ha_example.cc:
Don't return error on rnd_init()
storage/ibmdb2i/ha_ibmdb2i.cc:
Removed not relevant comment
Introduce a MySQL maintainer/developer mode that enables
a set of warning options for the C/C++ compiler. This mode
is intended to help improve the overall quality of the code.
The warning options are:
C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Werror"
CXX_WARNINGS="$C_WARNINGS -Wno-unused-parameter"
Since -Wall is essentially a moving target, autoconf checks
are not run with warning options enabled, in particualr -Werror.
This decision might be revisited in the future. The patch also
fixes a mistake in the makefiles, where automake CXXFLAGS would
be set to CFLAGS.
config/ac-macros/maintainer.m4:
Add a set of default compiler flags used when in maintainer mode.
configure.in:
Hook into the maintainer mode. Disabled by default.
The atomic operations implementation on 5.1 has a few problems,
which might cause tests to abort randomly. Since no code in 5.1
uses atomic operations, simply remove the code.
Interface for maria extensions.
Alternative plugin interface with additional info (maturity and string version).
CMakeLists.txt:
Maria plugin interface used.
config/ac-macros/plugins.m4:
Maria plugin interface used.
configure.in:
Maria plugin interface used.
include/mysql/plugin.h:
Maria plugin interface added.
include/mysql/plugin_auth.h.pp:
Maria plugin interface added.
plugin/auth/auth_socket.c:
Maria plugin interface added.
plugin/auth/dialog.c:
Maria plugin interface added.
plugin/daemon_example/daemon_example.cc:
Maria plugin interface added.
plugin/fulltext/plugin_example.c:
Maria plugin interface added.
sql/ha_ndbcluster.cc:
Maria plugin interface added.
sql/ha_partition.cc:
Maria plugin interface added.
sql/log.cc:
Maria plugin interface added.
sql/sql_acl.cc:
Maria plugin interface added.
sql/sql_builtin.cc.in:
Maria plugin interface used.
sql/sql_plugin.cc:
Maria plugin interface added.
sql/sql_plugin.h:
Maria plugin interface used.
sql/sql_show.cc:
Maria plugin interface added.
storage/archive/ha_archive.cc:
Maria plugin interface added.
storage/blackhole/ha_blackhole.cc:
Maria plugin interface added.
storage/csv/ha_tina.cc:
Maria plugin interface added.
storage/example/ha_example.cc:
Maria plugin interface added.
storage/federated/ha_federated.cc:
Maria plugin interface added.
storage/federatedx/ha_federatedx.cc:
Maria plugin interface added.
storage/heap/ha_heap.cc:
Maria plugin interface added.
storage/ibmdb2i/ha_ibmdb2i.cc:
Maria plugin interface added.
storage/innobase/handler/ha_innodb.cc:
Maria plugin interface added.
storage/innodb_plugin/handler/i_s.cc:
Maria plugin interface added.
storage/maria/ha_maria.cc:
Maria plugin interface added.
storage/myisam/ha_myisam.cc:
Maria plugin interface added.
storage/myisammrg/ha_myisammrg.cc:
Maria plugin interface added.
storage/pbxt/src/ha_pbxt.cc:
Maria plugin interface added.
storage/xtradb/handler/ha_innodb.cc:
Maria plugin interface added.
storage/xtradb/handler/i_s.cc:
Maria plugin interface added.
storage/xtradb/handler/i_s.h:
Maria plugin interface added.
The fix inserts newline and comma characters as appropriate
into the constraint reporting code to match the formatting
required by SHOW CREATE TABLE. Additionally, a erroneously
duplicated copy of check_if_incompatible_data() was removed
from db2i_constraints.cc since the correct version is already
in ha_ibmdb2i.cc.
storage/ibmdb2i/db2i_constraints.cc:
Bug#49521 SHOW CREATE TABLE on IBMDB2I tables has incorrect fk constraint format
- Insert newline and comma characters into the constraint reporting
code to match the formatting required by SHOW CREATE TABLE.
- Remove an erroneous copy of check_if_incompatible_data() from
db2i_constraints.cc.
This fix changes the character set used within the
IBMDB2I handler to hash table names to information
about open tables. Previously, tables with names
that differed only in letter case would hash to the
same data structure. This caused incorrect behavior
or errors when two such tables were in use simultaneously.
mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_49329.result:
Bug#49329 example (and other) engines use wrong collation for open tables hash
Result file for the test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_49329.test:
Bug#49329 example (and other) engines use wrong collation for open tables hash
Test case for the bug fix.
storage/ibmdb2i/ha_ibmdb2i.cc:
Bug#49329 example (and other) engines use wrong collation for open tables hash
change the character set used within the IBMDB2I
handler to hash table names to information about
open tables.
With ibmdb2i_create_index_option set to 1, creating an IBMDB2I table
with a primary key should produce an additional index that uses EBCDIC
hexadecimal sorting. However, this does not work. Adding indexes that
are not primary keys does work. The ibmdb2i_create_index_option should
be honoured when creating a table with a primary key.
This patch adds code to the create() function to check for the value
of the ibmdb2i_create_index_option variable and, when appropriate, to
generate a *HEX-based shadow index in DB2 for the primary key. Previously
this behavior was limited to secondary indexes.
Additionally, this patch restricts the creation of shadow indexes to
cases in which a non-*HEX sort sequence is used, as the documentation
for ibmdb2i_create_index_option describes. Previously, the shadow index
would in some cases be created even when the MySQL-specific index used
*HEX sorting, leading to redundant indexes.
Finally, the code used to generate the list of fields for indexes
and the code used to generate the SQL statement for the shadow
indexes has been refactored into individual functions.
mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45983.result:
Bug#45983 ibmdb2i_create_index_option=1 not working for primary key
Result file for the test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45983.test:
Bug#45983 ibmdb2i_create_index_option=1 not working for primary key
Add tests to verify that the ibmdb2i_create_index_option is being honoured
when creating a table with a primary key.
storage/ibmdb2i/ha_ibmdb2i.cc:
Bug#45983 ibmdb2i_create_index_option=1 not working for primary key
- Add code to the create() function to check for the value of the
ibmdb2i_create_index_option variable and, when appropriate, to
generate a *HEX-based shadow index in DB2 for the primary key.
- Restrict the creation of shadow indexes to cases in which a
non-*HEX sort sequence is used.
- Refractor code used to generate the list of fields for indexes
and the code used to generate the SQL statement for the shadow
indexes into individual functions.
storage/ibmdb2i/ha_ibmdb2i.h:
Bug#45983 ibmdb2i_create_index_option=1 not working for primary key
Add function prototypes for the functions that.
- Generate the list of fields for indexes
- Generate the SQL statement for the shadow
indexes
Some collations were causing IBMDB2I to report
inaccurate key range estimations to the optimizer
for LIKE clauses that select substrings. This can
be seen by running EXPLAIN. This problem primarily
affects multi-byte and unicode character sets.
This patch involves substantial changes to several
modules. There are a number of problems with the
character set and collation handling. These problems
have been or are being fixed, and a comprehensive
test has been included which should provide much
better coverage than there was before. This test
is enabled only for IBM i 6.1, because that version
has support for the greatest number of collations.
mysql-test/suite/ibmdb2i/r/ibmdb2i_collations.result:
Bug#45803 Inaccurate estimates for partial key values with IBMDB2I
result file for test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_collations.test:
Bug#45803 Inaccurate estimates for partial key values with IBMDB2I
Tests for character sets and collations. This test
is enabled only for IBM i 6.1, because that version
has support for the greatest number of collations.
storage/ibmdb2i/db2i_conversion.cc:
Bug#45803 Inaccurate estimates for partial key values with IBMDB2I
- Added support in convertFieldChars to enable records_in_range
to determine how many substitute characters were inserted and
to suppress conversion warnings.
- Fixed bug which was causing all multi-byte and Unicode fields
to be created as UTF16 (CCSID 1200) fields in DB2. The corrected
code will now create UCS2 fields as UCS2 (CCSID 13488), UTF8
fields (except for utf8_general_ci) as UTF8 (CCSID 1208), and
all other multi-byte or Unicode fields as UTF16. This will only
affect tables that are newly created through the IBMDB2I storage
engine. Existing IBMDB2I tables will retain the original CCSID
until recreated. The existing behavior is believed to be
functionally correct, but it may negatively impact performance
by causing unnecessary character conversion. Additionally, users
accessing IBMDB2I tables through DB2 should be aware that mixing
tables created before and after this change may require extra type
casts or other workarounds. For this reason, users who have
existing IBMDB2I tables using a Unicode collation other than
utf8_general_ci are encouraged to recreate their tables (e.g.
ALTER TABLE t1 ENGINE=IBMDB2I) in order to get the updated CCSIDs
associated with their DB2 tables.
- Improved error reporting for unsupported character sets by forcing
a check for the iconv conversion table at table creation time,
rather than at data access time.
storage/ibmdb2i/db2i_myconv.h:
Bug#45803 Inaccurate estimates for partial key values with IBMDB2I
Fix to set errno when iconv fails.
storage/ibmdb2i/db2i_rir.cc:
Bug#45803 Inaccurate estimates for partial key values with IBMDB2I
Significant improvements were made to the records_in_range code
that handles partial length string data in keys for optimizer plan
estimation. Previously, to obtain an estimate for a partial key
value, the implementation would perform any necessary character
conversion and then attempt to determine the unpadded length of
the partial key by searching for the minimum or maximum sort
character. While this algorithm was sufficient for most single-byte
character sets, it did not treat Unicode and multi-byte strings
correctly. Furthermore, due to an operating system limitation,
partial keys having UTF8 collations (ICU sort sequences in DB2)
could not be estimated with this method.
With this patch, the code no longer attempts to explicitly determine
the unpadded length of the key. Instead, the entire key is converted
(if necessary), including padding, and then passed to the operating
system for estimation. Depending on the source and target character
sets and collations, additional logic is required to correctly
handle cases in which MySQL uses unconvertible or differently
-weighted values to pad the key. The bulk of the patch exists
to implement this additional logic.
storage/ibmdb2i/ha_ibmdb2i.h:
Bug#45803 Inaccurate estimates for partial key values with IBMDB2I
The convertFieldChars declaration was updated to support additional
optional behaviors.
Creating an IBMDB2I table with the macce character set
is successful, but any attempt to insert data into the
table was failing.
This was happening because the character set name "macce"
is not a valid iconv descriptor for IBM i PASE. This patch
adds an override to convertTextDesc to use the equivalent
valid iconv descriptor "IBM-1282" instead.
mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45793.result:
Bug#45793 macce charset causes error with IBMDB2I
Result file for the test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45793.test:
Bug#45793 macce charset causes error with IBMDB2I
Add a testcase for the macce charater set.
storage/ibmdb2i/db2i_charsetSupport.cc:
Bug#45793 macce charset causes error with IBMDB2I
The character set name "macce" is not a valid iconv
descriptor for IBM i PASE. Add an override to convertTextDesc
to use the equivalent valid iconv descriptor "IBM-1282"
instead.
Some collations--including cp1250_czech_cs,latin2_czech_cs,
ucs2/utf8_czech_ci, ucs2/utf8_danish_ci--are not being
sorted correctly by the IBMDB2I storage engine. This
was being caused because the sort order used by DB2 is
incompatible with the order expected by MySQL.
This patch removes support for the cp1250_czech_cs and
latin2_czech_cs collations because it has been determined
that the sort order used by DB2 is incompatible with the
order expected by MySQL. Users needing a czech collation
with IBMDB2I are encouraged to use a Unicode-based collation
instead of these single-byte collations. This patch also
modifies the DB2 sort sequence used for ucs2/utf8_czech_ci
and ucs2/utf8_danish_ci collations to better match the
sorting expected by MySQL. This will only affect indexes
or tables that are newly created through the IBMDB2I storage
engine. Existing IBMDB2I tables will retain the old sort
sequence until recreated.
mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45196.result:
Bug#45196 Some collations do not sort correctly with IBMDB2I
Result file for the test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45196.test:
Bug#45196 Some collations do not sort correctly with IBMDB2I
Adding tests for testing the sort order with the modified collations.
storage/ibmdb2i/db2i_collationSupport.cc:
Bug#45196 Some collations do not sort correctly with IBMDB2I
Remove the support for the cp1250_czech_cs and latin2_czech_cs
collations because it has been determined that the sort order
used by DB2 is incompatible with the order expected by MySQL.
Users needing a czech collation with IBMDB2I are encouraged to
use a Unicode-based collation instead of these single-byte
collations. This patch also modifies the DB2 sort sequence
used for ucs2/utf8_czech_ci and ucs2/utf8_danish_ci collations
to better match the sorting expected by MySQL. This will only
affect indexes or tables that are newly created through the
IBMDB2I storage engine. Existing IBMDB2I tables will retain
the old sort sequence until recreated.
Running a SELECT query over an IBMDB2I table with a cp1250 character set
was producing an error 2027 (ibmdb2i error 2027: Error converting single-byte
sort sequence to UCS-2).
The QMY_DESCRIBE_RANGE API was returning error 2027 to the storage engine
because the CCSID used for a cp1250 column (870) does not match the CCSID
used by the DB2 sort sequences associated with cp1250_* collations (1153).
This was because the storage engine relies on a set of system APIs to
determine which CCSID value most closely matches a particular MySQL
character set. However, in the case of cp1250, the system is returning
CCSID 870, which does not have a codepoint for the euro symbol, making it
an incorrect match.
This patch overrides the selection of a compatible CCSID to always return
1153 for cp1250.
storage/ibmdb2i/db2i_charsetSupport.cc:
Bug#45197 cp1250 character set with IBMDB2I generates 2027 error
override the selection of a compatible CCSID to
always return 1153 for cp1250.
wmemset was being used to fill the row buffers.
wmemset was intended to fill the buffer with
16-bit UCS2 pad values. However, the 64-bit
version of wmemset uses 32-bit wide characters
and thus filled the buffer incorrectly. In some
cases, the null byte map would be overwritten,
causing ctype_utf8.test and ibmdb2i_rir.test to
fail, giving the error message CPF5035.
This patch eliminates the use of wmemset to fill
the row buffer. wmemset has been replaced with
memset16, which always fills memory with 16-bit
values.
storage/ibmdb2i/db2i_conversion.cc:
Bug#44811 Tests with utf8 charset fail with ibmdb2i on 64bit MySQL
Eliminate the use of wmemset to fill
the row buffer. Replace wmemset with
memset16, which always fills memory
with 16-bit values.
storage/ibmdb2i/db2i_misc.h:
Bug#44811 Tests with utf8 charset fail with ibmdb2i on 64bit MySQL
Eliminate the use of wmemset to fill
the row buffer. Replace wmemset with
memset16, which always fills memory
with 16-bit values.
Occasionally, if both the partition_pruning
and partition_range tests are run sequentially
against the IBMDB2I engine, the partition_range
test will fail.
Compiler padding on a 64-bit build allowed
garbage data in the hash key used for
caching open iconv descriptors. As a
result, cached descriptors were not found,
and multiple duplicate iconv descriptors
were opened for a single character set.
Eventually, the maximum number of open
iconv descriptors was reached, and further
iconv_open() calls would fail, leading the
storage engine to report incorrectly that
the character set was not supported.
This patch widens the 16-bit members of the
hash key to 32 bits to eliminate compiler
padding. The entire length of the hash key
is now initialized correctly on both 32-bit
and 64-bit builds.
storage/ibmdb2i/db2i_charsetSupport.cc:
Bug#44856 IBMDB2I gives misleading 2504 error
widen the 16-bit members of the
hash key to 32 bits to eliminate
compiler padding.
In order to better support the usage of
IBMDB2I tables from within RPG programs,
the storage engine should ensure that the
RCDFMT name is consistent and predictable
for DB2 tables.
This patch appends a "RCDFMT <name>"
clause to the CREATE TABLE statement
that is passed to DB2. <name> is
generated from the original name of
the table itself. This ensures a
consistent and deterministic mapping
from the original table.
For the sake of simplicity only
the alpha-numeric characters are
preserved when generating the new
name, and these are upper-cased;
other characters are replaced with
an underscore (_). Following DB2
system identifier rules, the name
always begins with an alpha-character
and has a maximum of ten characters.
If no usable characters are found in
the table name, the name X is used.
mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44610.result:
Bug#44610 RCDFMT clause requested when creating DB2 table
Result file for the test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test:
Bug#44610 RCDFMT clause requested when creating DB2 table
Test case that confirms that the names that are being generated are valid.
storage/ibmdb2i/ha_ibmdb2i.cc:
Bug#44610 RCDFMT clause requested when creating DB2 table
This patch appends a "RCDFMT <name>"
clause to the CREATE TABLE statement
that is passed to DB2. <name> is
generated from the original name of
the table itself. This ensures a
consistent and deterministic mapping
from the original table.
storage/ibmdb2i/ha_ibmdb2i.h:
Bug#44610 RCDFMT clause requested when creating DB2 table
This patch appends a "RCDFMT <name>"
clause to the CREATE TABLE statement
that is passed to DB2. <name> is
generated from the original name of
the table itself. This ensures a
consistent and deterministic mapping
from the original table.
When a user selected an unsupported character set for an
IBMDB2I table, error 2501 or 2511 may have been returned,
giving the appearance of an internal programming error.
This patch consolidates these errors into a single descriptive
error message for the common case of an unsupported character
set.
The new error number is 2504 and indicates a user error.
The errors 2501 and 2511 remain to indicate cases of internal
programming errors.
storage/ibmdb2i/db2i_charsetSupport.cc:
Bug#44232 Error msg should be improved when collation not supported.
consolidate errors 2501 and 2511 into a single
descriptive error message for the common case
of an unsupported character set.
storage/ibmdb2i/db2i_conversion.cc:
Bug#44232 Error msg should be improved when collation not supported.
consolidate errors 2501 and 2511 into a single
descriptive error message for the common case
of an unsupported character set.
storage/ibmdb2i/db2i_errors.cc:
Bug#44232 Error msg should be improved when collation not supported.
consolidate errors 2501 and 2511 into a single
descriptive error message for the common case
of an unsupported character set.
storage/ibmdb2i/db2i_errors.h:
Bug#44232 Error msg should be improved when collation not supported.
consolidate errors 2501 and 2511 into a single
descriptive error message for the common case
of an unsupported character set.
The storage engine was not correctly handling the case in
which rnd_pos is executed for a handler without a preceding
rnd_next or index read operation. As a result, an unitialized
file handle was sometimes being passed to the QMY_READ API.
The fix clears the rrnAssocHandle at the beginning of each
read operation and then checks to see whether it has been
set to a valid handle value before attempting to use it
in rnd_pos. If rrnAssocHandle has not been set by a previous
read operation, rnd_pos instead falls back to the use of the
currently active handle.
storage/ibmdb2i/ha_ibmdb2i.cc:
Bug#44337 Select query using index merge fails with MCH3601
- clear the rrnAssocHandle at the beginning of each
read operation
- checks to see whether it has been set to a valid
handle value before attempting to use it in rnd_pos
On IBM i 5.4, schemas with names that are longer
than 8 characters and contain digits or an underscore
cannot contain IBMDB2I tables, even though this should
theoritically be possible if all alpha characters
are uppercase.
THe current patch fixes the IBMDB2I engine to
allow digits and the underscore(_) to be used in
schema names longer than 8 characters on IBM i 5.4.
storage/ibmdb2i/db2i_misc.h:
The function which detected whether the
operating system would treat a schema as an "ordinary identifier" (allowing 10 characters in the name instead of 8) did not cover all possible cases.Function was
renamed and enhanced to detect all
possible cases of "ordinary identifiers".
storage/ibmdb2i/ha_ibmdb2i.cc:
use the renamed function to cover all
possible cases of ordinary identifiers.
In some circumstances, when a table is created with
the IBMDB2I engine, the CREATE TABLE statement will
return successfully but the table will not exist.
The current patch addresses the above issue and causes
CREATE to fail and report and error to the user.
storage/ibmdb2i/ha_ibmdb2i.cc:
Locally declared return code hid function-
scoped declaration and went out of scope
before being returned. Removed inner
declaration.
The utf8_swedish_ci and ucs2_swedish_ci
collations do not work with indexes on
IBMDB2I tables.
The current patch adds the mapping for
ucs2_swedish collation and removes the
ucs2_spanish2 mapping which is not
supported by any version of the operating
system.
storage/ibmdb2i/db2i_collationSupport.cc:
Removed mapping for ucs2_spanish2 collation
since it is not supported by any version of the operating system. Added mapping for ucs2_swedish
collation which had been overlooked but is
supported by the IBM i 6.1.
Modify plugins.m4 configuration framework so that plugins which are
not built still get added to the source distribution during make dist.
This came up now because we can only build ibmdb2i on i5/OS, and we
can't bootstrap our source dist on that platform. The solution is to
specify DIST_SUBDIRS containing all plugins, separate from SUBDIRS
which contains the plugins which are actually built.
This ibmdb2i code is from the ibmdb2i-ga3-src.zip file, with a patch
to plug.in to disable the plugin if the PASE environment isn't available.