Commit graph

158 commits

Author SHA1 Message Date
gkodinov/kgeorge@magare.gmz
49285e96d9 Merge magare.gmz:/home/kgeorge/mysql/work/B29325-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B29325-5.1-opt
2007-07-11 11:57:49 +03:00
gkodinov/kgeorge@magare.gmz
015e1290a1 Bug #29325:
By default MyISAM overwrites .MYD and .MYI files no 
DATA DIRECTORY option is used. This can lead to two tables
using the same .MYD and .MYI files (that can't be dropped).

To prevent CREATE TABLE from overwriting a file a new option
is introduced : keep_files_on_create
When this is on the CREATE TABLE throws an error if either
the .MYD or .MYI exists for a MyISAM table.
The option is off by default (resulting in compatible behavior).
2007-07-11 10:49:54 +03:00
kostja@bodhi.(none)
6c352d16d9 Follow up after work on Bug 4968
Coding style: classes start with a capital letter.
Rename some classes related to parsing:
create_field -> Create_field
foreign_key -> Foreign_key
key_part_spec -> Key_part_spec
2007-06-10 14:43:57 +04:00
msvensson@pilot.blaudden
a65d12a830 Backport of TIME->MYSQL_TIME / Y2K fixset
Made year 2000 handling more uniform
Removed year 2000 handling out from calc_days()
The above removes some bugs in date/datetimes with year between 0 and 200
Now we get a note when we insert a datetime value into a date column
For default values to CREATE, don't give errors for warning level NOTE
Fixed some compiler failures
Added library ws2_32 for windows compilation (needed if we want to compile with IOCP support)
Removed duplicate typedef TIME and replaced it with MYSQL_TIME

Better (more complete) fix for: Bug#21103 "DATE column not compared as DATE"
Fixed properly Bug#18997 "DATE_ADD and DATE_SUB perform year2K autoconversion magic on 4-digit year value"
Fixed Bug#23093 "Implicit conversion of 9912101 to date does not match cast(9912101 as date)"
2007-05-16 10:44:59 +02: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@mysql.com/narttu.mysql.fi
1933603647 Removed not used define YY_MAGIC_BELOW
Made year 2000 handling more uniform
Removed year 2000 handling out from calc_days()
The above removes some bugs in date/datetimes with year between 0 and 200
Now we get a note when we insert a datetime value into a date column
For default values to CREATE, don't give errors for warning level NOTE
Fixed some compiler failures
Added library ws2_32 for windows compilation (needed if we want to compile with IOCP support)
Removed duplicate typedef TIME and replaced it with MYSQL_TIME

Better (more complete) fix for: Bug#21103 "DATE column not compared as DATE"
Fixed properly Bug#18997 "DATE_ADD and DATE_SUB perform year2K autoconversion magic on 4-digit year value"
Fixed Bug#23093 "Implicit conversion of 9912101 to date does not match cast(9912101 as date)"
2007-03-23 22:08:31 +02:00
monty@mysql.com/narttu.mysql.fi
f0ae3ce9b9 Fixed compiler warnings
Fixed compile-pentium64 scripts
Fixed wrong estimate of update_with_key_prefix in sql-bench
Merge bk-internal.mysql.com:/home/bk/mysql-5.1 into mysql.com:/home/my/mysql-5.1
Fixed unsafe define of uint4korr()
Fixed that --extern works with mysql-test-run.pl
Small trivial cleanups
This also fixes a bug in counting number of rows that are updated when we have many simultanous queries
Move all connection handling and command exectuion main loop from sql_parse.cc to sql_connection.cc
Split handle_one_connection() into reusable sub functions.
Split create_new_thread() into reusable sub functions.
Added thread_scheduler; Preliminary interface code for future thread_handling code.

Use 'my_thread_id' for internal thread id's
Make thr_alarm_kill() to depend on thread_id instead of thread
Make thr_abort_locks_for_thread() depend on thread_id instead of thread
In store_globals(), set my_thread_var->id to be thd->thread_id.
Use my_thread_var->id as basis for my_thread_name()
The above changes makes the connection we have between THD and threads more soft.

Added a lot of DBUG_PRINT() and DBUG_ASSERT() functions
Fixed compiler warnings
Fixed core dumps when running with --debug
Removed setting of signal masks (was never used)
Made event code call pthread_exit() (portability fix)
Fixed that event code doesn't call DBUG_xxx functions before my_thread_init() is called.
Made handling of thread_id and thd->variables.pseudo_thread_id uniform.
Removed one common 'not freed memory' warning from mysqltest
Fixed a couple of usage of not initialized warnings (unlikely cases)
Suppress compiler warnings from bdb and (for the moment) warnings from ndb
2007-02-23 13:13:55 +02:00
monty@mysql.com/narttu.mysql.fi
e5cc397f33 Fixed compiler warnings (for linux and win32 and win64)
Fixed a couple of usage of not initialized warnings (unlikely cases)
2007-02-22 16:59:57 +02:00
monty@mysql.com/narttu.mysql.fi
26aa385bc5 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2007-02-21 14:07:08 +02:00
tnurnberg@mysql.com/sin.azundris.com
293352cbe4 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/home/tnurnberg/24660/50-24660
2007-02-12 14:49:34 +01:00
tnurnberg@mysql.com/sin.azundris.com
ed82b013b8 Merge mysql.com:/home/tnurnberg/24660/41-24660
into  mysql.com:/home/tnurnberg/24660/50-24660
2007-02-12 14:32:06 +01:00
tnurnberg@mysql.com/sin.azundris.com
db7ac2c0c7 Bug#24660: "enum" field type definition problem
ENUMs weren't allowed to have character 0xff, a perfectly good character in some locales.
This was circumvented by mapping 0xff in ENUMs to ',', thereby prevent actual commas from
being used. Now if 0xff makes an appearance, we find a character not used in the enum and
use that as a separator. If no such character exists, we throw an error.

Any solution would have broken some sort of existing behaviour. This solution should
serve both fractions (those with 0xff and those with ',' in their enums), but
WILL REQUIRE A DUMP/RESTORE CYCLE FROM THOSE WITH 0xff IN THEIR ENUMS. :-/
That is, mysqldump with their current server, and restore when upgrading to one with
this patch.
2007-02-12 14:31:44 +01: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
tnurnberg@mysql.com/sin.azundris.com
90a8092660 Bug#24660: "enum" field type definition problem
ENUMs weren't allowed to have character 0xff, a perfectly good
character in some locales.  This was circumvented by mapping 0xff in
ENUMs to ',', thereby prevent actual commas from being used. Now if
0xff makes an appearance, we find a character not used in the enum and
use that as a separator. If no such character exists, we throw an
error.

Any solution would have broken some sort of existing behaviour. This
solution should serve both fractions (those with 0xff and those with
',' in their enums), but WILL REQUIRE A DUMP/RESTORE CYCLE FROM THOSE
WITH 0xff IN THEIR ENUMS. :-/ That is, mysqldump with their current
server, and restore when upgrading to one with this patch.
2007-01-12 11:06:38 +01:00
kent@kent-amd64.(none)
58763e383e Merge mysql.com:/home/kent/bk/main/mysql-5.0
into  mysql.com:/home/kent/bk/main/mysql-5.1
2006-12-31 01:32:21 +01:00
kent@mysql.com/kent-amd64.(none)
6523aca729 my_strtoll10-x86.s:
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
2006-12-31 01:02:27 +01: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
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
brian@zim.(none)
31d67280f7 This finishes the work (someone) started to remove FIELD_ types and use the Enum MYSQL types. The second part to this is to actually deprecate the FIELD defines in mysql_com.h 2006-12-01 17:26:52 -08:00
monty@nosik.monty.fi
89570bf966 Merge mysql.com:/home/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.1
2006-11-22 14:11:36 +02:00
monty@mysql.com/nosik.monty.fi
e825879800 Remove compiler warnings
(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 #)
2006-11-20 22:42:06 +02:00
holyfoot/hf@deer.(none)
06978991cc Merge mysql.com:/home/hf/mysql-5.0.mrg
into  mysql.com:/home/hf/mysql-5.1.mrg
2006-10-12 15:42:05 +05:00
holyfoot/hf@mysql.com/deer.(none)
edc9026842 Merge bk@192.168.21.1:mysql-4.1
into  mysql.com:/home/hf/mysql-5.0.mrg
2006-10-12 13:50:22 +05:00
gluh@mysql.com/gluh.(none)
4f553f1d5f Merge mysql.com:/home/gluh/MySQL/Merge/4.1
into  mysql.com:/home/gluh/MySQL/Merge/4.1-kt
2006-10-05 16:38:21 +05:00
tsmith/tim@siva.hindu.god
44f0e55ca4 Merge siva.hindu.god:/usr/home/tim/m/bk/50
into  siva.hindu.god:/usr/home/tim/m/bk/mrg/51
2006-09-29 18:04:34 -06:00
igor@rurik.mysql.com
2e2c5a20c0 Merge rurik.mysql.com:/home/igor/mysql-4.1-opt
into  rurik.mysql.com:/home/igor/mysql-5.0-opt
2006-09-20 09:47:36 -07:00
igor@rurik.mysql.com
d957636471 Fixed bug #20108.
Any default value for a enum fields over UCS2 charsets was corrupted
when we put it into the frm file, as it had been overwritten by its
HEX representation.
To fix it now we save a copy of structure that represents the enum
type and when putting the default values we use this copy.
2006-09-20 09:46:12 -07:00
gluh@mysql.com/gluh.(none)
8f44d902bd Bug#20922 mysql removes a name of first column in a table
0xFF is internal separator for SET|ENUM names. 
If this symbol is present in SET|ENUM names then we replace it with 
','(deprecated symbol for SET|ENUM names) during frm creation
and restore to 0xFF during frm opening
2006-09-11 14:50:46 +05:00
msvensson@neptunus.(none)
fe40a8cf9d Merge bk-internal:/home/bk/mysql-5.1
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
2006-07-19 08:57:52 +02:00
gluh@myoffice.izhnet.ru
f76aec6d90 Merge myoffice.izhnet.ru:/usr/home/gluh/MySQL/tmp_merge
into  myoffice.izhnet.ru:/usr/home/gluh/MySQL/5.1
2006-07-18 18:43:55 +05:00
cmiller@zippy.(none)
91b8b26411 Merge zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.1
into  zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.1-new-maint
2006-07-05 16:16:09 -04:00
gluh@eagle.intranet.mysql.r18.ru
a230166f28 Fix for bug#13934 Silent truncation of table comments
Table comment: issue a warning(error in traditional mode) if length of comment > 60 symbols
Column comment: issue a warning(error in traditional mode) if length of comment > 255 symbols
Table 'comment' is changed from char* to LEX_STRING
2006-06-29 18:39:34 +05:00
mikael@dator5.(none)
32c25c8e2f BUG#16000: .par file not removed plus errors to error log for normal errors 2006-06-20 13:24:30 -04:00
msvensson@neptunus.(none)
27ec02b216 Merge neptunus.(none):/home/msvensson/mysql/my51-bug15936
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
2006-06-07 12:05:42 +02:00
mikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se
c85be97f50 Merge c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/clean-mysql-5.1-new
into  c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug19010
2006-05-12 12:22:31 -04:00
mikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se
56b97747de BUG#19010: Fix issues with that ALTER TABLE from auto-partitioned NDB table doesn't work unless primary key exists on table. 2006-05-10 12:53:40 -04:00
monty@mysql.com
343644dd5d Added support for key_block_size for key and table level (WL#602)
Added support for key_block_size to MyISAM.
Simplify interface to 'new Key' to make it easier to add new key options.
mysqld option --new is used to define where key options are printed.
(In 5.3 we should move all key options to after key part definition to avoid problem with reserved names)
Fixed some compiler warnings and a memory leak in ssl
2006-05-03 15:59:17 +03:00
mikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se
14d75e5b9f WL 2826: Error handling of ALTER TABLE for partitioning
Fixed up create_handler_files call
2006-04-19 21:43:30 -04:00
mikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se
09e95da616 Merge c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/clean-mysql-5.1-new
into  c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/wl2826
2006-04-19 21:22:35 -04:00
msvensson@shellback.
661d572ae1 Remove unused defined USES_TYPES 2006-04-11 20:12:57 +02:00
marty@linux.site
950e258fde Fixes for fast alter table for ndbcluster 2006-04-11 14:06:32 +02:00
pappa@c-8808e253.1238-1-64736c10.cust.bredbandsbolaget.se
3dc4635c70 Merge c-8808e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-5.1-new
into  c-8808e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/wl2826
2006-03-21 10:44:59 -05:00
holyfoot@vva.(none)
8074262eda bug 17290 and bug 14350
added THD::work_part_info member where we now store modified
partition_info structure.
It allows no solve problem when different parts of the part_info get
into different mem_roots
2006-03-18 18:48:21 +04:00
mikron@mikael-ronstr-ms-dator.local
954dacfc28 WL 2826: Fourth step
Remove partition state from frm file
Ensure we can still load tables created in 5.1.6 for the time
being
2006-02-01 17:05:22 +01:00
mikron@c-4d08e253.1238-1-64736c10.cust.bredbandsbolaget.se
08e12cada9 WL 2826: First step in error handling of ALTER TABLE for partitioning 2006-02-01 10:06:07 +01:00
serg@serg.mylan
10373a900f two buffer overflows fixed 2006-01-28 19:21:40 +01:00
mikron@c-1e0be253.1238-1-64736c10.cust.bredbandsbolaget.se
e802a94284 WL #2604: Partition Management
Optimised version of ADD/DROP/REORGANIZE partitions for
non-NDB storage engines.
New syntax to handle REBUILD/OPTIMIZE/ANALYZE/CHECK/REPAIR partitions
Quite a few bug fixes
2006-01-17 08:40:00 +01:00
bar@mysql.com
6ff211329f WL#1324 table name to file name encoding
- Encoding itself, implemented as a charset
  "filename". Originally planned to use '.'
  as an escape character, but now changed to '@'
  for two reasons: "ls" does not return
  file names starting with '.' considering them
  as a kind of hidden files; some platforms
  do not allow several dots in a file name.
- replacing many calls of my_snprintf() and
  strnxmov() to the new build_table_filename().
- Adding MY_APPEND_EXT mysys flag, to append
  an extention rather that replace it.
- Replacing all numeric constants in fn_format
  flag arguments to their mysys definitions, e.g.
  MY_UNPACK_FILENAME,
- Predictability in several function/methods:
  when a table name can appear with or withot .frm
  extension. Some functions/methods were changed
  so accept names strictly with .frm, other - strictly
  without .frm extensions. Several DBUG_ASSERTs were
  added to check whether an extension is passed.
Many files:
  table name to file name encoding
mysql_priv.h:
  Prototypes for new table name encoding tools.
ctype-utf8.c:
  Implementing "filename" charset for
  table name to file name encoding.
row0mysql.c:
  Fixing table name prefix.
mf_format.c:
  Adding MY_APPEND_EXT processing.
Many files:
  Fixing tests.
my_sys.h:
  Adding new flag to append rather than replace an extension.
m_ctype.h:
  Adding "filename" charset definition.
2005-12-31 09:01:26 +04:00