Commit graph

68 commits

Author SHA1 Message Date
kent@mysql.com/kent-amd64.(none)
226a5c833f Many files:
Changed header to GPL version 2 only
2006-12-23 20:17:15 +01:00
msvensson@neptunus.(none)
4c26bf9c1d Bug#19371 VARBINARY() have trailing zeros after upgrade from 4.1
- Detect if a table has field of type MYSQL_TYPE_VAR_STRING while running
   "CHECK TABLE t FOR UPGRADE" and indicate it need to be fixed
   with "REPAIR TABLE t".
 - When running a "REPAIR TABLE t" or "ALTER TABLE t FORCE" on the above
   table, install a special copy function to trim off the trailing spaces
   which we safely can say that the pre 5.0 mysqld didn't put there.
2006-11-09 12:00:27 +01:00
bar@mysql.com/bar.intranet.mysql.r18.ru
15887b602b Bug#19960 Inconsistent results when joining InnoDB tables using partial UTF8 indexes
Adding a multibyte-aware VARCHAR copying function, to put correct column prefix,
  taking in account number of characters (instead just limiting on number of bytes).
  For example, for a KEY(col(3)) on a UTF8 column when copying the string 'foo bar foo',
  we should put only 3 leftmost characters: 'foo'.
  9 characters were incorrectly put before this fix.
2006-09-29 16:15:57 +05:00
kroki@mysql.com
96bddcafe7 Bug#17226: Variable set in cursor on first iteration is assigned
second iterations value

During assignment to the BLOB variable in routine body the value
wasn't copied.
2006-06-30 18:14:22 +04:00
anozdrin@mysql.com
65b87b86a3 Fix for BUG#18587: Function that accepts and returns TEXT
garbles data if longer than 766 chars.

The problem is that a stored routine returns BLOBs to the previous
caller, BLOBs are shallow-copied (i.e. only pointers to the data are
copied). The fix is to also copy data of BLOBs.
2006-05-10 23:16:30 +04:00
cmiller@zippy.(none)
5147bb8e9b Expanding a binary field should result in 0x00-filled positions, not 0x20
(ASCII space).  For Bug#16857.
2006-03-02 19:59:49 -05:00
monty@mishka.mysql.fi
f348f62cc3 Added option --valgrind-mysqltest to mysql-test-run
Added flag to Field::store(longlong) to specify if value is unsigned.
This fixes bug #12750: Incorrect storage of 9999999999999999999 in DECIMAL(19, 0)
Fixed warning from valgrind in CREATE ... SELECT
Fixed double free of mysql.options if reconnect failed
2005-09-14 01:41:44 +03:00
evgen@moonbone.local
eb6135a765 Fix bug #11398 Bug in field_conv() results in wrong result of join with index
When copying varchar fields with field_conv() it's not taken into account
that length_bytes of source and destination fields may be different.
This results in saving wrong data in field and making wrong key later.

Added check so if fields are varchar and have different length_bytes they
are not copied by memcpy().
2005-08-16 22:13:43 +04:00
jimw@mysql.com
63c6ece728 Cleanups after merge from 4.1. 2005-07-19 16:32:38 -07:00
jimw@mysql.com
80c1c6b33f Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-07-19 11:05:49 -07:00
monty@mishka.local
7e83d09ce7 Simple fixes during review of new code 2005-07-19 19:25:05 +03:00
bar@mysql.com
2204effda1 Merge mysql.com:/usr/home/bar/mysql-4.1
into  mysql.com:/usr/home/bar/mysql-5.0
2005-07-12 13:18:25 +05:00
bar@mysql.com
1042a275fe field_conv.cc:
Identation fix
2005-07-11 16:51:39 +05:00
bar@mysql.com
45fe5e74d8 field_conv.cc:
Bug#11591
  CHAR column with utf8 does not work properly
  (more chars than expected)
  do_cut_string didn't call well_formed_length,
  and copied all data, which was wrong in the
  case of multibyte character set.
ctype_utf8.result, ctype_utf8.test:
  adding test case
2005-07-11 13:20:07 +05:00
monty@mysql.com
0b75f6e37b compatibility issues
Fixed errors reported by valgrind (some errors in NDB remains)
2005-05-20 16:14:35 +03:00
ramil@mysql.com
c4376b2bc6 Bit type support for non-MyISAM tables. 2005-04-12 12:27:43 +05:00
monty@mysql.com
201ee3eb78 Invalid DEFAULT values for CREATE TABLE now generates errors. (Bug #5902)
CAST() now produces warnings when casting a wrong INTEGER or CHAR values. This also applies to implicite string to number casts. (Bug #5912)
ALTER TABLE now fails in STRICT mode if it generates warnings.
Inserting a zero date in a DATE, DATETIME or TIMESTAMP column during TRADITIONAL mode now produces an error. (Bug #5933)
2005-04-01 15:04:50 +03:00
hf@deer.(none)
b94a482ee9 Precision Math implementation 2005-02-09 02:50:45 +04:00
ram@gw.mysql.r18.ru
92545cb3a9 ER_WARN_DATA_TRUNCATED replaced with WARN_DATA_TRUNCATED. 2005-01-19 16:24:06 +04:00
jimw@mysql.com
1edf7279ef Merge from 4.1. 2005-01-18 13:59:55 -08:00
jimw@mysql.com
2fac8bd044 Merge changed tests 2005-01-18 12:25:56 -08:00
jimw@mysql.com
a35c324358 Fix over-optimization that could result in an unsigned double field being
set to a negative value. (Bug #7700)
2005-01-17 16:13:56 -08:00
monty@mysql.com
d35140a851 First stage of table definition cache
Split TABLE to TABLE and TABLE_SHARE (TABLE_SHARE is still allocated as part of table, will be fixed soon)
Created Field::make_field() and made Field_num::make_field() to call this
Added 'TABLE_SHARE->db' that points to database name; Changed all usage of table_cache_key as database name to use this instead
Changed field->table_name to point to pointer to alias. This allows us to change alias for a table by just updating one pointer.
Renamed TABLE_SHARE->real_name to table_name
Renamed TABLE->table_name to alias
Renamed TABLE_LIST->real_name to table_name
2005-01-06 13:00:13 +02:00
monty@mysql.com
f37fd31ddc Merge with global tree 2004-12-18 06:05:16 +02:00
monty@mysql.com
3fb088a075 Add 0x before pointers (to help with debugging)
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)
2004-12-18 05:19:21 +02:00
ram@gw.mysql.r18.ru
92f89369ae bit type 2004-12-17 18:06:05 +04:00
monty@mysql.com
563500994a Update results for new varchar handling
Fixed compiler warnings
String results in CREATE ... SELECT are now created as CHAR(0), VARCHAR(X) or TEXT() depending on item->max_length
2004-12-07 15:47:00 +02: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
bell@sanja.is.com.ua
7210195f1e now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
2004-11-13 19:35:51 +02:00
monty@mysql.com
6c44563fc5 Simple optimization 2004-11-09 03:20:58 +02:00
bar@mysql.com
ed807c29c9 alter_table.result, alter_table.test, field_conv.cc:
Bug #6479  ALTER TABLE ... changing charset fails for TEXT columns
  Fix: use do_conv_blob rather than do_copy_blob
  if the column's character sets are different.
2004-11-08 14:23:14 +04:00
dlenev@brandersnatch.localdomain
1f54900630 Fix for bug #5915 "ALTER TABLE behaves differently when converting column
to auto_increment in 4.1".
Now we are enforcing NO_AUTO_VALUE_ON_ZERO mode during ALTER TABLE only
if we are converting one auto_increment column to another auto_increment
column (this also includes most common case when we don't do anything
with such column).

Also now when we convert some column to TIMESTAMP NOT NULL column with
ALTER TABLE we convert NULL values to current timestamp, (as we do this
in INSERT). One can still get old behavior by setting system TIMESTAMP
variable to 0.
2004-10-07 13:02:39 +04:00
dlenev@brandersnatch.localdomain
2511990c97 Support for TIMESTAMP columns holding NULL values. Unlike all other
column types TIMESTAMP is NOT NULL by default, so in order to have 
TIMESTAMP column holding NULL valaues you have to specify NULL as
one of its attributes (this needed for backward compatibility).

Main changes:
Replaced TABLE::timestamp_default_now/on_update_now members with
TABLE::timestamp_auto_set_type flag which is used everywhere
for determining if we should auto-set value of TIMESTAMP field 
during this operation or not. We are also use Field_timestamp::set_time()
instead of handler::update_timestamp() in handlers.
2004-10-01 18:54:06 +04:00
bar@mysql.com
7f92905954 Bug#5081: UCS2 fields are filled with '0x2020' after extending field length 2004-08-19 11:59:33 +05:00
dlenev@brandersnatch.localdomain
09ba29e539 WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
  
WL#1266 "CONVERT_TZ() - basic time with time zone conversion 
function".
  
Fixed problems described in Bug #2336 (Different number of warnings 
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated 
at Field object level not in conversion functions).
  
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
2004-06-18 10:11:31 +04:00
serg@serg.mylan
e8eda8129f ::reset(), HA_FAST_KEY_READ, disable_indexes(), enable_indexes(), start_bulk_insert(), end_bulk_insert()
Field::val_str simplification, comment
2004-04-06 21:35:26 +02:00
monty@mysql.com
4bc6b551f8 false/true -> FALSE/TRUE
Fixes after last merge
2004-03-30 02:32:41 +03:00
hf@deer.(none)
cdc27d597e Fix for #233 (final part) 2004-03-16 14:59:22 +04:00
hf@deer.(none)
ceaac59c42 Fix for #233 (the second one) 2004-03-16 13:26:37 +04:00
serg@serg.mylan
f8ed7ebbe1 insert table select * from table2 now converts charsets correctly 2003-12-13 18:49:10 +01:00
monty@mashka.mysql.fi
c60a75e9ba Add warnings for single line inserts. To do this I had to convert count_cuted_fields to an enum (to be able to detect setting a NOT NULL field to NULL) 2003-10-11 23:26:39 +03:00
monty@mashka.mysql.fi
2263e3e51f Merge with 4.0.14 2003-08-11 22:44:43 +03:00
vva@eagle.mysql.r18.ru
406b8ba21e changed for AUTO_VALUE_ON_ZERO 2003-07-28 10:57:46 -04:00
vva@eagle.mysql.r18.ru
99aa453f37 Merge eagle.mysql.r18.ru:/home/vva/work/mysql.orig/clear/mysql-4.1
into eagle.mysql.r18.ru:/home/vva/work/BUG_663/mysql-4.1
2003-07-22 19:02:36 -04:00
vva@eagle.mysql.r18.ru
f32299279d fixed bug 663 and WL 1052 (sql_mode is safe for mysqldump) 2003-07-22 18:58:30 -04:00
bar@bar.mysql.r18.ru
c994482fad field_conv.cc:
Data was not converted when ALTER TABLE CHAGE changed a field character set.
2003-07-11 16:11:17 +05:00
monty@mashka.mysql.fi
9fb7e863ad Optimized old patches
Don't set field to DEFAULT value when set to NULL
2003-07-01 14:38:38 +03:00
hf@deer.(none)
3007290f83 Another bugfix for #615
Looks a bit nicer than previous one
2003-06-24 10:53:21 +05:00
hf@deer.(none)
eb901ea461 Proposed fix for #615
So now for the CREATE TABLE foo (id integer NOT NULL default 9)
INSERT INTO foo VALUES (NULL); we get an error
INSERT INTO foo VALUES (1), (NULL), (2); we get one warning
          and second record is set to 9

Is that what we want?
2003-06-20 18:52:40 +05:00