outside datafile) on INSERT into an Aria table.
The isssue was that the check if a table was moved between systems didn't take into account that create_trid could be bigger than the current max trid on the new system.
This could only happen if one tried to move a table that one had just done a 'REPAIR TABLE' on.
Tables that one had run 'aria_chk --zerofill' on worked.
Fixed this by assuming that if create_trid is too big then the table has been moved from one system to another and we have to do an automatic zerofill.
Other fixed:
- Added a check to detect a wrong create_trid in 'check table'.
- aria_chk -dvv will now write out also the create_trid (to make future error finding easier)
- aria_chk --zerofill doesn't anymore require a aria_control_file
- Removed some warnings from safemalloc when using aria_chk, ma_test1 and ma_test2.
include/myisamchk.h:
Removed wrong 'QQ' flags (the flags are used by myisamchk and aria_chk)
storage/maria/ha_maria.cc:
maria_chk_status() can now also return an error.
storage/maria/ma_check.c:
In maria_chk_status() check if create_trid value is too big.
storage/maria/ma_open.c:
Changed check if table is moved so that we can detect wrong create_trid values.
Don't set STATE_NOT_MOVABLE flag if we are doing repair/check. This was done so that aria_chk can print out the movable flag.
storage/maria/ma_test1.c:
Added code to suppress memory leaks from safemalloc
storage/maria/ma_test2.c:
Added code to suppress memory leaks from safemalloc
storage/maria/maria_chk.c:
Added code to suppress memory leaks from safemalloc.
Make help text a bit better for --HELP and --zerofill.
Incresed version number.
Don't require a control file if we are only doing --zerofill
Print out 'create_trid' when doing --describe --verbose
storage/maria/unittest/ma_test_recovery.expected:
Updated result file
modified:
storage/connect/connect.cc
storage/connect/tabutil.h
- Fix closing invalid tdbp in External_lock.
modified:
storage/connect/ha_connect.cc
- Fix closing null Tdbp
modified:
storage/connect/tabpivot.cpp*
- Fix regression error in table type TBL no more accepting missing
columns in sub-tables even when Accept was set to TRUE.
modified:
storage/connect/tabtbl.cpp
MDEV-3989: Server crashes on import from MariaDB mysqldump export with partitioned Aria table.
Problem was that bulk insert in aria was not properly protected against concurrent selects.
storage/maria/ha_maria.cc:
Move settings of file->state to _ma_block_start_trans() to ensure that lock_key_trees is not changed by a concurrent bulk_insert.
storage/maria/ma_check.c:
Added DBUG_ASSERT()
storage/maria/ma_open.c:
Set start_trans to ma_start_trans for default behaviour.
storage/maria/ma_pagecrc.c:
Removed test for 'non_transactional' as a now_transactinal could be reset while a flush was happening.
storage/maria/ma_state.c:
Moved setting of info->state from external_lock to start_trans to protect against concurrent running bulk inserts.
This works as the other threads will wait in thr_lock() until bulk_insert is done and keys are re-generated.
storage/maria/ma_state.h:
Added _ma_start_trans()
- Fix Tabpivot not closing the source table.
- Fix pivot.test error on Linux by specifying ENDING=2 for the expenses table.
modified:
storage/connect/mysql-test/connect/r/pivot.result
storage/connect/mysql-test/connect/t/pivot.test
storage/connect/tabpivot.cpp
storage/connect/tabpivot.h
This could happen when using Aria for internal temporary files (default case) and using DISTINCT.
_ma_scan_restore_block_record() didn't work correctly if there was rows inserted, updated or deleted on the handler
between calls to _ma_scan_remember_block_record() and _ma_scan_restore_block_record().
The effect was that some DISTINCT queries that used remove_dup_with_compare() could fail.
.bzrignore:
Ignore sql_yacc.hh
mysql-test/suite/maria/r/distinct.result:
Test case for MDEV-4280
mysql-test/suite/maria/t/distinct.test:
Test case for MDEV-4280
mysql-test/t/mysql.test:
Fixed test suite (we could get error -1 in some cases)
sql/sql_select.cc:
Break loop if restart_rnd_next() gives an error
storage/maria/ha_maria.cc:
scan_restore_pos() can return disk fault error.
storage/maria/ma_blockrec.c:
_ma_scan_remember_block_record() did incorrectly update scan.dir instead of scan_save.dir .
_ma_scan_restore_block_record() didn't work correctly if there was rows inserted,updated or deleted on the handler
between calls to _ma_scan_remember_block_record() and _ma_scan_restore_block_record().
Fixed by adding counters for row changes and reading the current scan page if changes had been made.
storage/maria/ma_blockrec.h:
scan_restore_pos() can return disk fault error.
storage/maria/ma_delete.c:
Increment row_changes
storage/maria/ma_scan.c:
scan_restore_pos() can return disk fault error.
storage/maria/ma_update.c:
Increment row_changes
storage/maria/ma_write.c:
Increment row_changes
storage/maria/maria_def.h:
scan_restore_pos() can return disk fault error.
Added comment to clearify the code.
storage/maria/ma_blockrec.c:
Added comment to clearify the code
In case of out of memory or disk error, mark pages with LSN_IMPOSSIBLE to make it easier to know which pages have wrong information.
- If one specifies --force twice to myisamchk and aria_chk, then we will try to finnish the repair even if sort_buffer would be too small.
This was done by dynamically allocate buffer handler objects as long as memory lasts.
- New option for myisamchk and aria_chk: create-missing-keys
- Changed default size of myisam_sort_buffer_size from 8M to 128M.
- Changed default size of sort_buffer_size in aria_chk from 128M to 256M.
- Increased information in error message about 'sort_buffer_size' beeing to small.
- Print also to 'show warnings' if repair was retried.
- Increased size of internal sort-buffer-readers from 16K to 128K
- Changed printing of 'number of records' to use %ll instead of casting to long
- Changed buffer sizes for myisam and aria to use MY_ALIGN_DOWN() to get same number of bytes allocated on different machines.
include/my_global.h:
Added MY_ALIGN_DOWN() to get previous alignment (for big memory areas)
include/myisam.h:
Increased size of types to be able to handle more records
include/myisamchk.h:
Increased size of types to be able to handle more records
Added T_FORCE_SORT_MEMORY to force repair to work even if sort_buffer would not be big enough
mysql-test/r/myisam.result:
Updated result
mysql-test/r/mysqld--help.result:
Updated result
mysql-test/r/repair.result:
Updated result
mysql-test/suite/maria/maria.result:
Added test cases for some fixed bugs in MyISAM to verify that Aria doesn't have them too.
mysql-test/suite/maria/maria.test:
Added test cases for some fixed bugs in MyISAM to verify that Aria doesn't have them too.
mysql-test/suite/maria/maria3.result:
Updated result after sort buffer size increase
mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result:
Updated result after sort buffer size increase
mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result:
Updated result after sort buffer size increase
mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test:
Updated result after sort buffer size increase
mysql-test/t/myisam.test:
Fixed error messages to not print system specific data
mysql-test/t/repair.test:
Fixed error messages to not print system specific data
storage/maria/ha_maria.cc:
Print also to 'show warnings' if repair was retried
Changed default size of sort_buffer_size from 128M to 256M (same as in mysqld)
storage/maria/ma_check.c:
Renamed USE_BUFFER_INIT -> PAGE_BUFFER_INIT
storage/maria/ma_sort.c:
Increased size of internal sort-buffer-readers from 16K to 128K
Increased size of types to be able to handle more records
Added support for T_FORCE_SORT_MEMORY
Don't allocate too many extra BUFFPEK at a time (they are probably not needed)
Improved error message for "sort_buffer_size is too small"
Changed printing of 'number of records' to use %ll instead of casting to long
Fixed bug where maria_update_key_parts() was called too early.
Fixed bug in detecting result from read_to_buffer().
Added 'out of memory' checking when calling 'alloc_dynamic()'.
storage/maria/maria_chk.c:
Added --create-missing-keys
If one specifies --force twice then we will try to finnish the repair even if sort_buffer would be too small.
check_param.sort_buffer_length varialble was used with wrong type.
storage/maria/maria_def.h:
Increased size of types to be able to handle more records
Use MY_ALIGN_DOWN() to get same number of bytes allocated on different machines
Renamed USE_BUFFER_INIT -> PAGE_BUFFER_INIT
storage/maria/maria_ftdump.c:
Renamed USE_BUFFER_INIT -> PAGE_BUFFER_INIT
storage/maria/maria_read_log.c:
Use PAGE_BUFFER_INIT for page cache
storage/myisam/ha_myisam.cc:
Changed default size of myisam_sort_buffer_size from 8M to 128M
storage/myisam/mi_check.c:
Renamed USE_BUFFER_INIT -> KEY_BUFFER_INIT
storage/myisam/myisam_ftdump.c:
Renamed USE_BUFFER_INIT -> KEY_BUFFER_INIT
storage/myisam/myisamchk.c:
Added --create-missing-keys
If one specifies --force twice then we will try to finnish the repair even if sort_buffer would be too small.
check_param.sort_buffer_length varialble was used with wrong type.
Renamed USE_BUFFER_INIT -> KEY_BUFFER_INIT
storage/myisam/myisamdef.h:
Increased SORT_BUFFER_INIT to 64M
(speeds up repair a lot and most machines have nowadays a lot of memory)
Use MY_ALIGN_DOWN() to get same number of bytes allocated on different machines
Renamed USE_BUFFER_INIT -> KEY_BUFFER_INIT
storage/myisam/sort.c:
Increased size of internal sort-buffer-readers from 16K to 128K
Increased size of types to be able to handle more records
Added support for T_FORCE_SORT_MEMORY
Don't allocate too many extra BUFFPEK at a time (they are probably not needed)
Improved error message for "sort_buffer_size is too small"
Changed printing of 'number of records' to use %ll instead of casting to long
Fixed bug in detecting result from read_to_buffer().
Added 'out of memory' checking when calling 'alloc_dynamic()'.
Solaris fixes:
- Fixed that wait_timeout_func and wait_timeout tests works on solaris
- We have to compile without NO_ALARM on Solaris as Solaris doesn't support timeouts on sockets with setsockopt(.. SO_RCVTIMEO).
- Fixed that compile-solaris-amd64-debug works (before that we got a wrong ELF class: ELFCLASS64 on linkage)
- Added missing sync_with_master
Other bug fixes:
- Free memory for rpl_global_gtid_binlog_state before exit() to avoid 'accessing uninitalized mutex' error.
BUILD/FINISH.sh:
Fixed issues on Solaris with ksh
BUILD/compile-solaris-amd64-debug:
Added missing -m64 flag
configure.cmake:
We have to compile without NO_ALARM on Solaris as Solaris doesn't support timeouts on sockets with setsockopt(.. SO_RCVTIMEO)
mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test:
- Added missing sync_with_master (fix by knielsen)
sql-common/client.c:
Added () to get rid of compiler warning
sql/item_strfunc.cc:
Fixed compiler warning
sql/log.cc:
Free memory for static variable rpl_global_gtid_binlog_state before exit()
- If we are compiling with safemalloc, we would try to call sf_free() for some members after sf_terminate() was called, which would result of trying to access the uninitalized mutex 'sf_mutex'
sql/multi_range_read.cc:
Fixed compiler warnings of converting double to ulong.
sql/opt_range.cc:
Fixed compiler warnings of converting double to ulong or uint
- Better to have all variables that can be number of rows as 'ha_rows'
sql/rpl_gtid.cc:
Added rpl_binlog_state::free() to be able to free memory for static objects before exit()
sql/rpl_gtid.h:
Added rpl_binlog_state::free() to be able to free memory for static objects before exit()
sql/set_var.cc:
Fixed compiler warning
sql/sql_join_cache.cc:
Fixed compiler warnings of converting double to uint
sql/sql_show.cc:
Added cast to get rid of compiler warning
sql/sql_statistics.cc:
Remove code that didn't do anything.
(store_record() with record[0] is a no-op)
storage/xtradb/os/os0file.c:
Added __attribute__ ((unused))
support-files/compiler_warnings.supp:
Ignore warnings from atomic_add_64_nv
(was not able to fix this with a cast as the macro is a bit different between systems)
vio/viosocket.c:
Added more DBUG_PRINT
- Fix a bug causing a crash when doing an ALTER TABLE
(because create_info->alias is NULL)
added:
storage/connect/mysql-test/connect/r/occur.result
storage/connect/mysql-test/connect/r/xcol.result
storage/connect/mysql-test/connect/t/occur.test
storage/connect/mysql-test/connect/t/xcol.test
modified:
storage/connect/ha_connect.cc
- Fix bug causing PROXY on non CONNECT tables to sometimes use the wrong DB.
- Making some more tests in create that were in pre_create not called anymore
when columns are defined.
- Updating some test results to reflect new warnings.
modified:
storage/connect/ha_connect.cc
storage/connect/mysql-test/connect/r/tbl.result
storage/connect/mysql-test/connect/r/upd.result
storage/connect/tabcol.h
storage/connect/tabmysql.cpp
storage/connect/taboccur.cpp
storage/connect/taboccur.h
storage/connect/tabtbl.cpp
storage/connect/tabtbl.h
storage/connect/tabutil.cpp
storage/connect/tabutil.h
storage/connect/tabxcl.cpp
storage/connect/tabxcl.h
eliminate a race condition over recv_sys->n_addrs which might result in a database corruption
in recovery, without reporting a recovery error.
recv_recover_page_func(): move the code segment that decrements recv_sys->n_addrs
to the end of the function, after the call to mtr_commit()
rb://2282 approved by Inaam
to 0. So it can be later set to mysqld_port if necessary. Doing so, it is no
more required to specify port when using the current port and the current port
is not equal to MYSQL_PORT (3306)
modified:
storage/connect/ha_connect.cc
object table is not a CONNECT table. This was the case in previous
versions but was no more possible with recent changes.
modified:
storage/connect/mycat.cc
storage/connect/tabmysql.cpp
storage/connect/tabutil.cpp
After a clean shutdown, InnoDB will not check the *.ibd file headers,
for maximum performance. This is unchanged before and after this
patch.
What this fix addresses is the case when crash recovery is
needed. Previously, InnoDB could load a corrupted tablespace file.
buf_page_is_corrupted(): Add the parameter check_lsn.
fil_check_first_page(): New function, to perform a consistency check
on the first page of a file. This can be overridden by setting
innodb_force_recovery.
fil_read_first_page(), fil_open_single_table_tablespace(),
fil_load_single_table_tablespace(): Invoke fil_check_first_page().
open_or_create_data_files(): Check the status of
fil_open_single_table_tablespace().
rb#2352 approved by Jimmy Yang
PROXY table base on another table. Used by several other types.
XCOL proxy on a table having a colummn containing a list of values
OCCUR proxy on a table having several columns containing the same type
of values that can be put in a unique column and several rows.
TBL Not new but now internally using the PROXY table class.
- Fix 2 bugs in add_field:
Change '=' to ' ' after the COMMENT keyword.
Quote column names between '`' in the SQL string.
- Update xml test result to the CONNECT version
added:
storage/connect/taboccur.cpp
storage/connect/taboccur.h
storage/connect/tabutil.cpp
storage/connect/tabutil.h
storage/connect/tabxcl.cpp
storage/connect/tabxcl.h
modified:
storage/connect/CMakeLists.txt
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/mycat.cc
storage/connect/myconn.cpp
storage/connect/mysql-test/connect/r/xml.result
storage/connect/plgdbsem.h
storage/connect/tabmysql.cpp
storage/connect/tabtbl.cpp
storage/connect/tabtbl.h
storage/connect/valblk.cpp
storage/connect/valblk.h
set(CMAKE_REQUIRED_INCLUDES ${ODBC_INCLUDE_DIR})
was missing before the recently added CHECK_CXX_SOURCE_COMPILES()
modified:
storage/connect/CMakeLists.txt
on the build machine. So put them into the deb packages optionally.
Additionally, fixing cassandra/CMakeLists.txt to work with thrift
installed in /opt/local and /opt. It was supposed to work, but did
not work actually. Only thrift installed in /usr or /usr/local worked.
renamed:
debian/dist/Debian/mariadb-server-10.0.files => debian/dist/Debian/mariadb-server-10.0.files.in
debian/dist/Ubuntu/mariadb-server-10.0.files => debian/dist/Ubuntu/mariadb-server-10.0.files.in
modified:
.bzrignore
CMakeLists.txt
storage/cassandra/CMakeLists.txt
storage/cassandra/cassandra_se.cc
storage/cassandra/gen-cpp/Cassandra.h
storage/cassandra/gen-cpp/cassandra_types.h
storage/oqgraph/CMakeLists.txt
debian/dist/Debian/mariadb-server-10.0.files.in
debian/dist/Ubuntu/mariadb-server-10.0.files.in
OPENING MISSING PARTITION
In the ha_innobase::open() call, for normal tables, there is no retry logic.
But for partitioned tables, there is a retry logic introduced as fix for:
http://bugs.mysql.com/bug.php?id=33349https://support.mysql.com/view.php?id=21080
The Bug#33349, does not provide sufficient information to analyze the original
problem. The original problem reported by bug#33349 is also minor (just an
annoyance and no loss of functionality). Most importantly, the retry logic
has been introduced without any associated test case.
So we are removing the retry logic for partitioned tables. When the original
problem occurs, a different solution will be explored.
modified:
@ storage/cassandra/CMakeLists.txt
Renaming the package "CassandraSE" to "cassandra-engine",
as agreed during Lisbon meeting.
@ storage/connect/CMakeLists.txt
Removing an unused line
modified:
@ mysql-test/r/mysqld--help.result
@ mysql-test/t/mysqld--help.test
Supressing information about "--connect" in "mysqld --help" output,
as it depends on the build parameters.
As a side effect information about --connect-timeout is now also suppressed :(
@ storage/connect/CMakeLists.txt
Removing gcc warning switches that do not exists in some older gcc versions.
@ storage/connect/ha_connect.cc
Adding a quick fix: cast from "const char *" to "char *".
Olivier should do a better fix eventually.
Change default for innodb_use_fallocate to FALSE, due to bugs in older Linux kernels (posix_fallocate() does not always guarantee that file size is like one specified)
sql/keycaches.cc:
Added free_all_rpl_filters() to be able to free all filters at cleanup
sql/keycaches.h:
Added prototype
sql/rpl_rli.cc:
Fixed compiler warning
sql/slave.cc:
Free all rpl_filters at cleanup
sql/sp.cc:
Fixed compiler warning when not all struct elements was initialized
sql/sql_acl.cc:
Fixed compiler warning when not all struct elements was initialized
storage/perfschema/table_events_waits.cc:
Fixed compiler warning when not all struct elements was initialized
storage/perfschema/table_events_waits_summary.cc:
Fixed compiler warning when not all struct elements was initialized
storage/perfschema/table_ews_global_by_event_name.cc:
Fixed compiler warning when not all struct elements was initialized
storage/perfschema/table_file_instances.cc:
Fixed compiler warning when not all struct elements was initialized
storage/perfschema/table_file_summary.cc:
Fixed compiler warning when not all struct elements was initialized
storage/perfschema/table_performance_timers.cc:
Fixed compiler warning when not all struct elements was initialized
storage/perfschema/table_setup_consumers.cc:
Fixed compiler warning when not all struct elements was initialized
storage/perfschema/table_setup_instruments.cc:
Fixed compiler warning when not all struct elements was initialized
storage/perfschema/table_setup_timers.cc:
Fixed compiler warning when not all struct elements was initialized
storage/perfschema/table_sync_instances.cc:
Fixed compiler warning when not all struct elements was initialized
storage/perfschema/table_threads.cc:
Fixed compiler warning when not all struct elements was initialized
storage/xtradb/os/os0file.c:
Fixed compiler warning when not all struct elements was initialized
Also, do not use /MP option when compiling CONNECT (incompatible with COM #import directive)
Also, fix ODBC_LIBRARY to be a list on Windows, not string with spaces inside.
- Fix embedded build
- Backport disable of fallocate, it creates too short ibdata1
when used with O_DIRECT on old kernels
- Do not disable innodb during .deb install, we need it for
mysql.rpl_slave_state table.
(e.g. MariaDB-10.0.1-fc18-x86_64-connect-engine.rpm) with
automatic installation of libxml2 and unixODBC as dependencies.
added:
storage/connect/connect.cnf
modified:
storage/connect/CMakeLists.txt
Merge of 10.0-mdev26 feature tree into 10.0-base.
Global transaction ID is prepended to each event group in the binlog.
Slave connect can request to start from GTID position instead of specifying
file name/offset of master binlog. This facilitates easy switch to a new
master.
Slave GTID state is stored in a table mysql.rpl_slave_state, which can be
InnoDB to get crash-safe slave state.
GTID includes a replication domain ID, allowing to keep track of distinct
positions for each of multiple masters.
sub-tables are accessed via the MySQL API like the MYSQL CONNECT tables.
modified:
mysql-test/suite/connect/r/tbl.result
mysql-test/suite/connect/t/tbl.test
storage/connect/catalog.h
storage/connect/ha_connect.cc
storage/connect/mycat.cc
storage/connect/mycat.h
storage/connect/tabmysql.h
storage/connect/tabtbl.cpp
The code was a legacy from the first versions of the XDB engine dating 2004
and was not working anymore with recent versions of MySQL/MariaDB. A patch
in create had been added but is was unsatisfying, recreating all indexes on
any alter statement and sometimes doing nothing when it should have.
This is a major update to be tested for stability. It was in most important
cases et all current tests pass with this new version
modified:
storage/connect/global.h
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/mycat.cc
storage/connect/plugutil.c
storage/connect/tabdos.cpp
storage/connect/user_connect.cc
storage/connect/user_connect.h
storage/connect/xindex.h
* persistent table versions in the extra2
* ha_archive::frm_compare using TABLE_SHARE::tabledef_version
* distinguish between "important" and "optional" extra2 frm values
* write engine-defined attributes (aka "table options") to extra2, not to extra,
but still read from the old location, if they're found there.
* print "table doesn't exist in engine" when a table doesn't exist in the engine,
instead of "file not found" (if no file was involved)
* print a complete filename that cannot be found ('t1.MYI', not 't1')
* it's not an error for a DROP if a table doesn't exist in the engine (or some table
files cannot be found) - if the DROP succeeded regardless
* replace pointer acrobatics with a struct
* make sorting explicit: MY_DONT_SORT -> MY_WANT_SORT
(if you want something to be done - say it. fixes all places where
my_dir() was used without thinking)
* typo s/number_off_files/number_of_files/
* directory_file_name() doesn't need to be extern
* remove #ifdef __BORLANDC__
* ignore '.' and '..' entries
This fix also revealed wrong result recorded in fix.result.
modified:
mysql-test/suite/connect/r/fix.result
storage/connect/value.cpp
modified:
mysql-test/suite/connect/r/bin.result
mysql-test/suite/connect/r/fix.result
mysql-test/suite/connect/t/bin.test
storage/connect/value.cpp
Adding tests of MAPPED and HUGE tables in upd.test
modified:
mysql-test/suite/connect/r/upd.result
mysql-test/suite/connect/t/upd.test
storage/connect/filamvct.cpp
storage/connect/tabvct.cpp
TABLE/KEY RELATIONS
The DICT_FK_MAX_RECURSIVE_LOAD was reduced from 250 to 33 in rb#2058.
But in optimized build, this recursive depth is still too deep and
resulted in stack overflow. So reducing this depth to 20 now.
Split unspecified VEC tables are no more allowed.
Empty XML files are now accepted.
Separate index files are now depending upon the SEPINDEX option
and not allowed when file name is not specified.
DROP now can erase table and index file.
modified:
storage/connect/ha_connect.cc
storage/connect/tabdos.cpp
storage/connect/tabxml.cpp
TABLE/KEY RELATIONS
Problem:
When there are many tables, linked together through the foreign key
constraints, then loading one table will recursively open other tables. This
can sometimes lead to thread stack overflow. In such situations the server
will exit.
I see the stack overflow problem when the thread_stack is 196608 (the default
value for 32-bit systems). I don't see the problem when the thread_stack is
set to 262144 (the default value for 64-bit systems).
Solution:
Currently, in InnoDB, there is a macro DICT_FK_MAX_RECURSIVE_LOAD which defines
the maximum number of tables that will be loaded recursively because of foreign
key relations. This is currently set to 250. We can reduce this number to 33
(anything more than 33 does not solve the problem for the default value). We
can keep it small enough so that thread stack overflow does not happen for the
default values. Reducing the DICT_FK_MAX_RECURSIVE_LOAD will not affect the
functionality of InnoDB. The tables will eventually be loaded.
rb#2058 approved by Marko
TABLE/KEY RELATIONS
Problem:
When there are many tables, linked together through the foreign key
constraints, then loading one table will recursively open other tables. This
can sometimes lead to thread stack overflow. In such situations the server
will exit.
I see the stack overflow problem when the thread_stack is 196608 (the default
value for 32-bit systems). I don't see the problem when the thread_stack is
set to 262144 (the default value for 64-bit systems).
Solution:
Currently, in InnoDB, there is a macro DICT_FK_MAX_RECURSIVE_LOAD which defines
the maximum number of tables that will be loaded recursively because of foreign
key relations. This is currently set to 250. We can reduce this number to 33
(anything more than 33 does not solve the problem for the default value). We
can keep it small enough so that thread stack overflow does not happen for the
default values. Reducing the DICT_FK_MAX_RECURSIVE_LOAD will not affect the
functionality of InnoDB. The tables will eventually be loaded.
rb#2058 approved by Marko
It is not enough to ignore the flags while populating the table. They have
to be removed from the definition in pre_create. The issue is to pass the
info from the selected table handler to the created table handler.
It is done via the only common item between them: the GLOBAL structure.
modified:
storage/connect/global.h
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/plugutil.c
when FILE_NAME is specified
- Require FILE privileges for the TABLE_TYPEs that
access to the underlying operating system:
ODBC, MYSQL, DIR, MAC, WMI, OEM.
added:
mysql-test/suite/connect/t/grant.inc
modified:
mysql-test/suite/connect/r/bin.result
mysql-test/suite/connect/t/bin.test
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
instead of being replaced by the default type DOS.
modified:
mysql-test/suite/connect/r/general.result
mysql-test/suite/connect/t/general.test
storage/connect/ha_connect.cc
UPDATES
After checking that the table has changed too much in
row_update_statistics_if_needed() and calling dict_update_statistics(),
also check if the same condition holds after acquiring the table stats
latch. This is to avoid multiple threads concurrently entering and
executing the stats update code.
Approved by: Marko (rb:2186)
FREED LOCK
ANALYIS
-------
In 5.5 code the lock_rec_block_validate() is called after releasing
the kernel mutex. There is a chance that the lock might be invalid so,
we are getting the valgrind error on invalid read on lock->index.
FIX
---
Fix would be to copy the lock->index when we are holding the kernel mutex
and then pass it to the lock_rec_block_validate(). This implementation
is present in 5.1 code.
[ Approved by sunny rb.no.oracle.com/rb/r/2152/ ]
auto generated and must be erased or renamed on Drop or Rename Table.
TODO: Take care of eventual index files.
modified:
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
IBUF, FREE SPACE MANAGEMENT
ibuf_merge_or_delete_for_page(): Declare the user index page latched
for UNIV_SYNC_DEBUG after opening the change buffer cursor. This
should avoid the bogus latching order violation.
ibuf_delete_rec(): Add assertions to the callers, checking that the
mini-transaction was committed when the function returned TRUE. This
is a non-functional change, just clarifying the code.
rb#2136 approved by Kevin Lewis
For a fresh insert, page_zip_available() was counting some fields twice.
In the worst case, the compressed page size grows by PAGE_ZIP_DIR_SLOT_SIZE
plus the size of the record that is being inserted. The size of the record
already includes the fields that will be stored in the uncompressed portion
of the compressed page.
page_zip_get_trailer_len(): Remove the output parameter entry_size,
because no caller is interested in it.
page_zip_max_ins_size(), page_zip_available(): Assume that the page grows
by PAGE_ZIP_DIR_SLOT_SIZE and the record size (which includes the fields
that would be stored in the uncompressed portion of the page).
rb#2169 approved by Sunny Bains
Not added as an option but handled when the table is used.
An empty file is created in the database directory if not exists.
modified:
storage/connect/ha_connect.cc
storage/connect/mycat.cc
storage/connect/tabdos.cpp
storage/connect/tabmul.cpp
storage/connect/tabsys.cpp
storage/connect/tabxml.cpp
or if the key is missing in a section (INI)
modified:
mysql-test/suite/connect/r/ini.result
mysql-test/suite/connect/r/xml.result
storage/connect/tabsys.cpp
storage/connect/tabxml.cpp
- Do a sub-storage cleanup on info commands and fix a limit of column number
in ODBCColumns. This was doing a crash for unexpected longjmp when many info
commands were executed in a row.
modified:
storage/connect/ha_connect.cc
storage/connect/odbconn.cpp
MEM_HEAP_CREATE_BLOCK()
PROBLEM
-------
If we give start mysqld with the option --innodb_log_buffer_size=50GB
,then mem_area_alloc() function fails to allocate memory and returns
NULL.In debug version we assert at this point,but there is no check in
release version and we get a segmentation fault.
FIX
---
Added a log message saying that we are unable to allocate memory.
After this message we assert.
[Approved by Kevin http://rb.no.oracle.com/rb/r/2065 ]
- Change field option BUF_LENGTH to FIELD_LENGTH. It now used to specify
the field length of DATE columns (MySQL doesn't allow to give a length)
modified:
storage/connect/ha_connect.cc
update xempl set ddentree = adddate(ddentree, interval 16 year);
The same value sdval was used to convert MySQL dates to CONNECT date
value and CONNECT dates to MySQL date. This was wrong in update because
the second time the wrong value was used converting to incoherent values.
There are now 2 separate values used: sdvalin and sdvalout.
modified:
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
and read as if the table DATA_CHARSET was ANSI instead of UTF-8. Warning
are now provided when the read content of a node is truncated.
modified:
storage/connect/domdoc.cpp
storage/connect/domdoc.h
storage/connect/libdoc.cpp
storage/connect/libdoc.h
storage/connect/plgxml.h
storage/connect/tabxml.cpp
- Conditional compilation of pre_create depending on the MARIADB setting.
modified:
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
INSERT WITH SAME VALUES
Problem:
When a transaction is in READ COMMITTED isolation level, gap locks are still
taken in the secondary index, when row is inserted. This happens when the
secondary index is scanned for duplicate.
The function row_ins_scan_sec_index_for_duplicate() always calls the
function row_ins_set_shared_rec_lock() with LOCK_ORDINARY irrespective of
the transaction isolation level.
Solution:
The function row_ins_scan_sec_index_for_duplicate() calls the
function row_ins_set_shared_rec_lock() with LOCK_ORDINARY or
LOCK_REC_NOT_GAP based on the transaction isolation level.
rb://2035 approved by Krunal and Marko
Before this fix, the command
SHOW ENGINE PERFORMANCE_SCHEMA STATUS
could report wrong amount of memory allocated,
when the amount of memory used exceeds 4GB.
The problem is that size computations are not done using size_t,
so that overflows do occur, truncating the results.
This fix compute memory sizes properly with size_t.
Tested manually.
No test script provided, as the script would need to allocate too much
memory for the test.
mysys/errors.c:
revert upstream's fix. use a much simpler one
mysys/my_write.c:
revert upstream's fix. use a simpler one
sql/item_xmlfunc.cc:
useless, but ok
sql/mysqld.cc:
simplify upstream's fix
storage/heap/hp_delete.c:
remove upstream's fix.
we'll use a much less expensive approach.
Trivial cleanup
scripts/mysqld_safe.sh:
Added support for --crash-script.
Don't remove socket file (not needed as server will re-create it if needed)
Patch by Eric Bergen
storage/maria/ha_maria.h:
Removed not existing variable.
This is a deadlock that will also be fixed in the server by
Bug #11844915 - HANG IN THDVAR MUTEX ACQUISITION.
So this is a simple alternate method of fixing the same problem,
but from within InnoDB.
The simple change is to make rename table start a transaction
before locking dict_sys->mutex since thd_supports_xa() can call
THDVAR which can lock a mutex, LOCK_global_system_variables, that
is used in the server by many other activities. At least one of
those, sys_var::update(), can call back into InnoDB and try to
lock dict_sys->mutex while holding LOCK_global_system_variables.
The other bug fix for 11844915 eliminates the use of
LOCK_global_system_variables for calls to THDVAR.
Approved by marko in http://rb.no.oracle.com/rb/r/2000/
page_zip_compress_node_ptrs(): Do not attempt to invoke deflate() with
c_stream->avail_in, because it will result in Z_BUF_ERROR (and
page_zip_compress() failure and unnecessary further splits of the node
pointer page). A node pointer record can have empty payload, provided
that all key fields are empty.
Approved by Jimmy Yang
- Use the COLDEF flag to initialize column nullable value.
- Fix a bug on inserting null values in MYSQL tables.
modified:
storage/connect/colblk.cpp
storage/connect/connect.cc
storage/connect/ha_connect.cc
storage/connect/odbconn.cpp
storage/connect/plgdbsem.h
storage/connect/table.cpp
storage/connect/tabmysql.cpp
- Fixing a bug that DBNAME value was forgotten when followed by OPTION_LIST.
modified:
mysql-test/suite/connect/r/mysql.result
mysql-test/suite/connect/t/mysql.test
storage/connect/ha_connect.cc
- Take care of XML special chars (<>& etc.)
- Remove Encode, Decode
modified:
storage/connect/libdoc.cpp
storage/connect/libdoc.h
- Neither libmysql.lib nor mysqlclient.lib needed for MYSQL table type
modified:
storage/connect/CMakeLists.txt
It is no more necessary to be liked to libmysql.lib nor mysqlclient.lib.
modified:
storage/connect/libdoc.cpp
storage/connect/myconn.cpp
storage/connect/myconn.h
storage/connect/tabmysql.cpp
storage/connect/tabmysql.h
(with MODULE_ONLY valgrind does not display file name and line number
if a problem happens inside a dlopen-ed plugin)
modified:
storage/connect/CMakeLists.txt