Commit graph

56 commits

Author SHA1 Message Date
bar@bar.myoffice.izhnet.ru
14df7c7087 Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b27345
into  mysql.com:/home/bar/mysql-work/mysql-5.1-new-rpl
2007-07-03 14:06:57 +05:00
bar@mysql.com/bar.myoffice.izhnet.ru
d3f43c874e Bug#27345 Incorrect data returned when range-read from utf8_danish_ci indexes
Problem: like_range() returned wrong ranges for contractions (like 'ch' in Czech').
Fix: adding a special code to handle tricky cases:
- contraction head followed by a wild character
- full contraction
- contraction part followed by another contraction part,
  but they are not a contraction together.
2007-06-28 13:34:44 +05:00
tsmith@maint1.mysql.com
8ee2c2b04e Merge maint1.mysql.com:/data/localhome/tsmith/bk/maint/50
into  maint1.mysql.com:/data/localhome/tsmith/bk/maint/51
2007-06-21 20:55:37 +02:00
bar@mysql.com/bar.myoffice.izhnet.ru
d3c4f1b22b Bug#28916 LDML doesn't work for utf8
and is not described in the manual
- Adding missing initialization for utf8 collations
- Minor code clean-ups: renaming variables,
  moving code into a new separate function.
- Adding test, to check that both ucs2 and utf8 user
  defined collations work (ucs2_test_ci and utf8_test_ci)
- Adding Vietnamese collation as a complex user defined
  collation example.
2007-06-07 17:55:55 +05:00
monty@mysql.com/narttu.mysql.fi
088e2395f1 WL#3817: Simplify string / memory area types and make things more consistent (first part)
The following type conversions was done:

- Changed byte to uchar
- Changed gptr to uchar*
- Change my_string to char *
- Change my_size_t to size_t
- Change size_s to size_t

Removed declaration of byte, gptr, my_string, my_size_t and size_s. 

Following function parameter changes was done:
- All string functions in mysys/strings was changed to use size_t
  instead of uint for string lengths.
- All read()/write() functions changed to use size_t (including vio).
- All protocoll functions changed to use size_t instead of uint
- Functions that used a pointer to a string length was changed to use size_t*
- Changed malloc(), free() and related functions from using gptr to use void *
  as this requires fewer casts in the code and is more in line with how the
  standard functions work.
- Added extra length argument to dirname_part() to return the length of the
  created string.
- Changed (at least) following functions to take uchar* as argument:
  - db_dump()
  - my_net_write()
  - net_write_command()
  - net_store_data()
  - DBUG_DUMP()
  - decimal2bin() & bin2decimal()
- Changed my_compress() and my_uncompress() to use size_t. Changed one
  argument to my_uncompress() from a pointer to a value as we only return
  one value (makes function easier to use).
- Changed type of 'pack_data' argument to packfrm() to avoid casts.
- Changed in readfrm() and writefrom(), ha_discover and handler::discover()
  the type for argument 'frmdata' to uchar** to avoid casts.
- Changed most Field functions to use uchar* instead of char* (reduced a lot of
  casts).
- Changed field->val_xxx(xxx, new_ptr) to take const pointers.

Other changes:
- Removed a lot of not needed casts
- Added a few new cast required by other changes
- Added some cast to my_multi_malloc() arguments for safety (as string lengths
  needs to be uint, not size_t).
- Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done
  explicitely as this conflict was often hided by casting the function to
  hash_get_key).
- Changed some buffers to memory regions to uchar* to avoid casts.
- Changed some string lengths from uint to size_t.
- Changed field->ptr to be uchar* instead of char*. This allowed us to
  get rid of a lot of casts.
- Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar
- Include zlib.h in some files as we needed declaration of crc32()
- Changed MY_FILE_ERROR to be (size_t) -1.
- Changed many variables to hold the result of my_read() / my_write() to be
  size_t. This was needed to properly detect errors (which are
  returned as (size_t) -1).
- Removed some very old VMS code
- Changed packfrm()/unpackfrm() to not be depending on uint size
  (portability fix)
- Removed windows specific code to restore cursor position as this
  causes slowdown on windows and we should not mix read() and pread()
  calls anyway as this is not thread safe. Updated function comment to
  reflect this. Changed function that depended on original behavior of
  my_pwrite() to itself restore the cursor position (one such case).
- Added some missing checking of return value of malloc().
- Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow.
- Changed type of table_def::m_size from my_size_t to ulong to reflect that
  m_size is the number of elements in the array, not a string/memory
  length.
- Moved THD::max_row_length() to table.cc (as it's not depending on THD).
  Inlined max_row_length_blob() into this function.
- More function comments
- Fixed some compiler warnings when compiled without partitions.
- Removed setting of LEX_STRING() arguments in declaration (portability fix).
- Some trivial indentation/variable name changes.
- Some trivial code simplifications:
  - Replaced some calls to alloc_root + memcpy to use
    strmake_root()/strdup_root().
  - Changed some calls from memdup() to strmake() (Safety fix)
  - Simpler loops in client-simple.c
2007-05-10 12:59:39 +03:00
bar@mysql.com
d5c6680443 Code layout fix for bug N 27079
Thanks to Gluh for suggestion.
2007-03-29 10:32:38 +05:00
bar@mysql.com
1b426d3c6d Bug#27079 Crash while grouping empty ucs2 strings
Problem: GROUP BY on empty ucs2 strings crashed server.
Reason: sometimes mi_unique_hash() is executed with
ptr=null and length=0, which means "empty string".
The branch of code handling UCS2 character set
was not safe against ptr=null and fell into and
endless loop even if length=0 because of poiter
arithmetic overflow.
Fix: adding special check for length=0 to avoid pointer arithmetic
overflow.
2007-03-27 12:20:20 +05:00
monty@mysql.com/narttu.mysql.fi
a04157fbb3 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2007-01-22 14:04:40 +02:00
kent@mysql.com/kent-amd64.(none)
226a5c833f Many files:
Changed header to GPL version 2 only
2006-12-23 20:17:15 +01:00
monty@mysql.com/narttu.mysql.fi
88dd873de0 Fixed compiler warnings detected by option -Wshadow and -Wunused:
- Removed not used variables and functions
- Added #ifdef around code that is not used
- Renamed variables and functions to avoid conflicts
- Removed some not used arguments

Fixed some class/struct warnings in ndb
Added define IS_LONGDATA() to simplify code in libmysql.c

I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes
2006-12-15 00:51:37 +02:00
bar@mysql.com
7f843ffe87 ctype_uca.result, ctype_uca.test:
Adding test case.
charset-def.c:
  Initialize new collation.
ctype-uca.c:
  Adding simplified Hungarian collation.
2005-12-23 14:20:00 +04:00
bar@mysql.com
39b0712cf7 type_binary.result, type_binary.test:
new file
mysql_fix_privilege_tables.sql, mysql_create_system_tables.sh:
  Adding true BINARY/VARBINARY: fixing "password" type, not to be 0x00-padding.
Many files:
  Adding true BINARY/VARBINARY: fixing tests not to output 0x00 bytes.
  Adding true BINARY/VARBINARY: new pad_char structure member.
ctype-bin.c:
  Adding true BINARY/VARBINARY: new pad_char structure member.
  New strnxfrm, with two trailing length bytes.
field.cc:
  Adding true BINARY/VARBINARY.
2005-10-13 19:16:19 +05:00
bar@mysql.com
833bccfe57 Many files:
Adding esperanto collation
2005-09-12 19:35:50 +05:00
elliot@mysql.com
55b81af671 Merge mysql.com:/home/emurphy/src/bk-clean/mysql-4.1
into  mysql.com:/home/emurphy/src/work/mysql-5.0
2005-08-19 15:29:30 -04:00
elliot@mysql.com
197782605f BUG#11338 (logging of prepared statement w/ blob type)
In cp932, '\' character can be the second byte in a 
multi-byte character stream. This makes it difficult to use
mysql_escape_string. Added flag to indicate which languages allow
'\' as second byte of multibyte sequence so that when putting a prepared
statement into the binlog we can decide at runtime whether hex encoding
is really needed.
2005-08-17 04:26:32 -04:00
georg@lmy002.wdf.sap.corp
b64e6db5a4 fixes for windows 64-bit compiler warnings 2005-06-13 12:41:15 +02:00
bar@mysql.com
2df945d87b Bug#8610: The ucs2_turkish_ci collation fails with upper('i')
UPPER/LOWER now can return a string with different length.

mi_test1.c:
  Adding new arguments.
Many files:
  Changeing caseup/casedn to return a result with different
  length than argument.
sql_string.h:
  Removing unused method,
mysql_priv.h:
  Removing unused method
2005-06-06 16:54:15 +05:00
bar@noter.(none)
153b928c10 Bug#9509 Optimizer: wrong result after AND with latin1_german2_ci
We cannot propagate constants with tricky collations.
2005-05-05 21:13:57 +05:00
bar@mysql.com
856378bdda Merge mysql.com:/usr/home/bar/mysql-4.1
into mysql.com:/usr/home/bar/mysql-5.0
2005-04-04 18:04:29 +05:00
bar@mysql.com
d9f8b501db ctype_uca.result:
fixing test results accordingly.
ctype-uca.c:
  It appeared that in traditional Spanish collation
  'RR' is not equal to 'R', as Unicode and Mimer state.
  We'll go Oracle and IBM way instead:
  No special rules to 'RR'.
2005-04-04 17:55:12 +05:00
bar@mysql.com
dcb0f52e9a Merge: don't add this into configure in as it is already in
config/ac-macros/character_sets.m4
2005-02-18 13:21:30 +04:00
bar@mysql.com
c926e43f65 A way not to compile UCA collations 2005-02-18 12:58:16 +04:00
bar@mysql.com
8828884f4c CSC#4385: slow sorting for UTF8 large table:
my_strnxfrm_utf8 now requires 2 bytes per character
in filesort key, instead of 3 bytes per character.
Shorter filesort keys make sorting faster.
2005-01-26 16:34:09 +04:00
konstantin@mysql.com
ebefcc616a fix C++ comments in C file (fixed in 5.0 already) 2005-01-14 01:59:03 +03:00
konstantin@mysql.com
9e10645cff Fix valgrind warning + post-merge fixes. 2005-01-13 19:03:21 +03:00
konstantin@mysql.com
a676498977 manual merge 2005-01-13 17:31:49 +03:00
bar@mysql.com
e3d6e6736b bug#7284: strnxfrm returns different results for equal strings 2005-01-13 18:12:04 +04:00
monty@mysql.com
77207d19f2 Merge with new VARCHAR code 2004-12-06 19:18:35 +02:00
monty@mysql.com
67ce247965 Add support for up to VARCHAR (size up to 65535)
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
2004-12-06 02:00:37 +02:00
bar@mysql.com
0f79f61480 Bug#6787 LIKE not working properly with _ and utf8 data 2004-11-24 20:09:54 +04:00
bar@mysql.com
f9d1a5a1c6 Incorrect response with partial utf8 index 2004-11-19 14:25:25 +04:00
bar@mysql.com
701b646374 ctype-uca.c:
Optimization: move "space padding" code outside the loop
2004-10-21 19:17:04 +05:00
bar@mysql.com
e28976e0ef Bug #5679 utf8_unicode_ci LIKE--trailing % doesn't equal zero characters 2004-10-21 14:48:37 +05:00
bar@mysql.com
134b5c7d75 Persian collation, contibuted by Jody McIntyre 2004-09-13 12:07:01 +05:00
bar@mysql.com
09f681ba7b Bug #5324 Bug in UCA collations with LIKE comparisons and INDEX 2004-09-06 20:04:22 +05:00
bar@mysql.com
a554f7756d ctype_uca.test, ctype_uca.result, ctype-uca.c:
Slovak collation didn't work: typo fix in the tailoring rules
2004-08-11 18:06:20 +05:00
bar@mysql.com
d2076ae8d5 Minor fix: V is primary level, not U. 2004-07-08 15:19:26 +05:00
bar@mysql.com
aa679b62c0 Adding Roman (classical Latin) collation. 2004-07-07 15:20:23 +05:00
bar@mysql.com
a1aa3da96a ctype-uca.c:
mbminlen was wrong for UTF8.
2004-06-30 14:45:08 +05:00
bar@deer.(none)
92833475e7 ctype-uca.c:
Code optimization to make it look better and work faster.
2004-06-18 11:00:51 +05:00
bar@deer.(none)
efc2936e5e ctype-uca.c:
Fix for compilation failure when HAVE_CHARSET_ucs2 is not defined.
2004-06-18 10:24:31 +05:00
bar@mysql.com
f814d224f7 Critical fixes after review:
- mutex was unlocked before the end of the critical sesion,
- Portability issue: It's better to use (*alloc)(x) instead of alloc(x),
  if alloc is a function passed as an argument.
- Use {} around if() block, to avoid possible problems with some Windows compilers.
2004-06-16 19:06:45 +05:00
bar@mysql.com
7fd6503dfc ctype-uca.c:
Compilation failure fix.
2004-06-15 09:33:02 +05:00
bar@mysql.com
6342e06cb2 utf8 contraction fix.
Polish collation fix.
Slovak collation fix.
Testing all language orders.
2004-06-14 21:55:36 +05:00
bar@mysql.com
5dd2881f54 UTF8 UCA based collations. 2004-06-14 16:29:51 +05:00
bar@mysql.com
cbd3e61c8d Unicode collation algorithm: contraction support.
E.g. 'Ch' is treated as a separate letter in Czech,
not as a combination of C+h.
2004-06-12 20:36:58 +05:00
serg@serg.mylan
035e03c1f6 merged 2004-06-11 20:55:08 +02:00
bar@mysql.com
fc7ba0885e Move UCA language specific definitions into ctype-ucs.c. 2004-06-11 19:16:06 +05:00
bar@mysql.com
c64d93b274 Allocate memory when a character set is requested:
- For simple character sets: from_uni convertion table.
- For UCA: alternative weight arrays.
Use mbminlen instead of MY_CS_NONTEXT
2004-06-11 16:29:16 +05:00
serg@serg.mylan
78fa465b92 bug#3964 and related issues: FTB problems with charsets where one byte can match many
correct prefix compare with my_strnncoll
2004-06-10 21:18:57 +02:00