Commit graph

130 commits

Author SHA1 Message Date
jani@hynda.mysql.fi
2fd7a743e4 Merge hynda.mysql.fi:/home/my/mysql-5.1-main
into  hynda.mysql.fi:/home/my/mysql-5.1-marvel
2007-08-21 19:03:28 +03:00
monty@narttu.mysql.fi
9d609a59fd Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2007-08-14 00:22:34 +03:00
monty@mysql.com/nosik.monty.fi
e53a73e26c Fixed a lot of compiler warnings and errors detected by Forte C++ on Solaris
Faster thr_alarm()
Added 'Opened_files' status variable to track calls to my_open()
Don't give warnings when running mysql_install_db
Added option --source-install to mysql_install_db

I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems
index_read()      -> index_read_map()
index_read_idx()  -> index_read_idx_map()
index_read_last() -> index_read_last_map()
2007-08-13 16:11:25 +03:00
bar@bar.myoffice.izhnet.ru
2be7a90a9a Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b28875v2
into  mysql.com:/home/bar/mysql-work/mysql-5.1-new-rpl
2007-08-07 19:30:23 +05:00
bar@mysql.com/bar.myoffice.izhnet.ru
7269c6cc6c Reversing additional change suggested by Serg
under terms of bug#28875 for better performance.
The change appeared to require more changes in item_cmpfunc.cc,
which is dangerous in 5.0.
    
Conversion between a latin1 column and an ascii string constant
stopped to work.
2007-08-07 19:25:45 +05:00
bar@bar.myoffice.izhnet.ru
fb8dff9721 Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b28875
into  mysql.com:/home/bar/mysql-work/mysql-5.1.b28875
2007-08-03 17:16:02 +05:00
bar@mysql.com/bar.myoffice.izhnet.ru
4eebfd09c2 Bug#28875 Conversion between ASCII and LATIN1 charsets does not function
(Regression, caused by a patch for the bug 22646).
Problem: when result type of date_format() was changed from
binary string to character string, mixing date_format()
with a ascii column in CONCAT() stopped to work.
Fix:
- adding "repertoire" flag into DTCollation class,
to mark items which can return only pure ASCII strings.
- allow character set conversion from pure ASCII to other character sets.
2007-08-03 15:25:23 +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
monty@narttu.mysql.fi
8a80e36ac3 Merge mysql.com:/home/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.1
Merge of 'remove compiler warnings when using -Wshadow'
2007-01-27 03:46:45 +02: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
kostja@bodhi.local
df18e193a2 Merge bodhi.local:/opt/local/work/tmp_merge
into  bodhi.local:/opt/local/work/mysql-5.1-root
2007-01-15 23:51:52 +03:00
kostja@bodhi.local
bf1005a125 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime
2007-01-11 21:59:28 +03:00
kent@kent-amd64.(none)
be15e3bc15 Merge mysql.com:/home/kent/bk/main/mysql-5.0
into  mysql.com:/home/kent/bk/main/mysql-5.1
2006-12-23 20:20:40 +01: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
anozdrin/alik@alik.
ba7a03759b Fix for BUG#24293: '\Z' token is not handled correctly in views.
If SELECT-part of CREATE VIEW statement contains '\Z',
it is not handled correctly.

The problem was in String::print().
Symbol with code 032 (26) is replaced with '\z',
which is not supported by the lexer.

The fix is to replace the symbol with '\Z'.
2006-12-19 15:32:02 +03: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@bar.intranet.mysql.r18.ru
cefa1cf9e0 Merge mysql.com:/usr/home/bar/mysql-5.0.b18908
into  mysql.com:/usr/home/bar/mysql-5.1-rpl
2006-11-01 16:48:03 +04:00
bar@mysql.com/bar.intranet.mysql.r18.ru
0e3a1eece7 Bug#18908: ERROR 1406 (22001): Data too long for column :: using utf8
Problem: Too confusing error message when cannot convert
between string and column character sets on INSERT and UPDATE.
Fix: producing a better error message, instead of "Data too long"
in such cases
Additional changes: Adding "DROP TABLE IF EXISTS" into several
tests to be safe against failures in previous tests.
2006-10-30 10:14:03 +04:00
tnurnberg@salvation.intern.azundris.com
fbff93ef75 Merge salvation.intern.azundris.com:/home/tnurnberg/21913/my50-21913
into  salvation.intern.azundris.com:/home/tnurnberg/21913/my51-21913
2006-09-05 22:55:55 +02:00
tnurnberg@salvation.intern.azundris.com
72c6c14bb2 Merge salvation.intern.azundris.com:/home/tnurnberg/21913/my41-21913
into  salvation.intern.azundris.com:/home/tnurnberg/21913/my50-21913

21913: DATE_FORMAT() Crashes mysql server if I use it through mysql-connector-j driver.

Variable character_set_results can legally be NULL (for "no conversion.")
This could result in a NULL deref that crashed the server.  Fixed.

(Although ran some additional precursory tests to see whether I could break
anything else, but no breakage so far.)
2006-09-04 07:01:15 +02:00
tnurnberg@salvation.intern.azundris.com
41f1932488 Bug#21913: DATE_FORMAT() Crashes mysql server if I use it through mysql-connector-j driver.
Variable character_set_results can legally be NULL (for "no conversion.")
This could result in a NULL deref that crashed the server.  Fixed.

(Although ran some additional precursory tests to see whether I could break
anything else, but no breakage so far.)
2006-09-04 06:16:34 +02:00
monty@mysql.com
49a3334889 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2006-06-19 13:00:36 +03:00
monty@mysql.com
860661a2dc unsigned char -> uchar
Added missing copyright
Indentation and prototype fixes
Fixed compiler warning
2006-06-19 12:45:34 +03:00
serg@serg.mylan
d00b56549c String::set(double) and set(longlong) -> set_real() and set_int()
fix Field::store(double) being used instead of store(longlong)

NB: overloading functions is evil
2006-06-16 12:17:20 +02:00
serg@serg.mylan
99fd8f728b cleanup String::set(integer) 2006-06-14 23:09:03 +02:00
elliot@mysql.com
c0b5b3cd40 Fix spelling in comments as requested by Osku
This will make charset code easier to understand
2006-05-02 09:13:58 -04:00
bar@mysql.com
1008146d86 Merge mysql.com:/usr/home/bar/mysql-4.1.b15376
into  mysql.com:/usr/home/bar/mysql-5.0
2006-03-23 12:41:28 +04:00
bar@mysql.com
9ac6e558d4 Bug#15375 Unassigned multibyte codes are broken
into parts when converting to Unicode.
m_ctype.h:
  Reorganizing mb_wc return codes to be able
  to return "an unassigned N-byte-long character".
sql_string.cc:
  Adding code to detect and properly handle
  unassigned characters (i.e. the those character
  which are correctly formed according to the 
  character specifications, but don't have Unicode
  mapping).
Many files:
  Fixing conversion function to return new codes.
ctype_ujis.test, ctype_gbk.test, ctype_big5.test:
  Adding a test case.
ctype_ujis.result, ctype_gbk.result, ctype_big5.result:
  Fixing results accordingly.
2005-12-12 21:42:09 +04:00
bell@sanja.is.com.ua
806f9e24ff Inefficient usage of String::append() fixed.
Bad examples of usage of a string with its length fixed.
The incorrect length in the trigger file configuration descriptor
  fixed (BUG#14090).
A hook for unknown keys added to the parser to support old .TRG files.
2005-11-20 20:47:07 +02:00
monty@mysql.com
775f17667b Merge with 4.1 2005-06-07 00:31:53 +03:00
serg@serg.mylan
6a5349028c a compiler must see '#pragma implementation' *before*
'#pragma interface' (that comes with the #include'd header file)
2005-06-05 19:38:52 +02:00
monty@mysql.com
29fd1f2fd9 Move USE_PRAGMA_IMPLEMENTATION to proper place
Ensure that 'null_value' is not accessed before val() is called in FIELD() functions
Fixed initialization of key maps. This fixes some problems with keys when you have more than 64 keys
Fixed that ROLLUP don't always create a temporary table. This fix ensures that func_gconcat.test results are now predictable
2005-06-03 23:46:03 +03:00
kent@mysql.com
f0fcc54b0c Merge 2005-06-02 04:45:09 +02:00
kent@mysql.com
bd48eed988 tztime.cc:
Set #pragma implementation" earlier
Many files:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
2005-06-02 02:43:32 +02:00
msvensson@neptunus.(none)
697cfe7f07 Merge from 4.1 2005-05-26 21:01:55 +02:00
msvensson@neptunus.(none)
83d430353e Add ifdefs to control when "#pragma implementation" should be used
Added some more ifdefs for "#pragma interface"
2005-05-26 12:09:14 +02:00
monty@mysql.com
594ef41b2d Cleanup during reviews
Removed some optional arguments
Fixed portability problem in federated tests
2005-03-16 16:11:01 +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
monty@mysql.com
071001950e Merge with 4.1 to get in latest bug fixes 2004-11-04 15:06:24 +02:00
tomas@poseidon.ndb.mysql.com
1827256ac5 fix call of string::copy() if HAVE_FCONVERT is set 2004-11-01 14:43:53 +00:00
monty@mysql.com
afbe601302 merge with 4.1 2004-10-29 19:26:52 +03:00
bar@mysql.com
7577c8bfc9 A fix according to Monty's request:
"uint *errors" is now a non-optional parameter in String:copy()
and copy_and_convert().
2004-10-29 17:00:39 +05:00
bar@mysql.com
541883f9d8 Produce a "truncated" warning if a value cannot be converted
into the column character set on INSERT/UPDATE.
2004-10-28 15:21:20 +05:00
monty@mishka.local
04c23808a8 Review of all code pushed since last review
Simple optimzations and cleanups
Removed compiler warnings and fixed portability issues
Added client functions 'mysql_embedded()' to allow client to check if we are using embedded server
Fixes for purify
2004-10-20 01:28:42 +03:00
monty@mysql.com
1e31199995 Merge with 4.1.3-beta 2004-07-07 11:29:39 +03: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
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
konstantin@mysql.com
f08bbd1f12 assert.h needed for my_dbug.h now is included in my_dbug.h, where it for
some reason wasn't included before.
A lot of files cleaned up from #include <assert.h>
2004-06-10 23:58:39 +04:00
pem@mysql.com
71eddc362e Merging 4.1 to 5.0. 2004-05-26 17:04:45 +02:00
bar@bar.intranet.mysql.r18.ru
d0c761e66b sql_string.h:
Not used code.
  ,
sql_string.cc:
  Not used code.
2004-05-25 16:05:33 +05:00