server
The problem was that when memory was exhausted HEAP engine could crash
(GROUP BY uses HEAP TABLE). Alternatively, if SET was used, it could
report an error "You may only use constant expressions with SET" instead
of "Out of memory (Needed NNNNNN bytes)".
The solution is:
- pass MY_WME to (some) calls to my_malloc() to get correct message.
- fix heap_write() so that the first key is skipped during cleanup
on ENOMEM because it wasn't inserted and doesn't have to be
deleted.
No test case is provided because we can't test out-of-memory behaviour
in our current test framework.
Corrected spelling in copyright text
Makefile.am:
Don't update the files from BitKeeper
Many files:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
Many files:
Added GPL copyright text
Removed files:
Docs/Support/colspec-fix.pl
Docs/Support/docbook-fixup.pl
Docs/Support/docbook-prefix.pl
Docs/Support/docbook-split
Docs/Support/make-docbook
Docs/Support/make-makefile
Docs/Support/test-make-manual
Docs/Support/test-make-manual-de
Docs/Support/xwf
Fixed compiler warnings (detected by VC++):
- Removed not used variables
- Added casts
- Fixed wrong assignments to bool
- Fixed wrong calls with bool arguments
- Added missing argument to store(longlong), which caused wrong store method to be called.
(Mostly in DBUG_PRINT() and unused arguments)
Fixed bug in query cache when used with traceing (--with-debug)
Fixed memory leak in mysqldump
Removed warnings from mysqltest scripts (replaced -- with #)
SELECT WHERE a= AND b=
Selecting data from memory table with varchar column and hash index over it
returns only first row matched.
Problem was that key length calculation for varchar columns didn't include
number of bytes to store length.
Fixed key length for varchar fields to include number of bytes to store length.
Updating data in HEAP table with BTREE index results in wrong index_length
counter value, which keeps growing after each update.
When inserting new record into tree counter is incremented by:
sizeof(TREE_ELEMENT) + key_size + tree->size_of_element
But when deleting element from tree it doesn't decrement counter by key_size:
sizeof(TREE_ELEMENT) + tree->size_of_element
This fix makes accurate allocated memory counter for tree. That is
decrease counter by key_size when deleting tree element.
Two handler objects were present, one was used for an insert and the other for a select
The state of the statistics was local to the handler object and thus the other handler
object didn't notice the insert.
Fix included:
1) Add a new variable key_stat_version added to whenever statistics was considered in need
of update (previously key_stats_ok= FALSE in those places)
2) Add a new handler variable key_stat_version assigned whenever key_stats_ok= TRUE was set
previously
3) Fix records_in_range to return records if records <= 1
4) Fix records_in_range to add 2 to rec_per_key to ensure we don't specify 0 or 1 when it isn't
and thus invoking incorrect optimisations.
5) Fix unique key handling for HEAP table in records_in_range
UNION doesn't return DISTINCT result for multi-byte characters
hp_hash.c:
This piece of code was pretty wrong, looks
like no necessary changes were made after
cut-and-paste from fixed length segment processing.
Itroduced two new variables safe_length1 and
safe_length2 to remember the original lengths.
Fixing my_charpos and set_if_smaller calls
to pass correct parameters.
ctype_utf8.result, ctype_utf8.test:
adding test case
On 64 bit platforms the changed statement doesn't work
so making sure that the larger value is first and using
subtraction is a quick and backwards-compatible fix of this
line.
Added a test case for bug #11484.
hp_hash.c:
Fixed bug #11484.
This bug in the function hp_rec_key_cmp resulted in wrong
comparison of varchar multibyte keys if the bytes after
string values happened to be different. This caused wrong
results for queries returning DISTINCT varchar fields in
multibyte charsets (e.g. in utf8).
Add support for VARCHAR with 1 or 2 length bytes
Enable VARCHAR packing in MyISAM files (previous patch didn't pack data properly)
Give error if we got problems in temporary tables during a SELECT
Don't use new table generated by ALTER TABLE if index generation fails
Fixed wrong call by range_end() (Could cause an ASSERT in debug mode)
Renamed HA_VAR_LENGTH to HA_VAR_LENGTH_PART
Renamed in all files FIELD_TYPE_STRING and FIELD_TYPE_VAR_STRING to MYSQL_TYPE_STRING and MYSQL_TYPE_VAR_STRING to make it easy to catch all possible errors
Added support for VARCHAR KEYS to heap
Removed support for ISAM
Now only long VARCHAR columns are changed to TEXT on demand (not CHAR)
Internal temporary files can now use fixed length tables if the used VARCHAR columns are short