Commit graph

176 commits

Author SHA1 Message Date
msvensson@neptunus.(none)
485772e308 Bug#22436 Four tests require "innodb" to be configured, fail in "classic" build
- Disable warnings when creating the "innodb" tables if it works anyway.
 - Move test that are really innodb dependent to innodb_mysql
2006-09-28 15:13:40 +02:00
acurtis/antony@xiphis.org/ltantony.xiphis.org
e2d4aa2ca4 Merge xiphis.org:/home/antony/work2/mysql-5.0-engines
into  xiphis.org:/home/antony/work2/mysql-5.0-merge
2006-08-14 21:27:36 -07:00
svoj@may.pils.ru
6c6f435b03 BUG#14770 - LOAD DATA INFILE doesn't respect default values for
columns
Fixed confusing warning.

Quoting INSERT section of the manual:
----
Inserting NULL into a column that has been declared NOT NULL. For
multiple-row INSERT statements or INSERT INTO ... SELECT statements, the
column is set to the implicit default value for the column data type. This
is 0 for numeric types, the empty string ('') for string types, and the
"zero" value for date and time types. INSERT INTO ... SELECT statements are
handled the same way as multiple-row inserts because the server does not
examine the result set from the SELECT to see whether it returns a single
row. (For a single-row INSERT, no warning occurs when NULL is inserted into
a NOT NULL column. Instead, the statement fails with an error.)
----
This is also true for LOAD DATA INFILE. For INSERT user can specify
DEFAULT keyword as a value to set column default. There is no similiar
feature available for LOAD DATA INFILE.
2006-08-02 17:15:50 +05:00
evgen@moonbone.local
8540557457 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/work/autopush/12185-bug-5.0-opt-mysql
2006-07-22 02:15:36 +04:00
evgen@moonbone.local
c875b8eb93 Fixed bug#12185: Data type aggregation may produce wrong result
The Item::tmp_table_field_from_field_type() function creates Field_datetime
object instead of Field_timestamp object for timestamp field thus always
changing data type is a tmp table is used.

The Field_blob object constructor which is used in the 
Item::tmp_table_field_from_field_type() is always setting packlength field of
newly created blob to 4. This leads to changing fields data type for example
from the blob to the longblob if a temporary table is used.

The Item::make_string_field() function always converts Field_string objects 
to Field_varstring objects. This leads to changing data type from the 
char/binary to varchar/varbinary.

Added appropriate Field_timestamp object constructor for using in the 
Item::tmp_table_field_from_field_type() function.

Added Field_blob object constructor which sets pack length according to
max_length argument.

The Item::tmp_table_field_from_field_type() function now creates
Field_timestamp object for a timestamp field.

The Item_type_holder::display_length() now returns correct NULL length NULL
length. 

The Item::make_string_field() function now doesn't change Field_string to
Field_varstring in the case of Item_type_holder. 

The Item::tmp_table_field_from_field_type() function now uses the Field_blob
constructor which sets packlength according to max_length.
2006-07-22 02:08:00 +04:00
igor@olga.mysql.com
f608064083 Fixed bug #19714.
DESCRIBE returned the type BIGINT for a column of a view if the column
was specified by an expression over values of the type INT.
    
E.g. for the view defined as follows:
  CREATE VIEW v1 SELECT COALESCE(f1,f2) FROM t1
DESCRIBE returned type BIGINT for the only column of the view if f1,f2 are
columns of the INT type.
At the same time DESCRIBE returned type INT for the only column of the table
defined by the statement:
  CREATE TABLE t2 SELECT COALESCE(f1,f2) FROM t1.
    
This inconsistency was removed by the patch.

Now the code chooses between INT/BIGINT depending on the
precision of the aggregated column type.
 
Thus both DESCRIBE commands above returns type INT for v1 and t2.
2006-07-13 20:48:26 -07:00
konstantin@mysql.com
117b76a562 A fix and a test case for
Bug#19022 "Memory bug when switching db during trigger execution"
 Bug#17199 "Problem when view calls function from another database."
 Bug#18444 "Fully qualified stored function names don't work correctly in
            SELECT statements"

 Documentation note: this patch introduces a change in behaviour of prepared
 statements.

 This patch adds a few new invariants with regard to how THD::db should
 be used. These invariants should be preserved in future:

  - one should never refer to THD::db by pointer and always make a deep copy
    (strmake, strdup)
  - one should never compare two databases by pointer, but use strncmp or
    my_strncasecmp
  - TABLE_LIST object table->db should be always initialized in the parser or
    by creator of the object.

    For prepared statements it means that if the current database is changed
    after a statement is prepared, the database that was current at prepare
    remains active. This also means that you can not prepare a statement that
    implicitly refers to the current database if the latter is not set.
    This is not documented, and therefore needs documentation. This is NOT a
    change in behavior for almost all SQL statements except:
     - ALTER TABLE t1 RENAME t2 
     - OPTIMIZE TABLE t1
     - ANALYZE TABLE t1
     - TRUNCATE TABLE t1 --
     until this patch t1 or t2 could be evaluated at the first execution of
     prepared statement. 

     CURRENT_DATABASE() still works OK and is evaluated at every execution
     of prepared statement.

     Note, that in stored routines this is not an issue as the default
     database is the database of the stored procedure and "use" statement
     is prohibited in stored routines.

  This patch makes obsolete the use of check_db_used (it was never used in the
  old code too) and all other places that check for table->db and assign it
  from THD::db if it's NULL, except the parser.

 How this patch was created: THD::{db,db_length} were replaced with a
 LEX_STRING, THD::db. All the places that refer to THD::{db,db_length} were
 manually checked and:
  - if the place uses thd->db by pointer, it was fixed to make a deep copy
  - if a place compared two db pointers, it was fixed to compare them by value
    (via strcmp/my_strcasecmp, whatever was approproate)
 Then this intermediate patch was used to write a smaller patch that does the
 same thing but without a rename.

 TODO in 5.1:
   - remove check_db_used
   - deploy THD::set_db in mysql_change_db

 See also comments to individual files.
2006-06-27 00:47:52 +04:00
gluh@eagle.intranet.mysql.r18.ru
70a8f32d81 post-merge fix 2006-03-30 09:13:25 +05:00
gluh@mysql.com
ea56026e4f Merge 2006-03-30 08:13:28 +05:00
gluh@eagle.intranet.mysql.r18.ru
2545c7d414 Fix for bug#15316 SET value having comma not correctly handled
disallow the use of comma in SET members
2006-03-29 19:52:26 +05:00
evgen@moonbone.local
e6924206cd Fixed bug#17530: Incorrect key truncation on table creation caused server crash.
When a too long field is used for a key, only a prefix part of the field is 
used. Length is reduced to the max key length allowed for storage. But if the
field have a multibyte charset it is possible to break multibyte char
sequence. This leads to the failed assertion in the innodb code and 
server crash when a record is inserted.

The make_prepare_table() now aligns truncated key length to the boundary of
multibyte char.
2006-02-21 18:09:32 +03:00
jani@a193-229-222-105.elisa-laajakaista.fi
b948c2941d Merge a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-4.1
into  a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.0
2006-01-16 21:31:22 +02:00
andrey@lmy004.
7b2238d484 Merge 2006-01-16 16:21:41 +01:00
monty@mysql.com
b0a5ea01ef Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2006-01-06 01:08:48 +02:00
monty@mysql.com
6e22e29de6 Review fixes of new pushed code
- Fixed tests
- Optimized new code
- Fixed some unlikely core dumps
- Better bug fixes for:
  - #14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  - #14850 (ERROR 1062 when a quering a view using a Group By on a column that can be null
2006-01-06 00:47:49 +02:00
ingo@mysql.com
b0e84cb999 BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 5.0.
Extended the unique table check by a check of lock data.
Merge sub-tables cannot be detected by doing name checks only.
2005-12-20 16:35:05 +01:00
ingo@mysql.com
5aa315e23a BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 4.1.
INSERT ... SELECT with the same table on both sides (hidden
below a MERGE table) does now work by buffering the select result.
The duplicate detection works now after open_and_lock_tables() 
on the locks.
I did not find a test case that failed without the change in
sql_update.cc. I made the change anyway as it should in theory
fix a possible MERGE table problem with multi-table update.
2005-12-07 19:52:26 +01:00
jimw@mysql.com
99297e44d4 Merge mysql.com:/home/jimw/my/mysql-4.1-14155
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-11-28 10:50:23 -08:00
jimw@mysql.com
81cb8ad37d Fix handling of maximum value for MAX_ROWS on 64-bit platforms. (Bug #14155) 2005-11-23 17:05:59 -08:00
sergefp@mysql.com
c914a03066 BUG#14480 post-fix: merge to 5.0 2005-11-09 14:47:58 +03:00
sergefp@mysql.com
c6a902f20c Merge mysql.com:/home/psergey/mysql-4.1-nov08-push
into mysql.com:/home/psergey/mysql-5.0-oct08-push
2005-11-09 10:12:58 +03:00
sergefp@mysql.com
f12212f74e BUG#14480: post-fix: use the default field value from CREATE list too. 2005-11-09 09:34:46 +03:00
sergefp@mysql.com
c5276ebcb0 Merge, will need post-merge fixes. 2005-11-08 11:22:51 +03:00
sergefp@mysql.com
edd094b194 BUG#14480, attempt2: In CREATE ... SELECT ..., don't count the same field twice
when calculating table->null_fields.
2005-11-07 09:23:43 +03:00
sergefp@mysql.com
4ad3313cd7 BUG#14139 - Merge to 5.0 2005-10-31 09:22:33 +03:00
sergefp@mysql.com
09a4d0c7a7 4.1->5.0 merge 2005-10-29 02:36:57 +04:00
sergefp@mysql.com
2219ada7f6 BUG#14139: When handling "CREATE TABLE(field_X type_spec,...) SELECT smth AS field_X, ...."
avoid multiplying length of field_X by charset->mbmaxlen twice when calculating space 
required for field_X in the new table.
2005-10-26 00:56:17 +04:00
andrey@lmy004.
72549b13c2 Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-4.1
into lmy004.:/work/mysql-4.1-bug12913
2005-09-20 06:55:23 +03:00
jani@a193-229-222-105.elisa-laajakaista.fi
e760a58f07 Merged from 4.1 to 5.0. 2005-09-13 01:44:50 +03:00
jani@a193-229-222-105.elisa-laajakaista.fi
01ce8a8aa9 Merge a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-4.1
into  a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.0
2005-09-12 20:18:49 +03:00
gluh@eagle.intranet.mysql.r18.ru
d9bd3c11e4 Fix for bug #6008: MySQL does not create warnings when creating database and using IF NOT EXISTS
produce warning for 'create database if not exists' if database exists
  do not update database options in this case  
  produce warning for 'create table if not exists' if table exists
2005-09-12 17:09:19 +05:00
andrey@lmy004.
f75ac7fb82 fix for bug#12913
(Simple SQL can crash server or connection)
(not initialized member leads to server crash)
2005-09-01 00:13:02 +02:00
evgen@moonbone.local
41fc00641c create.test, create.result, sql_select.cc, item.cc:
After merge fix for bug #12537
2005-08-31 22:06:34 +04:00
evgen@moonbone.local
f917803e0c Manual merged 2005-08-31 21:24:25 +04:00
evgen@moonbone.local
d76f9471cb Fix bug #12537 UNION produces longtext instead of varchar
Item::tmp_table_field_from_field_type() and create_tmp_field_from_item()
was converting string field to blob depending on byte-wise length instead of
character length, which results in converting valid varchar string with
length == 86 to longtext.

Made that functions above take into account max width of character when
converting string fields to blobs.
2005-08-30 16:19:53 +04:00
jimw@mysql.com
2da798c991 Update test results 2005-08-04 14:38:48 -07:00
georg@lmy002.wdf.sap.corp
7251e9dbd8 Fix for bug #6859 (after Sanja's review)
Added check which throws ER_WRONG_OBJECT error in case the .frm
doesn't contain a valid table type (e.g. view or trigger)
2005-08-03 07:29:48 +02:00
jimw@mysql.com
49e5636410 Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-07-22 12:35:15 -07:00
jimw@mysql.com
6eae678f56 Fix error message generated when trying to create a table in a
non-existent database. (Bug #10407)
2005-07-21 20:08:54 -07:00
acurtis@xiphis.org
3b8c3bd7e1 Merge 2005-06-09 17:15:06 +01:00
acurtis@xiphis.org
304bb0c66d Bug#11028 Crash on create table like
Report error instead of crashing
2005-06-09 16:06:15 +01:00
hf@deer.(none)
6c148a7969 Fix for bug #9764 (DISTINCT IFNULL truncates data) 2005-06-08 20:35:37 +05:00
monty@mysql.com
775f17667b Merge with 4.1 2005-06-07 00:31:53 +03:00
serg@serg.mylan
dc0df7ee5a after mergemerge 2005-06-04 07:15:11 +02:00
serg@serg.mylan
aaa4c11d11 mergemerged 2005-06-03 21:24:13 +02:00
serg@serg.mylan
5b810bc607 after merge fixes 2005-06-03 21:08:45 +02:00
ingo@mysql.com
0a1e38b7ed Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
Manual merge from 4.1.
2005-06-01 11:15:21 +02:00
ingo@mysql.com
effd338f67 Merge 2005-05-31 20:55:42 +02:00
ingo@mysql.com
40b53eab23 Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
After merge fix.
2005-05-31 20:45:41 +02:00
ingo@mysql.com
c420599581 Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
Hand merged from 4.0.
2005-05-31 19:37:24 +02:00