Handle string length as size_t, consistently (almost always:))
Change function prototypes to accept size_t, where in the past
ulong or uint were used. change local/member variables to size_t
when appropriate.
This fix excludes rocksdb, spider,spider, sphinx and connect for now.
Benefits of this patch:
- Removed a lot of calls to strlen(), especially for field_string
- Strings generated by parser are now const strings, less chance of
accidently changing a string
- Removed a lot of calls with LEX_STRING as parameter (changed to pointer)
- More uniform code
- Item::name_length was not kept up to date. Now fixed
- Several bugs found and fixed (Access to null pointers,
access of freed memory, wrong arguments to printf like functions)
- Removed a lot of casts from (const char*) to (char*)
Changes:
- This caused some ABI changes
- lex_string_set now uses LEX_CSTRING
- Some fucntions are now taking const char* instead of char*
- Create_field::change and after changed to LEX_CSTRING
- handler::connect_string, comment and engine_name() changed to LEX_CSTRING
- Checked printf() related calls to find bugs. Found and fixed several
errors in old code.
- A lot of changes from LEX_STRING to LEX_CSTRING, especially related to
parsing and events.
- Some changes from LEX_STRING and LEX_STRING & to LEX_CSTRING*
- Some changes for char* to const char*
- Added printf argument checking for my_snprintf()
- Introduced null_clex_str, star_clex_string, temp_lex_str to simplify
code
- Added item_empty_name and item_used_name to be able to distingush between
items that was given an empty name and items that was not given a name
This is used in sql_yacc.yy to know when to give an item a name.
- select table_name."*' is not anymore same as table_name.*
- removed not used function Item::rename()
- Added comparision of item->name_length before some calls to
my_strcasecmp() to speed up comparison
- Moved Item_sp_variable::make_field() from item.h to item.cc
- Some minimal code changes to avoid copying to const char *
- Fixed wrong error message in wsrep_mysql_parse()
- Fixed wrong code in find_field_in_natural_join() where real_item() was
set when it shouldn't
- ER_ERROR_ON_RENAME was used with extra arguments.
- Removed some (wrong) ER_OUTOFMEMORY, as alloc_root will already
give the error.
TODO:
- Check possible unsafe casts in plugin/auth_examples/qa_auth_interface.c
- Change code to not modify LEX_CSTRING for database name
(as part of lower_case_table_names)
* 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.
my_global.h first
We may end up with a compilation failure on certain platforms
because zlib.h is included before my_global.h.
Fixed by moving zlib.h inclusion down after my_global.h.
storage/archive/azlib.h:
zlib.h must be included after my_global.h.
- Remove bothersome warning messages. This change focuses on the warnings
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
Don't use typedef 'voidpc' as later addition and not needed
storage/archive/azlib.h:
Don't use typedef 'voidpc' as later addition and not needed
storage/archive/azio.c:
Don't use typedef 'voidpc' as later addition and not needed
storage/archive/azlib.h:
Adjusted the buffer down to something reasonable :)
storage/archive/ha_archive.cc:
Upgraded file descriptors to not be opened until needed.
storage/archive/ha_archive.h:
New methods for delayed open
Fixes autodiscovery of tables.
Allows the FRM to be extracted from the ARZ file via archive_reader.
storage/archive/archive_reader.c:
Extract FRM command added.
We now print the embedded comment
storage/archive/archive_test.c:
Additional tests for FRM annd comment
storage/archive/azio.c:
Filled in functionality for comment and frm.
storage/archive/azlib.h:
Refactored position.
storage/archive/ha_archive.cc:
Discovery mechanism filled in.
storage/archive/archive_reader.c:
Print minor information version.
storage/archive/archive_test.c:
Fixed test
storage/archive/azio.c:
Added support for "minor" version.
storage/archive/azlib.h:
Added information for minor information.
2) We now store shortest and longest row information.
3) archive_reader can now check and backup files (even if they are hot)
4) We now record longest and shortest row information for stats.
storage/archive/archive_reader.c:
Added options for:
1) Online backup for tables
2) Check table option.
storage/archive/archive_test.c:
Additional test, format is now the same as an actual table.
storage/archive/azio.c:
Fixed issue closing files multiple times.
Added option for recording longest and shortest rows.
Additional "dirty" state added.
storage/archive/azlib.h:
Added additional space for longest and shortest row information.
storage/archive/ha_archive.cc:
Cleaned up warming and removed unneeded close.
storage/archive/Makefile.am:
Added archive reader
storage/archive/archive_test.c:
Extended archive test
storage/archive/azio.c:
Rewrite of azio to include support for more meta data in header
storage/archive/azlib.h:
Extended information.
storage/archive/ha_archive.cc:
Rewrite to handle new azio
storage/archive/ha_archive.h:
Rewrite to handle new azio.
storage/archive/archive_reader.c:
New BitKeeper file ``storage/archive/archive_reader.c''
storage/archive/azio.c:
This removes the default gzip information and now uses a custom header.
storage/archive/azlib.h:
Additions for custom header and future meta data.
storage/archive/ha_archive.cc:
Removed data header in favor of new header system.
storage/archive/ha_archive.h:
Removes data_version
storage/archive/archive_test.c:
Updated the test for 2gig and 4gig tests.
storage/archive/azio.c:
Fixed return type bug that was inherited in original library.
storage/archive/azlib.h:
Fixes for original library
storage/archive/ha_archive.cc:
Far more error testing!
storage/archive/ha_archive.h:
Updated returnn type for pack_row()
storage/archive/azio.c:
Build fixes for not having zutil.h
use memset instead of zmemzero.
use 8 as memory usage level (the default, which we were using anyway)
in the .gz header, just say we're UNIX.
use memcpy instead of zmemcpy.
storage/archive/azlib.h:
don't use zutil.h, it's private to zlib
mysql-test/r/information_schema.result:
Fix for Antony adding plugins to information schema.
sql/ha_archive.cc:
Fix for now using my_off_t, no need to worry about buggy zlib's anymore.
sql/ha_archive.h:
Update to fix issues with buggy zlib.
storage/archive/azio.c:
Moved to using my_off_t (which should fix problems with most fille system size issues).
storage/archive/azlib.h:
Change to using my_off_t
AZIO differs in that it uses mysys methods and removes all of the malloc calls.
configure.in:
Update for new archive directory
libmysqld/Makefile.am:
Adding archive storage directory.
sql/Makefile.am:
Adding archive library.
sql/ha_archive.cc:
Update for ha_archive to use azio.
sql/ha_archive.h:
Updates to support azio.
storage/Makefile.am:
Added archive directory.
storage/archive/Makefile.am:
New BitKeeper file ``storage/archive/Makefile.am''
storage/archive/archive_test.c:
New BitKeeper file ``storage/archive/archive_test.c''
storage/archive/azio.c:
New BitKeeper file ``storage/archive/azio.c''
storage/archive/azlib.h:
New BitKeeper file ``storage/archive/azlib.h''