Commit graph

416 commits

Author SHA1 Message Date
jimw@mysql.com
c2eb3bf9f6 Correctly truncate integers inserted into field and double columns
with a number of decimals specified. (Bug #7361)
2005-01-07 17:44:18 +01: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
d71c030587 After merge fixes 2004-12-31 00:44:00 +02:00
monty@mishka.local
4f4bbfc279 Merge with 4.1 2004-12-22 13:54:39 +02:00
monty@mysql.com
6477b4dfd2 Merge with global tree
Fixed some found bugs in BIT fields
Added more test cases for BIT fields and varchar
2004-12-19 20:25:19 +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
konstantin@mysql.com
7216594f4f Data truncation reporting implementation (libmysql) + post review
fixes. Still to do: 
-  deploy my_strtoll10 in limbysql.c
- add mysql_options option to switch MYSQL_DATA_TRUNCATED on and off.
2004-12-16 03:15:06 +03:00
bar@mysql.com
f90caa5826 - VARCHAR(n) with binary character set is now displayed as VARBINARY(N).
- CREATE TABLE t1 SELECT BINARY 'literal'
  now creates a VARBINARY() column, not a BINARY().
2004-12-08 14:03:29 +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
gluh@gluh.mysql.r18.ru
f2fa6fd343 merge 2004-12-07 13:56:48 +03:00
monty@mysql.com
77207d19f2 Merge with new VARCHAR code 2004-12-06 19:18:35 +02:00
bar@mysql.com
248a968581 UCS2 support in ENUM and SET, which also fixes:
Bug #5174 SHOW CREATE TABLE hangs up if the table contains half-with katakana enum values
UCS2 values are stored in HEX encoding in FRM file
2004-12-06 20:45:32 +04:00
bar@mysql.com
8878c58fe2 Fixed thar proper charset was not set in Field_set::val_str() 2004-12-06 16:22:51 +04:00
monty@mysql.com
0de4777187 Merge with 4.1 2004-12-06 11:38:56 +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
985400e0f5 merge (new code fixed the ALTER TABLE problem) 2004-12-02 15:14:01 +02:00
monty@mysql.com
55cc515c8f merged on pull 2004-12-02 14:47:14 +02:00
monty@mysql.com
d1a666d59a Cleanups during review stage
Added auto-correct of field length for enum/set tables for ALTER TABLE
This is becasue of a bug in previous MySQL 4.1 versions where the length for enum/set was set incorrectly after ALTER TABLE
2004-12-02 14:43:51 +02:00
brian@avenger.(none)
b85f4677d5 Merge for Matt for Innodb bug. 2004-11-30 10:10:40 -08:00
ram@gw.mysql.r18.ru
c15b45df50 Portability fix. Why not to use UINT_MAX32 here? 2004-11-30 15:10:48 +04:00
serg@serg.mylan
ceb0d1cf87 compatibility fixes 2004-11-29 22:47:50 +01:00
ram@gw.mysql.r18.ru
bc231c3d27 A fix. Why didn't we use UINT_MAX32? 2004-11-24 22:18:28 +04:00
serg@serg.mylan
2d3dd65cc1 merged 2004-11-20 18:36:41 +01:00
dlenev@mysql.com
cb7e272e46 Manual merge of fix for bug #6266 "Invalid DATETIME value is not handled
properly" with main tree.
2004-11-19 18:35:36 +03:00
konstantin@mysql.com
ed2674d0a7 Fix warnings and compilation failures (Windows). 2004-11-17 13:45:05 +03:00
dlenev@brandersnatch.localdomain
b02f5aa692 Fix for bug #6266 "Invalid DATETIME value is not handled properly".
In server we assume that datetime values stored in MYSQL_TIME struct
are normalized (and year is not greater than 9999), so we should 
perform range checks in all places then we convert something to
MYSQL_TIME.
2004-11-15 15:44:29 +03:00
monty@mysql.com
addd1a0da8 Merge with 4.1 2004-11-12 19:58:24 +02:00
monty@mysql.com
c724163e14 Fix to allow usage of 4.0 tables with 4.1 2004-11-12 19:01:49 +02:00
brian@avenger.(none)
f05daf02ba Resolved merge from 4.1 -> 5.0 (mainly Guilhem's work with mysqldump) 2004-11-11 18:58:57 -08:00
monty@mysql.com
c7e85ef9b9 More debugging
Print position in normal log for Binlog dump
2004-11-10 18:07:39 +02:00
gluh@gluh.mysql.r18.ru
a98c29921c Fix for bug #6077: Problem with make test from 4.1.7 and bk
portability fix(UnixWare)
2004-11-10 18:16:58 +03:00
monty@mysql.com
6c44563fc5 Simple optimization 2004-11-09 03:20:58 +02:00
bar@mysql.com
b7776f83e7 ctype_ujis.result, ctype_ujis.test, field.cc:
Bug#6345 Unexpected behaviour with partial indices
2004-11-08 13:15:01 +04:00
monty@mysql.com
071001950e Merge with 4.1 to get in latest bug fixes 2004-11-04 15:06:24 +02:00
bar@mysql.com
f979603cf2 field.cc, sql_mode.result, sql_mode.test:
"SHOW CREATE TABLE" mysql-4.0 and mysql-3.23 
  compatibiliry mode change:
  Check that a binary collation adds 'binary'
  suffix into a char() column definition in
  mysql40 and mysql2323 modes. This allows
  not to lose the column's case sensitivity
  when loading the dump in pre-4.1 servers.
2004-11-04 08:50:07 +04: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
serg@serg.mylan
51d3d41e8e merged 2004-10-26 21:12:14 +02:00
serg@serg.mylan
8dab51445e Bug #6019 - SELECT tries to use too short prefix index on utf8 data
Field_string::pack should respect max_length as Field_string::pack_key does
2004-10-26 20:31:41 +02:00
monty@mysql.com
7698054d19 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1
2004-10-26 19:30:57 +03:00
monty@mysql.com
6fbc869d18 A lot of fixes for prepared statements (PS):
New mysqltest that can run mysqltest with PS
Added support for ZEROFILL in PS
Fixed crash when one called mysql_stmt_store_result() without a preceding mysql_stmt_bind_result()
Updated test cases to support --ps-protocol
(Some tests are still run using old protocol)
Fixed crash in PS when using SELECT * FROM t1 NATURAL JOIN t2...
Fixed crash in PS when using sub queries
Create table didn't signal when table was created. This could cause a "DROP TABLE created_table" in another thread to wait "forever"
Fixed wrong permissions check in PS and multi-table updates (one could get permission denied for legal quries)
Fix for PS and SELECT ... PROCEDURE
Reset all warnings when executing a new PS query
group_concat(...ORDER BY) didn't work with PS
Fixed problem with test suite when not using innodb
2004-10-26 19:30:01 +03:00
bar@mysql.com
a18cee7a18 Bug 6206: ENUMs are not case sensitive even if declared BINARY
The same problem with SET columns:

find_set() now executes find_type2() to do charset aware search,
instead of always using system_charset_info comparison.
2004-10-26 13:17:37 +05:00
bar@mysql.com
217d83a69f Bug#6202: ENUMs are not case sensitive even if declared BINARY 2004-10-25 17:51:26 +05:00
konstantin@mysql.com
e546d901ac Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/kostja/work/mysql-4.1-6049
2004-10-20 16:45:09 +04: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
konstantin@mysql.com
33fb5ab61b A fix and test case for Bug#6049 "Loss of sign when using prepared
statements and negative time/date values". 
The bug was in wrong sprintf format used in the client library.
The fix moves TIME -> string conversion functions to sql-common and
utilized them in the client library.
2004-10-16 00:12:59 +04:00
bar@mysql.com
2f8f0f2eb2 Bug #6043 erratic searching for diacriticals in indexed MyISAM UTF-8 table 2004-10-14 14:14:50 +05:00
dlenev@mysql.com
96458f8f64 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/dlenev/src/mysql-4.1-bf
2004-10-05 21:24:08 +04:00
dlenev@brandersnatch.localdomain
eabec4c3ca Fixed small bug in handling of pre-4.1 TIMESTAMP columns which was
introduced during implementation of TIMESTAMP columns, which are able 
to store NULLs (Unfortunately it is impossible to write test case for
this. Kudos to Holyfoot for noticing it!)
2004-10-05 21:23:38 +04:00
bar@mysql.com
3fc7640a19 Bug #5832 SELECT doesn't return records in some cases 2004-10-05 21:22:14 +05:00
monty@mishka.local
be4ca46fbe More fixes for strict mode:
More tests.
Better error messages.
Fixed bug when checking if we updated all needed columns for INSERT.
Give an error if we encounter a wrong float value during parsing.
Don't print DEFAULT for columns without a default value in SHOW CREATE/SHOW FIELDS.
Fixed UPDATE IGNORE when using STRICT mode.
2004-10-02 22:20:08 +03:00
dlenev@mysql.com
53209cc4fc Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/dlenev/src/mysql-4.1-ryan
2004-10-01 18:55:17 +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
monty@mishka.local
f2941380c4 Strict mode & better warnings
Under strict mode MySQL will generate an error message if there was any conversion when assigning data to a field.
Added checking of date/datetime fields.
If strict mode, give error if we have not given value to field without a default value (for INSERT)
2004-09-28 20:08:00 +03:00
bar@noter.intranet.mysql.r18.ru
010f4242b7 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1/
into noter.intranet.mysql.r18.ru:/root/mysql-4.1
2004-09-26 21:55:17 +05:00
bar@noter.intranet.mysql.r18.ru
29b8c6b1e0 bug #5723 length(varchar utf8 field) returns verying results 2004-09-26 21:52:20 +05:00
bell@sanja.is.com.ua
10a081a05a postreview fix 2004-09-26 17:26:32 +03:00
bell@sanja.is.com.ua
6df58cc97e Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-4.1
2004-09-25 18:37:28 +03:00
bell@sanja.is.com.ua
f3e6405ff1 postreview fixes (BUG#5618 & BUG#5590) 2004-09-25 15:07:50 +03:00
konstantin@mysql.com
7b97b5b007 Fix alignment. 2004-09-24 13:50:53 +04:00
ram@gw.mysql.r18.ru
c9d97272ed A fix (Bug #5291: float -> string, truncation, sometimes without warning). 2004-09-03 19:38:16 +05:00
monty@mysql.com
ea687ba5da Portability fixes
Fixed bug in end space handle for WHERE text_column="constant"
2004-08-26 18:26:38 +03:00
serg@serg.mylan
8f254c1b7b followup 2004-08-24 18:20:27 +02:00
serg@serg.mylan
50ee43be43 BDB: Bug#4531: unique key prefix interacts poorly with utf8,
Bug#4594 column index make = failed for gbk
2004-08-24 15:32:57 +02:00
serg@serg.mylan
62722e7b05 merged 2004-08-20 00:52:43 +02:00
serg@serg.mylan
b81af1c750 less strict assert to take into account weird cases 2004-08-19 23:10:33 +02:00
serg@serg.mylan
8ef3cdc2f9 take dec. point into account in store_double_in_string 2004-08-19 11:21:08 +02:00
bar@mysql.com
3f75d2bd3e field.cc:
Serg's typo fix :)
2004-08-19 10:28:40 +05:00
serg@serg.mylan
3f2210c064 after merge fixes 2004-08-19 03:02:09 +02:00
serg@serg.mylan
e1237cbc53 manually merged 2004-08-18 19:57:55 +02:00
serg@serg.mylan
8ce92878a2 Bug 4937: different date -> string conversion when using
SELECT ... UNION and INSERT ... SELECT ... UNION
2004-08-18 14:46:31 +02:00
konstantin@mysql.com
ee89880473 A desperate attempt to comment one place where we do conversions. 2004-08-16 15:07:45 -07:00
bar@mysql.com
1c8b328e16 CSC issue # 3299 fix:
ENUM and SET type didn't compute their length correctly.
That showed up for example while converting into a CHAR column.
2004-08-13 19:06:24 +05:00
serg@serg.mylan
6023b58b9f Bug #4797 - 32 bit and 64 bit builds behave differently on int32 overflow 2004-08-11 23:43:41 +02:00
dlenev@brandersnatch.localdomain
d39fe2623f Fix for bug #4492.
TIMESTAMP columns should be unsigned to preserve compatibility with 4.0
(Or else InnoDB will return different internal TIMESTAMP values when user upgrades to 4.1).

Altough this fix will introduce problems with early 4.1 -> 4.1 upgrades (tables with 
TIMESTAMP field should be reloaded using mysqldump) it will allow easy 4.0 -> 4.1 
upgrade (which is more important since 4.1 is still beta).
2004-07-28 10:49:21 +04:00
bar@mysql.com
6cad42e3ce Bug #4555 ALTER TABLE crashes mysqld with enum column collated utf8_unicode_ci 2004-07-23 19:10:06 +05:00
monty@mysql.com
db7efa2780 New handler::index_flags() definition to make it easy to check the full used key and a specific key part.
Added key part to optimize_range() to fix problems when using fields in key parts.
2004-07-08 15:45:25 +03:00
monty@mysql.com
b1d08ba2b4 Merge with 4.0 to get the latest bug patches to 4.1 2004-06-25 20:13:05 +03:00
konstantin@mysql.com
29b88ff539 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/kostja/mysql/mysql-4.1-4030
2004-06-24 19:09:31 +04:00
konstantin@mysql.com
a30fcdc690 Fix for Bug#4030 "Client side conversion string -> date type doesn't
work (prepared statements)" and after-review fixes:
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- functions str_to_time and str_to_TIME moved to sql-common
- send_data_str now supports MYSQL_TYPE_TIME, MYSQL_TIME_DATE,
  MYSQL_TIME_DATETIME types of user input buffers.
- few more comments in the client library
- a test case added.
2004-06-24 19:08:36 +04:00
ingo@mysql.com
fa86cada0c bug#2686 - index_merge select on BerkeleyDB table with varchar PK causes mysqld to crash.
Added put_length() to get_length() and unpack_key() to pack_key().
Keys were packed with the minimum size of the length field for the key part and 
unpacked with length size of the base column. 
For the purpose of optimal key packing we have the method pack_key(), while rows are 
packed with pack(). Now keys are unpacked with unpack_key() and no longer with 
unpack() which is used for rows.
2004-06-24 14:54:28 +02:00
serg@serg.mylan
c03addab79 merged 2004-06-23 12:36:07 +02:00
serg@serg.mylan
3f1c4ba745 handler interface cleanups:
more logical table/index_flags
  return  HA_ERR_WRONG_COMMAND instead of abstract methods where appropriate
  max_keys and other limits renamed to max_supported_keys/etc
  max_keys/etc are now wrappers to max_supported_keys/etc 
  ha_index_init/ha_rnd_init/ha_index_end/ha_rnd_end are now wrappers to real {index,rnd}_{init,end} to enforce strict pairing
2004-06-23 12:29:05 +02:00
monty@mysql.com
030f091319 Field_geom should have same max_length as Field_blob
Updated tests
After merge fix
2004-06-21 11:27:40 +03:00
monty@mysql.com
d69a36d118 merge 2004-06-21 10:24:40 +03:00
monty@mysql.com
1388c164bc After merge fixes
Return NULL if a time argument is given to date_add(). (Warning will be shown after Dimitri's timezone patch is pushed)
2004-06-21 10:21:20 +03: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
monty@mysql.com
b11d258835 Merge with 4.0.21 2004-06-18 04:38:58 +03:00
bell@sanja.is.com.ua
96b470ae59 after review fix (BUG#4067) 2004-06-17 13:48:31 +03:00
serg@serg.mylan
516bcf508c after merge fix 2004-06-11 21:20:53 +02:00
monty@mysql.com
ff223db0fe Merge with 3.23 to get latest bug fixes 2004-06-10 11:59:45 +03:00
gluh@gluh.mysql.r18.ru
5725831c73 Fix for bug #4036 multiple SELECT DATE_FORMAT, incorrect results 2004-06-07 20:35:05 +04:00
konstantin@mysql.com
f207b33a7b Support for character set conversion in binary protocol: another go
after Monty's review.
- Item_param was rewritten.
- it turns out that we can't convert string data to character set of
  connection on the fly, because they first should be written to the binary
  log.
  To support efficient conversion we need to rewrite prepared statements
  binlogging code first.
2004-05-25 02:03:49 +04:00
ram@gw.mysql.r18.ru
0f3ab4174e A fix (Bug #3728: Missing warning in 4.1). 2004-05-18 12:16:00 +05:00
monty@mishka.local
314a8bf114 key_cmp -> key_cmp_if_same
New records_in_range() interface (similar to read_range())
Macros for faster bitmap handling
Simplify read_range() code (#WL1786)
New general key_cmp() function to compare keys
2004-05-16 14:48:32 +03:00
serg@serg.mylan
423f37b92b out-of-bound array access fixed 2004-05-11 12:39:00 +02:00
monty@mysql.com
d21d49a32a Merge with 4.0.19 2004-05-05 17:05:24 +03:00