Commit graph

915 commits

Author SHA1 Message Date
bar@mysql.com/bar.intranet.mysql.r18.ru
aa1c8a5826 Bug#21505 Create view - illegal mix of collation for operation 'UNION'
The problem was that any VIEW columns had always implicit derivation.
  Fix: derivation is now copied from the original expression
  given in VIEW definition.
  For example:
  - a VIEW column which comes from a string constant
    in CREATE VIEW definition have now coercible derivation.
  - a VIEW column having COLLATE clause
    in CREATE VIEW definition have now explicit derivation.
2006-11-09 14:41:34 +04:00
holyfoot/hf@mysql.com/deer.(none)
620aee1ac8 merging 2006-11-08 20:41:47 +04:00
holyfoot/hf@deer.(none)
938ba3e11e Merge mysql.com:/home/hf/work/mysql-5.0.clean
into  mysql.com:/home/hf/work/mysql-5.1.clean
2006-11-08 19:09:39 +04:00
lars/lthalmann@dl145h.mysql.com
3776e9622b Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge
2006-11-07 19:26:31 +01:00
holyfoot/hf@mysql.com/deer.(none)
9c9bf04650 bug fixed 2006-11-07 21:02:41 +04:00
lars/lthalmann@mysql.com/dl145h.mysql.com
aea1e14ef8 Merge mysql.com:/users/lthalmann/bkroot/mysql-5.0-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge
2006-11-07 12:02:53 +01:00
holyfoot/hf@mysql.com/deer.(none)
7ddb8b68fa bug #19491 (5.0-related additional fixes) 2006-11-06 22:33:18 +04: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
holyfoot/hf@mysql.com/deer.(none)
5f42ec19b7 Merge mysql.com:/home/hf/work/19491/my50-19491
into  mysql.com:/home/hf/work/mysql-5.0.19491
2006-11-01 15:41:51 +04:00
bar@mysql.com/bar.intranet.mysql.r18.ru
28eaf5ff75 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql.com:/usr/home/bar/mysql-5.0.b18908
2006-10-30 10:16:18 +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
holyfoot/hf@mysql.com/deer.(none)
4fb00857ca bug #19491 (CAST do DATETIME wrong result) 2006-10-25 20:14:39 +05:00
kaa@polly.local
a82e5d4a55 Merge polly.local:/tmp/maint/bug11655/my51-bug11655
into  polly.local:/home/kaa/src/maint/m51-new-maint--07OGx
2006-10-12 12:36:13 +04:00
kaa@polly.local
2667443173 Merge polly.local:/tmp/maint/bug11655/my50-bug11655
into  polly.local:/home/kaa/src/maint/mysql-5.0-maint
2006-10-12 11:28:44 +04:00
kaa@polly.local
a050de9837 Merge polly.local:/tmp/maint/bug11655/my41-bug11655
into  polly.local:/home/kaa/src/maint/m41-maint--07OGk
2006-10-11 14:55:23 +04:00
kaa@polly.local
29b5e2955e Merge polly.local:/tmp/maint/bug11655/my50-bug11655
into  polly.local:/tmp/maint/bug11655/my51-bug11655
2006-10-11 14:22:17 +04:00
kaa@polly.local
02ac635027 Merge polly.local:/tmp/maint/bug11655/my41-bug11655
into  polly.local:/tmp/maint/bug11655/my50-bug11655
2006-10-11 14:16:30 +04:00
kaa@polly.local
609a3cd295 Fixes a number of problems with time/datetime <-> string conversion functions:
- bug #11655 "Wrong time is returning from nested selects - maximum time exists
- input and output TIME values were not validated properly in several conversion functions
- bug #20927 "sec_to_time treats big unsigned as signed"
- integer overflows were not checked in several functions. As a result, input values like 2^32 or 3600*2^32 were treated as 0
- BIGINT UNSIGNED values were treated as SIGNED in several functions
- in cases where both input string truncation and out-of-range TIME value occur, only 'truncated incorrect time value' warning was produced
2006-10-04 17:13:32 +04:00
msvensson@neptunus.(none)
237779218c Merge bk-internal:/home/bk/mysql-5.1-new-rpl
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
2006-10-03 15:56:56 +02:00
msvensson@neptunus.(none)
3f8edc3706 Merge bk-internal:/home/bk/mysql-5.0-rpl
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-10-03 14:24:43 +02:00
bar@mysql.com/bar.intranet.mysql.r18.ru
0cfb76b802 sql_yacc.yy:
After merge fix.
field.cc:
  After merge fix
2006-10-03 17:05:33 +05:00
bar@bar.intranet.mysql.r18.ru
3cfbe36adc After merge fix 2006-10-03 16:00:09 +05:00
ramil/ram@mysql.com/myoffice.izhnet.ru
f2a3f1a679 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/usr/home/ram/work/bug22271/my50-bug22271
2006-10-03 09:00:03 +05:00
ramil/ram@myoffice.izhnet.ru
b1463a4b42 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  mysql.com:/usr/home/ram/work/bug22271/my51-bug22271
2006-10-03 08:56:19 +05:00
ramil/ram@myoffice.izhnet.ru
9241230b69 Merge mysql.com:/usr/home/ram/work/bug22271/my50-bug22271
into  mysql.com:/usr/home/ram/work/bug22271/my51-bug22271
2006-10-03 08:51:59 +05:00
cmiller@zippy.cornsilk.net
2a7d7dd939 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug20778/my50-bug20778
into  zippy.cornsilk.net:/home/cmiller/work/mysql/bug20778/my51-bug20778
2006-09-29 11:14:28 -04:00
bar@mysql.com/bar.intranet.mysql.r18.ru
07f9efd1e1 Merge mysql.com:/usr/home/bar/mysql-5.0.b6147v2
into  mysql.com:/usr/home/bar/mysql-5.0.b6147rpl
2006-09-29 16:40:18 +05:00
bar@mysql.com/bar.intranet.mysql.r18.ru
53dea28352 Bug#21620 ALTER TABLE affects other columns
Problem: for character sets having mbmaxlen==2,
  any ALTER TABLE changed TEXT column type to MEDIUMTEXT,
  due to wrong "internal length to create length" formula.
  Fix: removing rounding code introduced in early 4.1 time,
  which is not correct anymore.
2006-09-29 16:24:11 +05:00
ramil/ram@mysql.com/myoffice.izhnet.ru
326a56dc3f Fix for bug #22271: data casting may affect data stored in the next column(s?)
Using wrong filling value may cause unneeded extra bit rewriting.

Fix: use proper value to fill uneven bits.
2006-09-28 17:00:29 +05:00
cmiller@zippy.cornsilk.net
78aea70393 Bug #20778: strange characters in warning message 1366 when called in SP
The function receives an exactly-sized buffer (not a C NUL-terminated string)
and passes it into a printf function to be interpreted with "%s".

Instead, create an intermediate String object, and copy the data into it, 
and pass in a pointer to the String's NUL-terminated buffer.
2006-09-27 19:26:25 -04:00
mats@romeo.(none)
0d019e0380 Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
into  romeo.(none):/home/bk/w3259-mysql-5.1-new-rpl
2006-09-19 13:47:15 +02:00
mats@romeo.(none)
ca50d070a0 WL#3259 (RBR with more columns on slave than master):
Incorporating changes from review.
Fixing one bug that surfaced.
2006-09-13 19:25:12 +02:00
lars/lthalmann@dl145j.mysql.com
1dfc84986e Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge
2006-09-11 13:34:44 +02:00
kostja@bodhi.local
7290fa2fb7 Post-merge fixes. 2006-08-30 23:09:47 +04:00
kostja@bodhi.local
ebb7070430 Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
2006-08-30 03:00:19 +04:00
kostja@bodhi.local
f8d34e1030 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-14897
2006-08-30 00:45:33 +04:00
kostja@bodhi.local
3bf609b7f2 A fix for Bug#14897 "ResultSet.getString("table.column") sometimes
doesn't find the column"

When a user was using 4.1 tables with VARCHAR column and 5.0 server
and a query that used a temporary table to resolve itself, the
table metadata for the varchar column sent to client was incorrect:
MYSQL_FIELD::table member was empty.

The bug was caused by implicit "upgrade" from old VARCHAR to new
VARCHAR hard-coded in Field::new_field, which did not preserve
the information about the original table. Thus, the field metadata
of the "upgraded" field pointed to an auxiliary temporary table
created for query execution.

The fix is to copy the pointer to the original table to the new field.
2006-08-30 00:38:58 +04:00
brian@zim.(none)
d41188130a This is a cleanup of warnings that windows is complaining about. 2006-08-23 15:12:42 -07:00
mats@romeo.(none)
dbc98766b0 WL#3259 (RBR with more columns on slave than on master):
Post-merge fixes.
2006-08-22 10:36:11 +02:00
mats@romeo.(none)
c2d7f7c392 Merge romeo.(none):/home/bkroot/mysql-5.1-wl3228
into  romeo.(none):/home/bk/w3259-mysql-5.1-new-rpl
2006-08-21 10:54:41 +02:00
brian@zim.(none)
183f028633 Cheery picked Antony's patch to allow for Window's builds in 5.1 2006-08-15 21:49:26 -07:00
acurtis/antony@xiphis.org/ltantony.xiphis.org
4c57a94b78 fix windows build 2006-08-15 01:54:14 -07:00
brian@zim.(none)
8deb5beb9c Merge zim.(none):/home/brian/mysql/dep-5.0
into  zim.(none):/home/brian/mysql/dep-5.1
2006-08-14 15:24:29 -07:00
brian@zim.(none)
7429c871b9 Fix for bug#20648 We introduce a new field method for knowing "real size", and we now in archive null unused bits of a row to null before writing. 2006-08-14 03:29:17 -07:00
kostja@bodhi.local
04c97488f9 Merge bodhi.local:/opt/local/work/tmp_merge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
2006-08-12 21:06:51 +04:00
kroki/tomash@moonlight.intranet
5c272816ca Merge moonlight.intranet:/home/tomash/src/mysql_ab/tmp_merge
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-merge
2006-08-09 13:37:20 +04:00
patg@govinda.patg.net
8d1e5a5bb1 Merge govinda.patg.net:/home/patg/mysql-build/mysql-5.0-holyfoot
into  govinda.patg.net:/home/patg/mysql-build/mysql-5.1-5.0-merge2

Push by holyfoot@production.mysql.com on Tue Jul 25 13:41:40 2006:

bk clone -l -r'holyfoot/hf@mysql.com/deer.(none)|ChangeSet|20060725085017|41021' mysql-5.0 tmp_merge
2006-08-08 09:01:32 -07:00
msvensson@neptunus.(none)
7280f63100 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-08-03 09:32:58 +02:00
evgen@moonbone.local
67c85a170a Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  moonbone.local:/work/tmp_merge-5.0-opt-mysql
2006-08-02 16:44:56 +04:00
msvensson@neptunus.(none)
31be565d2e Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-08-01 20:24:30 +02:00
evgen@sunlight.local
799ecc9f2a After merge fix 2006-08-01 08:49:43 +04:00
evgen@sunlight.local
ef4f149536 Merge sunlight.local:/local_work/tmp_merge-5.0-opt-mysql
into  sunlight.local:/local_work/tmp_merge-5.1-opt-mysql
2006-07-30 00:33:24 +04:00
tsmith/tim@siva.hindu.god
80465ab6af Merge siva.hindu.god:/usr/home/tim/m/bk/global-41
into  siva.hindu.god:/usr/home/tim/m/bk/global-50
2006-07-26 13:30:03 -06:00
joerg@trift2.
b7cf8cefe9 Merge trift2.:/M41/clone-4.1
into  trift2.:/M41/push-4.1
2006-07-24 19:18:30 +02:00
ramil/ram@mysql.com/myoffice.izhnet.ru
694d4999ef Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b16327
2006-07-23 14:17:01 +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
bar@mysql.com/bar.intranet.mysql.r18.ru
29bc5cc179 Bug#6147: Traditional: Assigning a string to a numeric column has unexpected results
The problem was that when converting a string to an exact number,
rounding didn't work, because conversion didn't understand
approximate numbers notation.
Fix: a new function for string-to-number conversion was implemented,
which is aware of approxinate number notation (with decimal point
and exponent, e.g. -19.55e-1)
2006-07-20 13:41:12 +05:00
msvensson@neptunus.(none)
9a7d888aa3 Bug #21135 Crash in test "func_time"
- backport patch from 5.0
 - "table" can be NULL in temporary fields used for type conversion
2006-07-19 15:55:04 +02:00
jimw@rama.(none)
d18eacc71d Bug #19498: Inconsistent support for DEFAULT in TEXT columns
When a default of '' was specified for TEXT/BLOB columns, the specification
  was silently ignored. This is presumably to be nice to applications (or
  people) who generate their column definitions in a not-very-clever fashion.

  For clarity, doing this now results in a warning, or an error in strict
  mode.
2006-07-18 16:04:18 -07:00
jimw@rama.(none)
c2d8b605f2 Bug #17608: String literals lost during INSERT query on FEDERATED table
The Federated storage engine used Field methods that had arbitrary limits on
  the amount of data they could process, which caused problems with data
  over that limit (4K). By removing those Field methods and just using
  features of the String class, we can avoid this problem.
2006-07-12 16:33:29 -07:00
cmiller@zippy.(none)
9be1c70404 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-10 13:38:22 -04:00
ingo@chilla.local
591d461d95 Merge chilla.local:/home/mydev/mysql-5.0
into  chilla.local:/home/mydev/mysql-5.0-bug16218
2006-07-06 19:36:07 +02:00
ingo@chilla.local
3671658cbe Merge chilla.local:/home/mydev/mysql-5.0-bug16218
into  chilla.local:/home/mydev/mysql-5.1-ateam
2006-07-06 16:09:50 +02: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
ramil@mysql.com
283d51b6ba Fix for bug #18014: data loss caused by altering decimal fields. 2006-06-27 13:02:02 +05:00
ingo@mysql.com
8728fbbc6c Bug#16218 - Crash on insert delayed
Bug#17294 - INSERT DELAYED puting an \n before data
Bug#16611 - INSERT DELAYED corrupts data
Bug#13707 - Server crash with INSERT DELAYED on MyISAM table
Combined as Bug#16218.

INSERT DELAYED crashed in 5.0 on a table with a varchar that 
could be NULL and was created pre-5.0 (Bugs 16218 and 13707).
INSERT DELAYED corrupted data in 5.0 on a table with varchar 
fields that was created pre-5.0 (Bugs 17294 and 16611).

In case of INSERT DELAYED the open table is copied from the
delayed insert thread to be able to create a record for the 
queue. When copying the fields, a method was used that did 
convert old varchar to new varchar fields and did not set up 
some pointers into the record buffer of the table.

The field conversion was guilty for the misinterpretation of 
the record contents by the delayed insert thread. The wrong
pointer setup was guilty for the crashes.

For Bug 13707 (Server crash with INSERT DELAYED on MyISAM table)
I fixed the above mentioned method to set up one of the pointers.
For Bug 16218 I set up the other pointers too.

But when looking at the corruptions I got aware that converting
the field type was totally wrong for INSERT DELAYED. The copied
table is used to create a record that is to be sent to the
delayed insert thread. Of course it can interpret the record
correctly only if all field types are the same in both table
objects.

So I revoked the fix for Bug 13707 and changed the new_field() 
method so that it can suppress conversions.

No test case as this is a migration problem. One needs to
create a table with 4.x and use it with 5.x. I added two
test scripts to the bug report.
2006-06-26 20:57:18 +02:00
rburnett@bk-internal.mysql.com
93210b0a28 Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-kt
2006-06-26 16:53:53 +02:00
elliot@mysql.com
bc2b96fee3 Merge mysql.com:/home/emurphy/src/bk-clean/tmp_merge
into  mysql.com:/home/emurphy/src/bk-clean/mysql-5.1
2006-06-25 09:59:34 -04:00
rburnett@bk-internal.mysql.com
d9d2bf5b94 Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-kt
2006-06-23 15:29:33 +02:00
bar@bar.intranet.mysql.r18.ru
5694d5a63c Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-kt
into  mysql.com:/usr/home/bar/mysql-5.1.b20086
2006-06-22 18:51:50 +05:00
evgen@moonbone.local
8d4a910a1f Fixed bug #14896.
This bug in Field_string::cmp resulted in a wrong comparison 
with keys in partial indexes over multi-byte character fields.
Given field a is declared as a varchar(16) collate utf8_unicode_ci
INDEX(a(4)) gives us an example of such an index.
  
Wrong key comparisons could lead to wrong result sets if 
the selected query execution plan used a range scan by 
a partial index over a utf8 character field.
This also caused wrong results in many other cases.
2006-06-22 00:29:04 +04:00
bar@mysql.com
bfae7303d7 Bug#20086: Can't get data from key partitioned tables with VARCHAR key
The problem appeared because the same values produced different hash
during INSERT and SELECT for VARCHAR data type.
Fix:
VARCHAR required special treatment to avoid hashing of length bytes
(leftmost one or two bytes) as well as trailing bytes beyond real length,
which could contain garbage. Fix is done by introducing hash() - new method
in the Field class.
2006-06-21 13:00:19 +05:00
evgen@moonbone.local
8c0aa3560c field.cc, field.h:
Additional fix for #16377 for bigendian platforms
sql_select.cc, select.result, select.test:
  After merge fix
2006-06-21 01:14:53 +04: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
evgen@moonbone.local
c0850425e5 rpl_log.test, rpl_stm_log.result:
Fixed failing test case
field.cc, item_cmpfunc.cc, select.result:
  After merge fix
2006-06-19 04:26:27 +04:00
evgen@moonbone.local
79c91f6214 Manually merged 2006-06-18 14:56:35 +04:00
serg@serg.mylan
c4dd4a398b remove wrong assert 2006-06-16 16:26:30 +02: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
igor@rurik.mysql.com
9b7ecb5553 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rurik.mysql.com:/home/igor/mysql-5.0-opt
2006-06-15 18:36:46 -07:00
evgen@moonbone.local
a2261d57be Many files:
After merge fix
2006-06-15 01:48:41 +04:00
serg@serg.mylan
99fd8f728b cleanup String::set(integer) 2006-06-14 23:09:03 +02:00
evgen@moonbone.local
e35a0ca4b7 Manually merged 2006-06-14 23:54:08 +04:00
igor@rurik.mysql.com
3f5f33d8f8 Merge rurik.mysql.com:/home/igor/mysql-4.1-opt
into  rurik.mysql.com:/home/igor/mysql-5.0-opt
2006-06-13 20:04:48 -07:00
igor@rurik.mysql.com
355753baa4 Fixed bug #14896.
This bug in Field_string::cmp resulted in a wrong comparison 
with keys in partial indexes over multi-byte character fields.
Given field a is declared as 
  a varchar(16) collate utf8_unicode_ci
INDEX(a(4)) gives us an example of such an index.

Wrong key comparisons could lead to wrong result sets if 
the selected query execution plan used a range scan by 
a partial index over a utf8 character field.
This also caused wrong results in many other cases.
2006-06-13 19:57:50 -07:00
evgen@moonbone.local
67de8c46a5 Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.

All date/time functions has the STRING result type thus their results are
compared as strings. The string date representation allows a user to skip 
some of leading zeros. This can lead to wrong comparison result if a date/time 
function result is compared to such a string constant.

The idea behind this bug fix is to compare results of date/time functions
and data/time constants as ints, because that date/time representation is 
more exact. To achieve this the agg_cmp_type() is changed to take in the
account that a date/time field or an date/time item should be compared 
as ints.

This bug fix is partially back ported from 5.0.

The agg_cmp_type() function now accepts THD as one of parameters. 
In addition, it now checks if a date/time field/function is present in the
list. If so, it tries to coerce all constants to INT to make date/time
comparison return correct result. The field for the constant coercion is
taken from the Item_field or constructed from the Item_func. In latter case
the constructed field will be freed after conversion of all constant items.
Otherwise the result is same as before - aggregated with help of the
item_cmp_type() function.

From the Item_func_between::fix_length_and_dec() function removed the part
which was converting date/time constants to int if possible. Now this is 
done by the agg_cmp_type() function.

The new function result_as_longlong() is added to the Item class. 
It indicates that the item is a date/time item and result of it can be
compared as int. Such items are date/time fields/functions.

Correct val_int() methods are implemented for classes Item_date_typecast, 
Item_func_makedate, Item_time_typecast, Item_datetime_typecast. All these
classes are derived from Item_str_func and Item_str_func::val_int() converts
its string value to int without regard to the date/time type of these items.

Arg_comparator::set_compare_func() and Arg_comparator::set_cmp_func()
functions are changed to substitute result type of an item with the INT_RESULT
if the item is a date/time item and another item is a constant. This is done
to get a correct result of comparisons like date_time_function() = string_constant.
2006-06-13 19:09:24 +04:00
monty@mysql.com
c46fb742b8 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  mysql.com:/home/my/mysql-5.1
2006-06-04 21:05:22 +03:00
monty@mysql.com
74cc73d461 This changeset is largely a handler cleanup changeset (WL#3281), but includes fixes and cleanups that was found necessary while testing the handler changes
Changes that requires code changes in other code of other storage engines.
(Note that all changes are very straightforward and one should find all issues
by compiling a --debug build and fixing all compiler errors and all
asserts in field.cc while running the test suite),

- New optional handler function introduced: reset()
  This is called after every DML statement to make it easy for a handler to
  statement specific cleanups.
  (The only case it's not called is if force the file to be closed)

- handler::extra(HA_EXTRA_RESET) is removed. Code that was there before
  should be moved to handler::reset()

- table->read_set contains a bitmap over all columns that are needed
  in the query.  read_row() and similar functions only needs to read these
  columns
- table->write_set contains a bitmap over all columns that will be updated
  in the query. write_row() and update_row() only needs to update these
  columns.
  The above bitmaps should now be up to date in all context
  (including ALTER TABLE, filesort()).

  The handler is informed of any changes to the bitmap after
  fix_fields() by calling the virtual function
  handler::column_bitmaps_signal(). If the handler does caching of
  these bitmaps (instead of using table->read_set, table->write_set),
  it should redo the caching in this code. as the signal() may be sent
  several times, it's probably best to set a variable in the signal
  and redo the caching on read_row() / write_row() if the variable was
  set.

- Removed the read_set and write_set bitmap objects from the handler class

- Removed all column bit handling functions from the handler class.
  (Now one instead uses the normal bitmap functions in my_bitmap.c instead
  of handler dedicated bitmap functions)

- field->query_id is removed. One should instead instead check
  table->read_set and table->write_set if a field is used in the query.

- handler::extra(HA_EXTRA_RETRIVE_ALL_COLS) and
  handler::extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) are removed. One should now
  instead use table->read_set to check for which columns to retrieve.

- If a handler needs to call Field->val() or Field->store() on columns
  that are not used in the query, one should install a temporary
  all-columns-used map while doing so. For this, we provide the following
  functions:

  my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
  field->val();
  dbug_tmp_restore_column_map(table->read_set, old_map);

  and similar for the write map:

  my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
  field->val();
  dbug_tmp_restore_column_map(table->write_set, old_map);

  If this is not done, you will sooner or later hit a DBUG_ASSERT
  in the field store() / val() functions.
  (For not DBUG binaries, the dbug_tmp_restore_column_map() and
  dbug_tmp_restore_column_map() are inline dummy functions and should
  be optimized away be the compiler).

- If one needs to temporary set the column map for all binaries (and not
  just to avoid the DBUG_ASSERT() in the Field::store() / Field::val()
  methods) one should use the functions tmp_use_all_columns() and
  tmp_restore_column_map() instead of the above dbug_ variants.

- All 'status' fields in the handler base class (like records,
  data_file_length etc) are now stored in a 'stats' struct. This makes
  it easier to know what status variables are provided by the base
  handler.  This requires some trivial variable names in the extra()
  function.

- New virtual function handler::records().  This is called to optimize
  COUNT(*) if (handler::table_flags() & HA_HAS_RECORDS()) is true.
  (stats.records is not supposed to be an exact value. It's only has to
  be 'reasonable enough' for the optimizer to be able to choose a good
  optimization path).

- Non virtual handler::init() function added for caching of virtual
  constants from engine.

- Removed has_transactions() virtual method. Now one should instead return
  HA_NO_TRANSACTIONS in table_flags() if the table handler DOES NOT support
  transactions.

- The 'xxxx_create_handler()' function now has a MEM_ROOT_root argument
  that is to be used with 'new handler_name()' to allocate the handler
  in the right area.  The xxxx_create_handler() function is also
  responsible for any initialization of the object before returning.

  For example, one should change:

  static handler *myisam_create_handler(TABLE_SHARE *table)
  {
    return new ha_myisam(table);
  }

  ->

  static handler *myisam_create_handler(TABLE_SHARE *table, MEM_ROOT *mem_root)
  {
    return new (mem_root) ha_myisam(table);
  }

- New optional virtual function: use_hidden_primary_key().
  This is called in case of an update/delete when
  (table_flags() and HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) is defined
  but we don't have a primary key. This allows the handler to take precisions
  in remembering any hidden primary key to able to update/delete any
  found row. The default handler marks all columns to be read.

- handler::table_flags() now returns a ulonglong (to allow for more flags).

- New/changed table_flags()
  - HA_HAS_RECORDS	    Set if ::records() is supported
  - HA_NO_TRANSACTIONS	    Set if engine doesn't support transactions
  - HA_PRIMARY_KEY_REQUIRED_FOR_DELETE
                            Set if we should mark all primary key columns for
			    read when reading rows as part of a DELETE
			    statement. If there is no primary key,
			    all columns are marked for read.
  - HA_PARTIAL_COLUMN_READ  Set if engine will not read all columns in some
			    cases (based on table->read_set)
 - HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS
   			    Renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION.
 - HA_DUPP_POS              Renamed to HA_DUPLICATE_POS
 - HA_REQUIRES_KEY_COLUMNS_FOR_DELETE
			    Set this if we should mark ALL key columns for
			    read when when reading rows as part of a DELETE
			    statement. In case of an update we will mark
			    all keys for read for which key part changed
			    value.
  - HA_STATS_RECORDS_IS_EXACT
			     Set this if stats.records is exact.
			     (This saves us some extra records() calls
			     when optimizing COUNT(*))
			    

- Removed table_flags()
  - HA_NOT_EXACT_COUNT     Now one should instead use HA_HAS_RECORDS if
			   handler::records() gives an exact count() and
			   HA_STATS_RECORDS_IS_EXACT if stats.records is exact.
  - HA_READ_RND_SAME	   Removed (no one supported this one)

- Removed not needed functions ha_retrieve_all_cols() and ha_retrieve_all_pk()

- Renamed handler::dupp_pos to handler::dup_pos

- Removed not used variable handler::sortkey


Upper level handler changes:

- ha_reset() now does some overall checks and calls ::reset()
- ha_table_flags() added. This is a cached version of table_flags(). The
  cache is updated on engine creation time and updated on open.


MySQL level changes (not obvious from the above):

- DBUG_ASSERT() added to check that column usage matches what is set
  in the column usage bit maps. (This found a LOT of bugs in current
  column marking code).

- In 5.1 before, all used columns was marked in read_set and only updated
  columns was marked in write_set. Now we only mark columns for which we
  need a value in read_set.

- Column bitmaps are created in open_binary_frm() and open_table_from_share().
  (Before this was in table.cc)

- handler::table_flags() calls are replaced with handler::ha_table_flags()

- For calling field->val() you must have the corresponding bit set in
  table->read_set. For calling field->store() you must have the
  corresponding bit set in table->write_set. (There are asserts in
  all store()/val() functions to catch wrong usage)

- thd->set_query_id is renamed to thd->mark_used_columns and instead
  of setting this to an integer value, this has now the values:
  MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE
  Changed also all variables named 'set_query_id' to mark_used_columns.

- In filesort() we now inform the handler of exactly which columns are needed
  doing the sort and choosing the rows.

- The TABLE_SHARE object has a 'all_set' column bitmap one can use
  when one needs a column bitmap with all columns set.
  (This is used for table->use_all_columns() and other places)

- The TABLE object has 3 column bitmaps:
  - def_read_set     Default bitmap for columns to be read
  - def_write_set    Default bitmap for columns to be written
  - tmp_set          Can be used as a temporary bitmap when needed.
  The table object has also two pointer to bitmaps read_set and write_set
  that the handler should use to find out which columns are used in which way.

- count() optimization now calls handler::records() instead of using
  handler->stats.records (if (table_flags() & HA_HAS_RECORDS) is true).

- Added extra argument to Item::walk() to indicate if we should also
  traverse sub queries.

- Added TABLE parameter to cp_buffer_from_ref()

- Don't close tables created with CREATE ... SELECT but keep them in
  the table cache. (Faster usage of newly created tables).


New interfaces:

- table->clear_column_bitmaps() to initialize the bitmaps for tables
  at start of new statements.

- table->column_bitmaps_set() to set up new column bitmaps and signal
  the handler about this.

- table->column_bitmaps_set_no_signal() for some few cases where we need
  to setup new column bitmaps but don't signal the handler (as the handler
  has already been signaled about these before). Used for the momement
  only in opt_range.cc when doing ROR scans.

- table->use_all_columns() to install a bitmap where all columns are marked
  as use in the read and the write set.

- table->default_column_bitmaps() to install the normal read and write
  column bitmaps, but not signaling the handler about this.
  This is mainly used when creating TABLE instances.

- table->mark_columns_needed_for_delete(),
  table->mark_columns_needed_for_delete() and
  table->mark_columns_needed_for_insert() to allow us to put additional
  columns in column usage maps if handler so requires.
  (The handler indicates what it neads in handler->table_flags())

- table->prepare_for_position() to allow us to tell handler that it
  needs to read primary key parts to be able to store them in
  future table->position() calls.
  (This replaces the table->file->ha_retrieve_all_pk function)

- table->mark_auto_increment_column() to tell handler are going to update
  columns part of any auto_increment key.

- table->mark_columns_used_by_index() to mark all columns that is part of
  an index.  It will also send extra(HA_EXTRA_KEYREAD) to handler to allow
  it to quickly know that it only needs to read colums that are part
  of the key.  (The handler can also use the column map for detecting this,
  but simpler/faster handler can just monitor the extra() call).

- table->mark_columns_used_by_index_no_reset() to in addition to other columns,
  also mark all columns that is used by the given key.

- table->restore_column_maps_after_mark_index() to restore to default
  column maps after a call to table->mark_columns_used_by_index().

- New item function register_field_in_read_map(), for marking used columns
  in table->read_map. Used by filesort() to mark all used columns

- Maintain in TABLE->merge_keys set of all keys that are used in query.
  (Simplices some optimization loops)

- Maintain Field->part_of_key_not_clustered which is like Field->part_of_key
  but the field in the clustered key is not assumed to be part of all index.
  (used in opt_range.cc for faster loops)

-  dbug_tmp_use_all_columns(), dbug_tmp_restore_column_map()
   tmp_use_all_columns() and tmp_restore_column_map() functions to temporally
   mark all columns as usable.  The 'dbug_' version is primarily intended
   inside a handler when it wants to just call Field:store() & Field::val()
   functions, but don't need the column maps set for any other usage.
   (ie:: bitmap_is_set() is never called)

- We can't use compare_records() to skip updates for handlers that returns
  a partial column set and the read_set doesn't cover all columns in the
  write set. The reason for this is that if we have a column marked only for
  write we can't in the MySQL level know if the value changed or not.
  The reason this worked before was that MySQL marked all to be written
  columns as also to be read. The new 'optimal' bitmaps exposed this 'hidden
  bug'.

- open_table_from_share() does not anymore setup temporary MEM_ROOT
  object as a thread specific variable for the handler. Instead we
  send the to-be-used MEMROOT to get_new_handler().
  (Simpler, faster code)



Bugs fixed:

- Column marking was not done correctly in a lot of cases.
  (ALTER TABLE, when using triggers, auto_increment fields etc)
  (Could potentially result in wrong values inserted in table handlers
  relying on that the old column maps or field->set_query_id was correct)
  Especially when it comes to triggers, there may be cases where the
  old code would cause lost/wrong values for NDB and/or InnoDB tables.

- Split thd->options flag OPTION_STATUS_NO_TRANS_UPDATE to two flags:
  OPTION_STATUS_NO_TRANS_UPDATE and OPTION_KEEP_LOG.
  This allowed me to remove some wrong warnings about:
  "Some non-transactional changed tables couldn't be rolled back"

- Fixed handling of INSERT .. SELECT and CREATE ... SELECT that wrongly reset
  (thd->options & OPTION_STATUS_NO_TRANS_UPDATE) which caused us to loose
  some warnings about
  "Some non-transactional changed tables couldn't be rolled back")

- Fixed use of uninitialized memory in ha_ndbcluster.cc::delete_table()
  which could cause delete_table to report random failures.

- Fixed core dumps for some tests when running with --debug

- Added missing FN_LIBCHAR in mysql_rm_tmp_tables()
  (This has probably caused us to not properly remove temporary files after
  crash)

- slow_logs was not properly initialized, which could maybe cause
  extra/lost entries in slow log.

- If we get an duplicate row on insert, change column map to read and
  write all columns while retrying the operation. This is required by
  the definition of REPLACE and also ensures that fields that are only
  part of UPDATE are properly handled.  This fixed a bug in NDB and
  REPLACE where REPLACE wrongly copied some column values from the replaced
  row.

- For table handler that doesn't support NULL in keys, we would give an error
  when creating a primary key with NULL fields, even after the fields has been
  automaticly converted to NOT NULL.

- Creating a primary key on a SPATIAL key, would fail if field was not
  declared as NOT NULL.


Cleanups:

- Removed not used condition argument to setup_tables

- Removed not needed item function reset_query_id_processor().

- Field->add_index is removed. Now this is instead maintained in
  (field->flags & FIELD_IN_ADD_INDEX)

- Field->fieldnr is removed (use field->field_index instead)

- New argument to filesort() to indicate that it should return a set of
  row pointers (not used columns). This allowed me to remove some references
  to sql_command in filesort and should also enable us to return column
  results in some cases where we couldn't before.

- Changed column bitmap handling in opt_range.cc to be aligned with TABLE
  bitmap, which allowed me to use bitmap functions instead of looping over
  all fields to create some needed bitmaps. (Faster and smaller code)

- Broke up found too long lines

- Moved some variable declaration at start of function for better code
  readability.

- Removed some not used arguments from functions.
  (setup_fields(), mysql_prepare_insert_check_table())

- setup_fields() now takes an enum instead of an int for marking columns
   usage.

- For internal temporary tables, use handler::write_row(),
  handler::delete_row() and handler::update_row() instead of
  handler::ha_xxxx() for faster execution.

- Changed some constants to enum's and define's.

- Using separate column read and write sets allows for easier checking
  of timestamp field was set by statement.

- Remove calls to free_io_cache() as this is now done automaticly in ha_reset()

- Don't build table->normalized_path as this is now identical to table->path
  (after bar's fixes to convert filenames)

- Fixed some missed DBUG_PRINT(.."%lx") to use "0x%lx" to make it easier to
  do comparision with the 'convert-dbug-for-diff' tool.


Things left to do in 5.1:

- We wrongly log failed CREATE TABLE ... SELECT in some cases when using
  row based logging (as shown by testcase binlog_row_mix_innodb_myisam.result)
  Mats has promised to look into this.

- Test that my fix for CREATE TABLE ... SELECT is indeed correct.
  (I added several test cases for this, but in this case it's better that
  someone else also tests this throughly).
  Lars has promosed to do this.
2006-06-04 18:52:22 +03:00
jani@a193-229-222-105.elisa-laajakaista.fi
9bf4fd5e9b Merge from 5.0 2006-05-31 11:18:58 +03:00
jani@a193-229-222-105.elisa-laajakaista.fi
c81b4c01bf Merge a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.0
into  a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-new
2006-05-30 16:07:49 +03:00
evgen@moonbone.local
516b8f0aca Manually merged 2006-05-24 20:52:57 +04:00
monty@mysql.com
97b941d924 Remove dflt_field from field structure as this was only needed when createing temporary table and I found another soultion that doesn't increase the size of the field structure for all table instances. (Better fix for bug #19089)
Fixed compiler warnings
Fixed valgrind warning in Item_date_add_intervall::eq. (Recoding of bugfix #19490)
2006-05-24 11:56:59 +03:00
igor@rurik.mysql.com
a6aaca7d6a Post-review fixes for bug #19089 2006-05-22 07:57:46 -07:00
igor@rurik.mysql.com
12e53358f0 Fixed bug #19089.
When a CREATE TABLE command created a table from a materialized
view id does not inherit default values from the underlying table.
Moreover the temporary table used for the view materialization
does not inherit those default values.
In the case when the underlying table contained ENUM fields it caused
misleading error messages. In other cases the created table contained
wrong default values.
The code was modified to ensure inheritance of default values for
materialized views.
2006-05-20 18:54:43 -07:00
ramil@mysql.com
7319ef4ef1 Fix for #16327: invalid TIMESTAMP values retrieved 2006-05-17 17:00:30 +05:00
mats@mysql.com
67909baa28 WL#3259 (RBR with more columns on slave than on master):
Added support for UPDATE.
Some minor fixes.
2006-05-08 20:05:25 +02:00
mats@mysql.com
77c4a2ca60 WL#3259 (RBR with more columns on slave than on master):
Extended replication to allow extra columns added last on slave
as compared with table on master.
2006-05-03 15:00:38 +02:00
mskold@mysql.com
af898aec6a Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  mysql.com:/usr/local/home/marty/MySQL/mysql-5.1-new
2006-04-11 14:26:06 +02:00
msvensson@neptunus.(none)
2eb47b3ac4 Remove extra "," 2006-04-11 10:03:04 +02:00
jimw@mysql.com
4ab9c02971 Merge mysql.com:/home/jimw/my/mysql-5.0-clean
into  mysql.com:/home/jimw/my/mysql-5.1-clean
2006-04-10 20:18:12 -07:00
jimw@mysql.com
a159a55c2c Merge bk-internal:/home/bk/mysql-5.0
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2006-04-10 14:30:00 -07:00
jimw@mysql.com
1a59580dcd Bug #13601: Wrong int type for bit
The wrong value was being reported as the field_length for BIT
  fields, resulting in confusion for at least Connector/J. The
  field_length is now always the number of bits in the field, as
  it should be.
2006-04-04 17:54:58 -07:00
mskold@mysql.com
f0ae573088 Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  mysql.com:/usr/local/home/marty/MySQL/mysql-5.1-new
2006-04-03 13:27:12 +02:00
mskold@mysql.com
5a4dce6291 Fix for bug#18133: Adding index to unsigned int causes on-line add index not to be used 2006-04-03 13:25:28 +02:00
bar@mysql.com
67f26cc432 Merge mysql.com:/usr/home/bar/mysql-5.0.1.2107.1.1
into  mysql.com:/usr/home/bar/mysql-5.1-new
2006-03-31 17:38:00 +05:00
bar@mysql.com
07e21be0fe Additional 5.0 fix for
Bug#15098: CAST(column double TO signed int), wrong result
which was fixed originally in 4.1.
2006-03-29 19:31:16 +05:00
bar@mysql.com
4886c53fbb Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/bar/mysql-4.1.b15098
2006-03-28 18:32:58 +05:00
bar@mysql.com
b56bc04c7d Merge mysql.com:/usr/home/bar/mysql-5.0
into  mysql.com:/usr/home/bar/mysql-5.1-new
2006-03-28 18:24:04 +05:00
bar@mysql.com
29b8e09732 Merge mysql.com:/usr/home/bar/mysql-4.1.b15098
into  mysql.com:/usr/home/bar/mysql-5.0
Bug#15098
2006-03-28 17:07:26 +05:00
dlenev@mysql.com
8dbdf5237e Merge mysql.com:/home/dlenev/src/mysql-5.0-bg13525
into  mysql.com:/home/dlenev/src/mysql-5.1-merges2
2006-02-27 20:00:07 +03:00
dlenev@mysql.com
6cb5c38c14 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg13525
2006-02-27 20:00:03 +03:00
monty@mysql.com
1e2e9e2856 Merge mysql.com:/home/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.1
2006-02-25 21:54:34 +02:00
monty@mysql.com
54274976e7 Fixed compiler warnings from gcc 4.0.2:
- Added empty constructors and virtual destructors to many classes and structs
- Removed some usage of the offsetof() macro to instead use C++ class pointers
2006-02-25 17:46:30 +02:00
konstantin@mysql.com
49ad134e9f After-merge fixes (Bug#13134) 2006-02-24 00:12:04 +03:00
konstantin@mysql.com
af62c4a959 Merge mysql.com:/opt/local/work/mysql-4.1-13134
into  mysql.com:/opt/local/work/mysql-5.0-runtime
2006-02-24 00:00:15 +03:00
konstantin@mysql.com
442c2ba8af A fix and a test case for Bug#13134 "Length of VARCHAR() utf8
column is increasing when table is recreated with PS/SP":
make use of create_field::char_length more consistent in the code.
Reinit create_field::length from create_field::char_length
for every execution of a prepared statement (actually fixes the 
bug).
2006-02-21 19:52:20 +03:00
konstantin@mysql.com
e656863033 Merge mysql.com:/home/kostja/mysql/tmp_merge
into  mysql.com:/home/kostja/mysql/mysql-5.1-merge
2006-02-08 00:02:56 +03:00
konstantin@mysql.com
9f0bb47f87 Merge mysql.com:/home/kostja/mysql/tmp_merge
into  mysql.com:/home/kostja/mysql/mysql-5.1-merge
2006-02-02 23:27:06 +03:00
konstantin@mysql.com
92b41ba92a Merge mysql.com:/home/kostja/mysql/tmp_merge
into  mysql.com:/home/kostja/mysql/mysql-5.1-merge
2006-02-02 16:57:34 +03:00
SergeyV@selena.
624eec4f58 Merge svlasenko@bk-internal.mysql.com:/home/bk/mysql-5.0
into  selena.:H:/MYSQL/src/#15634-mysql-5.0
2006-01-30 17:03:09 +03:00
anozdrin@mysql.com
145fd62bc1 Fix for BUG#15588: String overrun during sp-vars.test
The bug appears after implementation of WL#2984
(Make stored routine variables work according to the standard).
2006-01-20 15:59:22 +03:00
serg@serg.mylan
ae3d815b41 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
2006-01-16 18:09:04 +01:00
evgen@moonbone.local
7f0aa55e36 Manually merged 2006-01-16 16:57:15 +03:00
bar@mysql.com
0e9c8395c7 Merge mysql.com:/usr/home/bar/mysql-4.1.b15581
into  mysql.com:/usr/home/bar/mysql-5.0
2006-01-12 11:38:09 +04:00
serg@serg.mylan
8dc77f267b merged 2006-01-06 18:26:59 +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
serg@serg.mylan
30c09d6dc0 merged 2006-01-03 18:12:03 +01:00
serg@serg.mylan
14f94dc0ca many warnings (practically safe but annoying) corrected 2006-01-03 17:54:54 +01:00
SergeyV@selena.
6d55b423d8 Fixes bug #15634. Eliminates compiler warning 'all return paths are recursive in
Field_date::store function'. Though the Field_date::store function almost unused
when protocol_version=10 additional check was added into it to store 4byte dates 
properly. Effective test routine is not available so far due to protocol_version
is not a dynamic property and can not be modified with mysql-test script.
2005-12-28 19:40:37 +03:00
bar@mysql.com
f206a123a1 Bug#15581: COALESCE function truncates mutli-byte TINYTEXT values
field.cc:
  BLOB variations have number-in-bytes limit,
  unlike CHAR/VARCHAR which have number-of-characters limits.
  A tinyblob column can store up to 255 bytes.
  In the case of basic Latin letters (which use 1 byte per character)
  we can store up to 255 characters in a tinyblob column.
  When passing an utf8 tinyblob column as an argument into
  a function (e.g. COALESCE) we need to reserve 3*255 bytes.
  I.e. multiply length in bytes to mbcharlen for the character set.
  Although in reality a tinyblob column can never be 3*255 bytes long,
  we need to set max_length to multiply to make fix_length_and_dec()
  of the function-caller (e.g. COALESCE) calculate the correct max_length
  for the column being created.

ctype_utf8.result, ctype_utf8.test:
  Adding test case.
2005-12-19 15:52:10 +04:00
anozdrin@mysql.com
5d105fb7e7 Merge mysql.com:/home/alik/MySQL/devel/5.0-wl2984
into  mysql.com:/home/alik/MySQL/devel/5.1-wl2984-merge
2005-12-09 15:14:19 +03:00
anozdrin@mysql.com
5b981a4844 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/alik/Documents/AllProgs/MySQL/devel/5.0-sp-vars-merge-2
2005-12-07 17:17:42 +03:00
anozdrin@mysql.com
0ff8f60b45 Patch for WL#2894: Make stored routine variables work
according to the standard.

The idea is to use Field-classes to implement stored routines
variables. Also, we should provide facade to Item-hierarchy
by Item_field class (it is necessary, since SRVs take part
in expressions).

The patch fixes the following bugs:
  - BUG#8702: Stored Procedures: No Error/Warning shown for inappropriate data 
    type matching; 
 
  - BUG#8768: Functions: For any unsigned data type, -ve values can be passed 
    and returned; 
 
  - BUG#8769: Functions: For Int datatypes, out of range values can be passed 
    and returned; 
 
  - BUG#9078: STORED PROCDURE: Decimal digits are not displayed when we use 
    DECIMAL datatype; 
 
  - BUG#9572: Stored procedures: variable type declarations ignored; 
 
  - BUG#12903: upper function does not work inside a function; 
 
  - BUG#13705: parameters to stored procedures are not verified; 
 
  - BUG#13808: ENUM type stored procedure parameter accepts non-enumerated
    data; 
 
  - BUG#13909: Varchar Stored Procedure Parameter always BINARY string (ignores 
    CHARACTER SET); 
 
  - BUG#14161: Stored procedure cannot retrieve bigint unsigned;

  - BUG#14188: BINARY variables have no 0x00 padding;

  - BUG#15148: Stored procedure variables accept non-scalar values;
2005-12-07 17:01:17 +03:00
jimw@mysql.com
bc4e6f822b Merge mysql.com:/home/jimw/my/mysql-5.0-clean
into  mysql.com:/home/jimw/my/mysql-5.1-clean
2005-12-06 18:27:39 -08:00
jimw@mysql.com
68bc3dd1fd Merge mysql.com:/home/jimw/my/mysql-5.0-14299
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-12-06 14:16:34 -08:00
bar@mysql.com
3e284e22a1 Bug#15098 CAST(column double TO signed int), wrong result
field.cc:
  Adding longlong range checking to return
  LONGLONG_MIN or LONGLONG_MAX when out of range. 
  Using (longlong) cast only when range is ok.
cast.test:
  Adding test case.
cast.result:
  Fixing results accordingly.
2005-12-06 16:54:13 +04:00
pem@mysql.com
e7a7af07b2 Merge mysql.com:/usr/local/bk/mysql-5.0
into  mysql.com:/usr/home/pem/mysql-5.1-new
2005-12-02 18:43:08 +01:00
ramil@mysql.com
b46c240b96 Addition to fix for bug #12956: cast make differ rounding.
- use rint() in some other val_int() methods as well.
2005-11-29 18:06:58 +04:00
monty@mysql.com
4575a662cb Merge mysql.com:/home/my/mysql-5.1
into  mysql.com:/home/my/mysql-5.1-TDC
2005-11-23 22:58:53 +02:00
monty@mysql.com
30b360bfcc Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  mysql.com:/home/my/mysql-5.1
2005-11-23 22:45:47 +02:00
monty@mysql.com
e42c980967 Table definition cache, part 2
The table opening process now works the following way:
- Create common TABLE_SHARE object
- Read the .frm file and unpack it into the TABLE_SHARE object
- Create a TABLE object based on the information in the TABLE_SHARE
  object and open a handler to the table object

Other noteworthy changes:
- In TABLE_SHARE the most common strings are now LEX_STRING's
- Better error message when table is not found
- Variable table_cache is now renamed 'table_open_cache'
- New variable 'table_definition_cache' that is the number of table defintions that will be cached
- strxnmov() calls are now fixed to avoid overflows
- strxnmov() will now always add one end \0 to result
- engine objects are now created with a TABLE_SHARE object instead of a TABLE object.
- After creating a field object one must call field->init(table) before using it

- For a busy system this change will give you:
 - Less memory usage for table object
 - Faster opening of tables (if it's has been in use or is in table definition cache)
 - Allow you to cache many table definitions objects
 - Faster drop of table
2005-11-23 22:45:02 +02:00
monty@mysql.com
e05630b17f Moved long running query to type_newdecimal-big.test
Removed warnings that depends on floating point comparisions in type_newdecimal.test which caused failures in some setups
2005-11-23 20:16:06 +02:00
jani@a193-229-222-105.elisa-laajakaista.fi
5273071265 Merge a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.0
into  a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-new
2005-11-23 14:57:00 +02:00
ingo@production.mysql.com
49ed3c589d Merge istruewing@bk-internal.mysql.com:/home/bk/mysql-5.0
into production.mysql.com:/usersnfs/istruewing/autopush/mysql-5.0
2005-11-21 23:30:14 +01: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
guilhem@mysql.com
2f95fc2701 Merge mysql.com:/home/mysql_src/mysql-5.0
into  mysql.com:/home/mysql_src/mysql-5.1-merge-of-5.0 (not all files are good,
I'll fix; I'll ask some devs to check their part)
2005-11-18 16:38:01 +01:00
jimw@mysql.com
8ecedd193b Report truncation of spaces when inserting into a BINARY or VARBINARY
field. (Bug #14299)
2005-11-15 19:21:05 -08:00
ingo@mysql.com
88b6d28aba Bug#13707 - Server crash with INSERT DELAYED on MyISAM table
After push fix. Must not access new_field if it is NULL.
2005-11-14 19:53:41 +01:00
ingo@production.mysql.com
cae673d0a9 Merge istruewing@bk-internal.mysql.com:/home/bk/mysql-5.0
into production.mysql.com:/usersnfs/istruewing/autopush/mysql-5.0
2005-11-08 20:18:08 +01:00
ingo@mysql.com
7533d92b23 Bug#13707 - Server crash with INSERT DELAYED on MyISAM table
Initialized 'ptr' for a newly instantiated varstring field.
This is required by INSERT DELAYED.

No test case. This is a migration issue. There are two shell
scripts attached to the bug report. They can be used for testing.
2005-11-07 18:31:48 +01:00
guilhem@mysql.com
ef415ceb14 Fix for BUG#14703 "Valgrind error when inserting 0 into a BIT column (like in type_bit.test)":
test "length" first (otherwise when "length" is 0, the *from invalid access still triggers a Valgrind warning).
I wrote to the Valgrind authors in case this is something fixable in Valgrind (normally the
decision to issue a warning is based on the simulated CPU condition code, which should not be undefined here).
2005-11-07 16:18:46 +01:00
monty@mysql.com
a6f5375cb0 Merge mysql.com:/home/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.1
2005-11-05 01:32:55 +02:00
patg@krsna.patg.net
7b611b33f2 BUG #14532
Added FIELD_TYPE_BIT to field method 'needs_quotes' to make BIT columns
work.
2005-10-31 17:17:16 -08:00
jani@ua141d10.elisa.omakaista.fi
44aea416f9 Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-tmp
2005-10-31 11:54:36 +02:00
hf@deer.(none)
5150bd8f9f Merge bk@192.168.21.1:/usr/home/bk/mysql-4.1
into deer.(none):/home/hf/work/mysql-4.1.12839
2005-10-31 12:24:43 +04:00
hf@deer.(none)
16c66d49ca Additional fix for #12839 2005-10-31 12:05:27 +04: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
monty@mysql.com
3da5f1c223 Move handling of suffix_length from strnxfrm_bin() to filesort to ensure proper sorting of all kind of binary objects
field::sort_key() now adds length last for varbinary/blob
VARBINARY/BLOB is now sorted by filesort so that shorter strings comes before longer ones
Fixed issues in test cases from last merge
2005-10-14 00:04:52 +03:00
bar@mysql.com
39b0712cf7 type_binary.result, type_binary.test:
new file
mysql_fix_privilege_tables.sql, mysql_create_system_tables.sh:
  Adding true BINARY/VARBINARY: fixing "password" type, not to be 0x00-padding.
Many files:
  Adding true BINARY/VARBINARY: fixing tests not to output 0x00 bytes.
  Adding true BINARY/VARBINARY: new pad_char structure member.
ctype-bin.c:
  Adding true BINARY/VARBINARY: new pad_char structure member.
  New strnxfrm, with two trailing length bytes.
field.cc:
  Adding true BINARY/VARBINARY.
2005-10-13 19:16:19 +05:00
tomas@poseidon.ndb.mysql.com
620b7bafb0 Merge 2005-10-06 10:54:07 +02:00
jani@a193-229-222-105.elisa-laajakaista.fi
8d3036c35e Some minor fixes revealed as warnings by
Intel compiler.
2005-09-23 21:28:56 +03:00
hf@deer.(none)
12068b45e8 Fix for bug #12839 (Endian support is absurd) 2005-09-21 14:35:01 +05:00
msvensson@neptunus.(none)
fb63290635 Merge neptunus.(none):/home/msvensson/mysql/bug10713_new/my50-bug10713_new
into  neptunus.(none):/home/msvensson/mysql/bug10713_new/my51-bug10713_new
2005-09-14 09:43:56 +02: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
pappa@c-8b0ae253.1238-1-64736c10.cust.bredbandsbolaget.se
69acde961f Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.0
into  c-8b0ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-5.1
2005-08-05 18:01:34 -04:00
monty@mishka.local
8437e9c1be Fixes during review of new pushed code
Change bool in C code to my_bool
Added to mysqltest --enable_parsning and --disable_parsing to avoid to have to comment parts of tests
Added comparison of LEX_STRING's and use this to compare file types for view and trigger files.
2005-07-31 12:49:55 +03:00
monty@mysql.com
987edeaa9b Fixed compiler warnings 2005-07-28 21:25:05 +03:00
ramil@mysql.com
e43dff67f5 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/usr/home/ram/work/mysql-5.0
2005-07-27 15:09:06 +05:00
ramil@mysql.com
afb1ad8415 a fix (bug #11546: Bad error message from inserting out of range values, SQL_MODE='tradition'). 2005-07-26 12:18:35 +05:00
ramil@mysql.com
efc8404a40 fix (bug #11964: ALTER TABLE gives wrong error message with sql-mode TRADITIONAL (timestamp)). 2005-07-25 14:36:07 +05:00
jani@a193-229-222-105.elisa-laajakaista.fi
8f10662eab Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1
into  a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.1
2005-07-23 00:15:53 +03:00
jani@a193-229-222-105.elisa-laajakaista.fi
2657e48c64 Faster alter table code for 5.1. 2005-07-22 23:43:59 +03:00
tulin@dl145b.mysql.com
98a26f0c3f merge 2005-07-21 00:04:18 +02:00
jimw@mysql.com
93ae805db3 Fix date conversion on 32-bit machines. 2005-07-20 10:16:43 -07:00
tulin@dl145b.mysql.com
6176a4acf6 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1
2005-07-20 14:48:34 +02:00
konstantin@mysql.com
4570ace8fb Fix warnings/compilation failures reported by Jan Lindstrom 2005-07-20 14:17:06 +04:00
tulin@dl145b.mysql.com
bf6e3f9aa8 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1
2005-07-20 07:53:10 +02:00
jimw@mysql.com
d7fbff3ec5 Merge mysql.com:/home/jimw/my/mysql-5.0-5906
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-07-19 19:59:34 -07:00
jimw@mysql.com
dd2f631ec4 Fix number to date conversion so it always honors the NO_ZERO_DATE,
NO_ZERO_IN_DATE, and INVALID_DATES bits of SQL_MODE. (Bug #5906)
2005-07-18 16:12:44 -07:00
mronstrom@mysql.com
67087e2aa7 Patch for push of wl1354 Partitioning 2005-07-18 13:31:02 +02:00
tomas@poseidon.ndb.mysql.com
8b90390ed5 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1
2005-07-15 19:48:18 +02:00
tomas@poseidon.ndb.mysql.com
911d878ca9 Merge poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1
2005-07-15 15:08:38 +02:00
ramil@mysql.com
ffb7421955 NO_DEFAULT_VALUE_FLAG and BLOB_FLAG combined 2005-07-15 16:25:31 +05:00
ramil@mysql.com
b11d04e50a a fix (bug #9881: ALTER TABLE gives wrong error message with sql-mode TRADITIONAL). 2005-07-15 15:50:57 +05:00
konstantin@mysql.com
3f28ad8eb7 Merge mysql.com:/opt/local/work/mysql-4.1-root
into  mysql.com:/opt/local/work/mysql-5.0-root
2005-07-14 20:02:32 +04:00
konstantin@mysql.com
62b8e6fdd1 A fix and a test case for Bug#9735.
No separate typecode for MEDIUMTEXT/LONGTEXT is added, as we
have no sound decision yet what typecodes and for what types are
sent by the server (aka what constitutes a distinct type in MySQL).
2005-07-14 15:13:23 +04:00
tomas@poseidon.ndb.mysql.com
674b6bb151 Merge 2005-07-12 20:01:22 +02:00
monty@mysql.com
fe30ec9032 manual merge 2005-07-04 03:50:04 +03:00
monty@mysql.com
ec420bfb43 Fixes during review of new code
- Mostly indentation fixes
- Added missing test
- Ensure that Item_func_case() checks for stack overruns
- Use real_item() instead of (Item_ref*) item
- Fixed wrong error handling
2005-07-04 03:42:33 +03:00
monty@mysql.com
86d7b02199 Merge with 4.1 2005-07-03 14:17:52 +03:00
monty@mysql.com
e4bb8377c7 Simple optimization
nsure that delete works not only on table->record[0] for federated tables
2005-06-29 12:44:40 +03:00
igor@rurik.mysql.com
42bb0eaf9f Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1
into rurik.mysql.com:/home/igor/mysql-4.1
2005-06-28 03:20:00 -07:00
igor@rurik.mysql.com
c3aa161c28 field.cc:
Correction after manula merge.
2005-06-24 01:21:18 -07:00
igor@rurik.mysql.com
268110b34b Manual merge 2005-06-23 11:22:30 -07:00
igor@rurik.mysql.com
c73c2af614 func_str.result, func_str.test:
Added a test case for bug #10124.
sql_select.h, item_subselect.cc, sql_select.cc:
  Fixed bug #10124.
  The copy method of the store_key classes can return
  STORE_KEY_OK=0, STORE_KEY_FATAL=1, STORE_KEY_CONV=2 now.
field.cc:
  Fixed bug #10124.
  When ussuing a warning the store methods return 2 instead of 1 now.
2005-06-23 06:15:50 -07:00
ndbdev@dl145b.mysql.com
dcef1c7532 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1
2005-06-22 19:07:29 +02:00
svoj@mysql.com
74373e7d54 WL#2286 - Compile MySQL w/YASSL support
Fix GCC 4.0 link failure.
Better CXX_VERSION guessing.
2005-06-22 14:08:28 +05:00
monty@mishka.local
1524cd001d Cleanup during review of new code
Fixed wrong allocation that could cause buffer overrun when using join cache
2005-06-21 18:18:58 +03:00
tulin@dl145b.mysql.com
b217fc0692 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1
2005-06-20 12:42:39 +02:00
svoj@mysql.com
7660f609e6 WL#2286 - Compile MySQL w/YASSL support
Fix for yaSSL link failures with Forte Developer 7, MIPSpro Compilers, Compaq C++.
These compilers have problem with implicit template instantiation in archives
(libyassl.a, libtaocrypt.a). Instantiate templates explicitly.

Fix for yaSSL link failure on powermacg5 (gcc 3.3). When -O3 is specified gcc inlines
__cxa_pure_virtual. This is wrong behavior, __cxa_pure_virtual must never be inlined.
2005-06-19 21:46:44 +05:00
ndbdev@dl145b.mysql.com
be7c5c1900 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1
2005-06-15 20:07:31 +02:00
igor@rurik.mysql.com
ff0b7e4d73 Manual merge 2005-06-15 08:39:00 -07:00
igor@rurik.mysql.com
316815f44e cast.result, cast.test:
Added test case for bug #11283.
field.h, field.cc:
  Fixed bug #11283: wrong conversion from varchar to decimal.
  Added methods Field_string::val_decimal,
  Field_varstring::val_decimal, Field_blob::val_decimal.
  They are not inherited from the base class Field_longstr
  anymore.
2005-06-15 08:27:33 -07:00
georg@lmy002.wdf.sap.corp
b64e6db5a4 fixes for windows 64-bit compiler warnings 2005-06-13 12:41:15 +02:00
ndbdev@dl145b.mysql.com
8d44b54295 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1
2005-06-10 07:22:27 +02:00
jimw@mysql.com
1055c36000 Merge mysql.com:/home/jimw/my/mysql-5.0-10543
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-06-09 19:29:55 -07:00
tulin@dl145b.mysql.com
6a0a577335 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1
2005-06-08 17:12:09 +02:00
hf@deer.(none)
935b5ec4b4 Fix for bug #9894 (Negative numbers are allowed to 'unsigned' column) 2005-06-08 12:25:57 +05:00
ndbdev@dl145b.mysql.com
2fb1fb5877 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1
2005-06-07 06:50:50 +02:00
ndbdev@dl145b.mysql.com
161a58ab4b merge 2005-06-06 23:39:19 +02:00
monty@mysql.com
775f17667b Merge with 4.1 2005-06-07 00:31:53 +03:00
ramil@mysql.com
592d8f8d41 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/usr/home/ram/work/5.0.b10539
2005-06-06 11:30:15 +05: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
tomas@poseidon.ndb.mysql.com
f6d51a44f4 Merge 2005-06-04 19:26:35 +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
bar@mysql.com
618934fe5f Merge 2005-06-03 09:44:13 +05:00
bar@mysql.com
1002a9416b ctype_utf8.result, ctype_utf8.test:
adding test
field.cc:
  bug#10714 Inserting double value into utf8 column crashes server:
  sprintf was executed with too big length, which caused
  crash on some Windows platforms.
2005-06-03 09:37:53 +05:00
tomas@poseidon.ndb.mysql.com
bef102ec90 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1
2005-06-02 09:50:47 +02: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
tomas@poseidon.ndb.mysql.com
5088b28d09 Merge 2005-05-31 14:37:47 +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
jimw@mysql.com
ef9ef1f958 Fix partial keys when converting VARCHAR to TEXT. (Bug #10543) 2005-05-25 18:11:47 -07:00
ndbdev@dl145c.mysql.com
4b47828478 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145c.mysql.com:/home/ndbdev/tomas/mysql-5.1
2005-05-19 18:37:33 +02:00
ramil@mysql.com
44a2007111 a fix (bug #10539: When inserting out of range value in BIT, different engines behaves differently). 2005-05-18 17:30:11 +05:00
tulin@dl145c.mysql.com
23f79bd1f2 merge 2005-05-17 10:17:53 +02:00
ramil@mysql.com
524b988260 a fix (bug #6961: Traditional: assignment of string to numeric column should fail). 2005-05-13 13:22:27 +05:00
jani@a193-229-222-105.elisa-laajakaista.fi
187ee4712b Fixed bug 10465. 2005-05-12 17:37:38 +03:00
mronstrom@mysql.com
c33a0673a6 Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.1
into mysql.com:/Users/mikron/wl1682
2005-05-12 12:01:01 +02:00
mronstrom@mysql.com
c18a302577 Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.1
into mysql.com:/Users/mikron/wl1682
2005-05-07 11:23:09 +02:00
holyfoot@hf-ibm.(none)
2c8e9df232 A lot of fixes to Precision math
Mostly about precision/decimals of the results of the operations
2005-05-05 20:06:49 +05:00
hf@deer.(none)
054463f975 Fix for #6553 and #8776 (no errors on bad spatial data) 2005-04-29 20:23:02 +05:00
mronstrom@mysql.com
21347433cf WL 1682: Use bitvector instead of query_id to tell handler which fields
to read and write
Changed Server code, added new interface to handler and changed the
NDB handler, InnoDB handler and Federated handler that previously used
query_id
Bug#10202 fix (one-liner fix for memory leak)
2005-04-28 14:45:27 +02:00
ramil@mysql.com
b2dbaea394 Bit type: fix for create_field::create_field(). 2005-04-14 14:32:25 +05:00
ramil@mysql.com
eae4d9c073 Bit type: code cleanup. 2005-04-12 19:36:21 +05:00
ramil@mysql.com
3b1c3d8c68 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/usr/home/ram/work/5.0.bit_class
2005-04-12 12:30:09 +05:00
ramil@mysql.com
c4376b2bc6 Bit type support for non-MyISAM tables. 2005-04-12 12:27:43 +05:00
jimw@mysql.com
9b4f106045 Fix warning and error when compiling on Windows. 2005-04-09 03:05:47 +02:00
serg@serg.mylan
e1e5b97dea manually merged
Gluh's SESSION/GLOBAL for @variables fix in sql_yacc.yy and
Bar's well_formed_len() changes in ndb code
did not make it and should be re-applied manually
2005-04-06 21:19:20 +02:00
bar@mysql.com
1c46a02069 Minor clean-ups for the previous commit. 2005-04-06 15:12:44 +05:00
bar@mysql.com
0134a2b286 Adding a new parameter for well_formed_length to
return error. We'll use it for better warnign reporting.
2005-04-06 11:53:15 +05:00
serg@serg.mylan
c796ea598c Merge 2005-04-05 13:23:11 +02:00
serg@serg.mylan
52770e8682 XID SQL syntax
minor cleanups
XA tests
2005-04-04 00:50:05 +02:00
monty@mysql.com
9616c9a80d Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
2005-04-01 15:06:35 +03: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
bell@sanja.is.com.ua
45a79c9056 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-union_merge-5.0
2005-04-01 02:15:40 +03:00
bell@sanja.is.com.ua
1029e533df postmerge 4.1->5.0 fixes 2005-04-01 02:14:30 +03:00
bell@sanja.is.com.ua
05d4ed14e4 merge 4.1->5.0 2005-03-31 10:39:48 +03:00
monty@mysql.com
b43b7dc128 Enabled more tests of STR_TO_DATE()
Fixed that datetime gives warning for zero dates in traditional mode
2005-03-30 23:41:42 +03:00
monty@mysql.com
332b7ed4a1 Give warnings if wrong date/time/datetime argument for STR_TO_DATE
Small fixes while doing review of new pushed code
More test cases for decimal
2005-03-30 16:00:31 +03:00
serg@serg.mylan
d6bedfa8e0 merged 2005-03-23 09:42:24 +01:00
bell@sanja.is.com.ua
4554b1f263 fixed union types merging and table related metadata (BUG#8824) 2005-03-23 08:36:48 +02:00
serg@mysql.com
f7cbe9a2cc BUG#9339 - Updating a column does not work if the table has a UTF-8 VARCHAR primary key
fixed my_charpos() call in Field_varstring::get_key_image
2005-03-22 20:13:49 +01:00
serg@serg.mylan
f4d4df2ca4 Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
2005-03-21 13:43:25 +01:00
jimw@mysql.com
ee2b4ec959 Eliminate warnings noticed by VC7. This includes fixing my_mmap() on
Windows to call CreateFileMapping() with correct arguments, and
propogating the introduction of query_id_t to everywhere query ids are
passed around. (Bug #8826)
2005-03-18 16:12:25 -08:00
serg@serg.mylan
376a4ee03b Field::quote_data():
don't call escape_string_for_mysql() unnecesary
  don't overwrite local buffer
escape_string_for_mysql():
  take a length of the destination buffer as an argument
2005-03-17 12:27:45 +01: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
konstantin@mysql.com
22915b3ad5 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/media/sda1/mysql/mysql-5.0-926
2005-03-13 23:53:30 +03:00
konstantin@mysql.com
983c75f05e WL#926 "SUM(DISTINCT) and AVG(DISTINCT)": improvement of SUM(DISTINCT) and
implementation of AVG(DISTINCT) which utilizes the approach with Fields.
The patch implemented in October is portede to the up-to-date tree 
containing DECIMAL type.
Tests for AVG(DISTINCT) (although there is not much to test provided
that SUM(DISTINCT) works), cleanups for COUNT(DISTINCT) and GROUP_CONCAT()
will follow in another changeset.
2005-03-13 23:50:43 +03:00
ramil@mysql.com
ec06f3e762 a fix (bug #9029 Traditional: Wrong SQLSTATE returned for string truncation). 2005-03-10 17:08:45 +04:00
hf@deer.(none)
fbbb58c6ae Fix for bug #8935 CAST(time AS DECIMAL) crashes 2005-03-07 20:53:51 +04:00
monty@mysql.com
0a6b7aedb2 Remove compiler warnings and remove not used variables
(Found during build process)
2005-02-25 16:53:22 +02:00
monty@mysql.com
e2ea35ec67 Merge with 4.1 2005-02-22 15:47:00 +02:00
monty@mysql.com
22a76c1dfb Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1
2005-02-22 12:51:54 +02:00
monty@mysql.com
e2dc9b4099 Backport my_strntod() from 5.0
Change string->float conversion to delay division as long as possible.
This gives us more exact integer->float conversion for numbers of type '123.45E+02' (Bug #7740)
2005-02-22 12:51:23 +02:00
bar@mysql.com
c709ad87db field.cc:
optimize test_if_minus() when not UCS2 support is compiled.
2005-02-22 08:35:15 +04:00
monty@mysql.com
f3b00a0413 use dbug_print_decimal instead of DBUG_EXECUTE
Portability fix
Note: rpl_trunc_binlog fails, but Sergei has promised to fix it, so I will ignore it for now
2005-02-20 00:24:30 +02:00
georg@beethoven.site
26e3685b02 Changes and fixes for windows compilation 2005-02-18 15:17:17 +01:00
monty@mysql.com
71e4859389 After merge fixes 2005-02-15 19:25:42 +02:00
monty@mysql.com
38d1a42481 Merge with 4.1 2005-02-15 17:12:13 +02:00
monty@mysql.com
410e51c854 Fixed failing test cases 'row.test' when running with --ps-protocol
Simple optimzations done while reviewing code
2005-02-15 16:45:00 +02:00
bar@mysql.com
9ba7392306 Bug#8235 Connection collation change & table create with default result in crash 2005-02-12 16:27:22 +04:00
monty@mysql.com
ccb2f3381b Things missing in last changset
After merge fixes
Don't give duplicate warnings for some ::store() functions
2005-02-10 15:41:51 +02:00
hf@deer.(none)
b94a482ee9 Precision Math implementation 2005-02-09 02:50:45 +04:00
jimw@mysql.com
8c8553af81 Merge changes 2005-02-04 11:59:02 -08:00
jimw@mysql.com
b509f2b373 Merge mysql.com:/home/jimw/my/mysql-4.1-6067
into mysql.com:/home/jimw/my/mysql-4.1-clean
2005-02-04 10:39:13 -08:00
gluh@gluh.mysql.r18.ru
34915f7a91 A fix: bug#6931: Date Type column problem when using UNION-Table
bug#7833:  Wrong datatype of aggregate column is returned
2005-02-04 15:31:36 +03:00
jimw@mysql.com
891e8d076c Fix value of YEAR field when set from a non-numeric string. (Bug #6067) 2005-02-01 15:08:31 -08:00
patg@patrick-galbraiths-computer.local
d6727ff70f Merge pgalbraith@bk-internal.mysql.com:/home/bk/mysql-5.0
into patrick-galbraiths-computer.local:/Users/patg/mysql-5.0
2005-01-24 11:31:21 -08:00
patg@pc248.lfp.kcls.org
1da60b9f45 -Added quote_data and needs_quotes (moved from federated handler.
-New tests and results

logging_ok:
  Logging to logging@openlogging.org accepted
ha_federated.h:
  removed quote_data and type_quote (now in the Field class)
ha_federated.cc:
  moved quote_data and type_quote to field class
field.h:
  new methods quote_data and needs_quotes declared
field.cc:
  new field class methods quote_data and needs_quotes (per Monty's request)
federated.test:
  more tests, joins, index tests
have_federated_db.require:
  new name of federated system var
federated.result:
  new test results for federated handler
have_federated_db.inc:
  changed name of variable in test due to change in vars
sql_analyse.cc:
  over-ridden append_escaped to take (String *, char *, uint) per requirements of 'create_where_from_key' method in federated handler.
mysql_priv.h:
  define over-ridden append_escaped to take arguments from 'create_where_from_key' method in federated handler 
ha_federated.cc:
  implemented "create_where_from_key" to deal properly with two-byte prefix and multi keys. Initial testing shows it works, but I still need to move quoting to field class and also look at changes per Segei's suggestions.
2005-01-20 18:36:40 -08:00
ram@gw.mysql.r18.ru
92545cb3a9 ER_WARN_DATA_TRUNCATED replaced with WARN_DATA_TRUNCATED. 2005-01-19 16:24:06 +04:00
ram@gw.mysql.r18.ru
f131e5a925 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into gw.mysql.r18.ru:/usr/home/ram/work/5.0.b6999
2005-01-19 12:05:59 +04:00
ram@gw.mysql.r18.ru
c24c023e8c A fix (bug #6999: Traditional: Wrong SQLSTATE returned for string truncation). 2005-01-19 12:04:35 +04:00
monty@mysql.com
8d616390e9 After merge fixes
Fix for BIT(X) field as string
2005-01-15 17:38:43 +02:00
monty@mysql.com
0a1076a25f Merge with 4.1 2005-01-15 14:09:45 +02:00
monty@mysql.com
a37e91e435 Changed interface for my_strntod() to make it more general and more portable 2005-01-15 12:28:38 +02:00
jimw@mysql.com
28ee2a67b3 Merge jwinstead2@wwwtst1.mysql.com:mysql-4.1-7774
into mysql.com:/home/jimw/my/mysql-5.0-clean
2005-01-13 09:09:10 -08:00
jimw@mysql.com
7639e5afaf Merge jwinstead2@wwwtst1.mysql.com:mysql-4.1-7774
into mysql.com:/home/jimw/my/mysql-4.1-clean
2005-01-13 09:07:21 -08:00
konstantin@mysql.com
a676498977 manual merge 2005-01-13 17:31:49 +03:00
bar@mysql.com
e3d6e6736b bug#7284: strnxfrm returns different results for equal strings 2005-01-13 18:12:04 +04:00
jimw@mysql.com
0a3fba7f18 Small fix for Field_str::store() to avoid trying to read past beginning
of log_10 array.
2005-01-13 00:52:19 +01:00
jimw@mysql.com
51781b0bfc Fix conversion of floating point values to character fields when the
absolute value of the float is less than 1, and also fix calculation of
length for negative values. (Bug #7774)
2005-01-13 00:41:45 +01:00
bar@mysql.com
691b3283d2 If VARCHAR strips only trailing spaces, then produce
a note, not a warning or error.
2005-01-11 16:49:45 +04:00
kent@mysql.com
feee6ee30b field.h, field.cc:
Did some more split TABLE to TABLE and TABLE_SHARE
2005-01-11 00:17:21 +01:00
jimw@mysql.com
6db6171494 Merge mysql.com:/home/jwinstead2/mysql-4.1-clean
into mysql.com:/home/jwinstead2/mysql-5.0-clean
2005-01-07 19:03:35 +01:00
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