Commit graph

1091 commits

Author SHA1 Message Date
gkodinov/kgeorge@magare.gmz
0f3db011d5 Merge magare.gmz:/home/kgeorge/mysql/work/B30355-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B30355-5.1-opt
2007-11-27 17:19:51 +02:00
gkodinov/kgeorge@magare.gmz
8c3d5135ba Bug #30355: Incorrect ordering of UDF results
There's currently no way of knowing the determinicity of an UDF.
And the optimizer and the sequence() UDFs were making wrong
assumptions about what the is_const member means.
Plus there was no implementation of update_system_tables()
causing the optimizer to overwrite the information returned by
the <udf>_init function.

Fixed by equating the assumptions about the semantics of 
is_const and providing a implementation of update_used_tables().
Added a TODO item for the UDF API change needed to make a better 
implementation.
2007-11-27 17:16:52 +02:00
gluh@eagle.(none)
58336411c9 Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-11-14 17:30:16 +04:00
gluh@eagle.(none)
246c6c35a9 Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-11-14 17:26:22 +04:00
kostja@bodhi.(none)
26326ed0b7 A fix for Bug#32007 select udf_function() doesn't return an error if error
during udf initialization. The bug is spotted while working on Bug 12713.

If a user-defined function was used in a SELECT statement, and an
error would occur during UDF initialization, this error would not terminate
execution of the SELECT, but rather would be converted to a warning.

The fix is to use a stack buffer to store the message from udf_init instead
of private my_error() buffer.
2007-11-01 00:31:57 +03:00
istruewing@stella.local
cd49a77add Merge stella.local:/home2/mydev/mysql-5.0-amain
into  stella.local:/home2/mydev/mysql-5.0-axmrg
2007-10-31 12:31:36 +01:00
kostja@bodhi.(none)
e4b353c40c Use an inline getter method (thd->is_error()) to query if there is an error
in THD.
In future the error may be stored elsewhere (not in net.report_error) and 
it's important to start using an opaque getter to simplify merges.
2007-10-30 20:08:16 +03:00
gluh@eagle.(none)
61bdbf8a90 Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-10-29 15:40:41 +04:00
gluh@mysql.com/eagle.(none)
6b92ec4acb Bug#30889: filesort and order by with float/numeric crashes server
There are two problems with ROUND(X, D) on an exact numeric 
(DECIMAL, NUMERIC type) field of a table:
1) The implementation of the ROUND function would change the number of decimal
places regardless of the value decided upon in fix_length_and_dec. When the
number of decimal places is not constant, this would cause an inconsistent
state where the number of digits was less than the number of decimal places,
which crashes filesort.

Fixed by not allowing the ROUND operation to add any more decimal places than
was decided in fix_length_and_dec.

2) fix_length_and_dec would allow the number of decimals to be greater than
the maximium configured value for constant values of D. This led to the same 
crash as in (1).

Fixed by not allowing the above in fix_length_and_dec.
2007-10-29 15:39:56 +04:00
svoj@june.mysql.com
9f1d9beffa Merge mysql.com:/home/svoj/devel/mysql/BUG31159/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG31159/mysql-5.0-engines
2007-10-24 16:39:13 +05:00
svoj@mysql.com/june.mysql.com
5d1ccce58a BUG#31159 - fulltext search on ucs2 column crashes server
ucs2 doesn't provide required by fulltext ctype array. Crash
happens because fulltext attempts to use unitialized ctype
array.

Fixed by converting ucs2 fields to compatible utf8 analogue.
2007-10-24 16:09:30 +05:00
gluh@eagle.(none)
17acda6ca8 Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-10-23 19:08:21 +05:00
gluh@eagle.(none)
237383f0fe Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-10-23 18:51:43 +05:00
gkodinov/kgeorge@magare.gmz
fb640797b8 Bug #31157: crash when select+order by the avg of some field within the group by
The uncacheable flag should be set at fix_fields() stage.
Fixed by moving the flag setting to match the one in 5.1
2007-10-19 15:43:19 +03:00
dkatz@damien-katzs-computer.local
86082dfcef Bug #29804 UDF parameters don't contain correct string length
Previously, UDF *_init functions were passed constant strings with erroneous lengths. The length came from the containing variable's size, not the length of the value itself.
    
Now the *_init functions get the constant as a null terminated string with the correct length supplied too.
2007-10-17 17:54:11 -04:00
anozdrin/alik@station.
50c8101ad8 Merge station.:/mnt/raid/alik/MySQL/devel/5.0-rt
into  station.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged
2007-10-10 13:35:40 +04:00
anozdrin/alik@station.
707f067446 Fix for BUG#31035: select from function, group by result crasher.
This actually, fix for the patch for bug-27354. The problem with
the patch was that Item_func_sp::used_tables() was updated, but
Item_func_sp::const_item() was not. So, for Item_func_sp, we had
the following inconsistency:
  - used_tables() returned RAND_TABLE, which means that the item
    can produce "random" results;
  - but const_item() returned TRUE, which means that the item is
    a constant one.

The fix is to change Item_func_sp::const_item() behaviour: it must
return TRUE (an item is a constant one) only if a stored function
is deterministic and each of its arguments (if any) is a constant
item.
2007-10-04 17:19:14 +04:00
gkodinov/kgeorge@magare.gmz
5ac2fd0b1b Merge macbook:mysql/work/B30587-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B30587-5.1-opt
2007-09-28 17:03:14 +03:00
gkodinov/kgeorge@magare.gmz
fbdf00f085 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B30587-5.0-opt
2007-09-28 16:57:36 +03:00
gkodinov/kgeorge@macbook.gmz
aa2d545de2 Bug #30587: mysql crashes when trying to group by TIME div NUMBER
When calculating the result length of an integer DIV function 
the number of decimals was used without checking the result type
first. Thus an uninitialized number of decimals was used for some 
types. This caused an excessive amount of memory to be allocated 
for the field's buffer and crashed the server.

 
Fixed by using the number of decimals only for data types that 
can have decimals and thus have valid decimals number.
2007-09-28 16:46:05 +03:00
evgen@sunlight.local
4fd6de8b1a Merge sunlight.local:/local_work/27216-bug-5.0-opt-mysql
into  sunlight.local:/local_work/merge-5.1-opt-mysql
2007-09-24 17:23:40 +04:00
evgen@sunlight.local
36bf417b40 Bug#27216: functions with parameters of different date types may return wrong
type of the result.

There are several functions that accept parameters of different types.
The result field type of such functions was determined based on
the aggregated result type of its arguments. As the DATE and the DATETIME
types are represented by the STRING type, the result field type
of the affected functions was always STRING for DATE/DATETIME arguments.
The affected functions are COALESCE, IF, IFNULL, CASE, LEAST/GREATEST, CASE.

Now the affected functions aggregate the field types of their arguments rather
than their result types and return the result of aggregation as their result
field type.
The cached_field_type member variable is added to the number of classes to
hold the aggregated result field type.
The str_to_date() function's result field type now defaults to the
MYSQL_TYPE_DATETIME.
The agg_field_type() function is added. It aggregates field types with help
of the Field::field_type_merge() function.
The create_table_from_items() function now uses the 
item->tmp_table_field_from_field_type() function to get the proper field
when the item is a function with a STRING result type.
2007-09-22 11:49:27 +04:00
joerg@trift2.
20ce606797 Merge trift2.:/MySQL/M51/target-5.1.22
into  trift2.:/MySQL/M51/push-5.1

Includes manual merges.
2007-08-22 16:08:55 +02:00
jani@hynda.mysql.fi
2fd7a743e4 Merge hynda.mysql.fi:/home/my/mysql-5.1-main
into  hynda.mysql.fi:/home/my/mysql-5.1-marvel
2007-08-21 19:03:28 +03:00
monty@narttu.mysql.fi
9d609a59fd Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2007-08-14 00:22:34 +03:00
monty@mysql.com/nosik.monty.fi
e53a73e26c Fixed a lot of compiler warnings and errors detected by Forte C++ on Solaris
Faster thr_alarm()
Added 'Opened_files' status variable to track calls to my_open()
Don't give warnings when running mysql_install_db
Added option --source-install to mysql_install_db

I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems
index_read()      -> index_read_map()
index_read_idx()  -> index_read_idx_map()
index_read_last() -> index_read_last_map()
2007-08-13 16:11:25 +03:00
tsmith@ramayana.hindu.god
2073c488af Merge ramayana.hindu.god:/home/tsmith/m/bk/51
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/51
2007-08-06 16:34:30 -06:00
dkatz@damien-katzs-computer.local
a933f28a93 Bug #29804 UDF parameters don't contain correct string length
Previously, UDF *_init functions were passed constant strings with erroneous lengths.
The length came from the containing variable's size, not the length of the value itself.

Now the *_init functions get the constant as a null terminated string with the correct
length supplied.
2007-08-05 21:37:55 -04:00
mkindahl@dl145h.mysql.com
ea9848094a Merge mkindahl@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.0-2team
2007-08-03 18:59:16 +02:00
bar@bar.myoffice.izhnet.ru
fb8dff9721 Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b28875
into  mysql.com:/home/bar/mysql-work/mysql-5.1.b28875
2007-08-03 17:16:02 +05:00
bar@bar.myoffice.izhnet.ru
c01ce7b1e3 Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b28875
into  mysql.com:/home/bar/mysql-work/mysql-5.0-rpl
2007-08-03 15:30:31 +05:00
bar@mysql.com/bar.myoffice.izhnet.ru
4eebfd09c2 Bug#28875 Conversion between ASCII and LATIN1 charsets does not function
(Regression, caused by a patch for the bug 22646).
Problem: when result type of date_format() was changed from
binary string to character string, mixing date_format()
with a ascii column in CONCAT() stopped to work.
Fix:
- adding "repertoire" flag into DTCollation class,
to mark items which can return only pure ASCII strings.
- allow character set conversion from pure ASCII to other character sets.
2007-08-03 15:25:23 +05:00
ramil/ram@ramil.myoffice.izhnet.ru
54ddf93240 Merge mysql.com:/home/ram/work/b30200/b30200.5.0
into  mysql.com:/home/ram/work/b30200/b30200.5.1
2007-08-02 15:26:52 +05:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
dc84a5fd52 Fix for bug #30200: mysqlbinlog.test: connection_id() not restored under ps-protocol
Problem: thd->thread_specific_used flag is not set executing a statement
containig connection_id() function using PS protocol, that leads to 
improper binlog event creation.

Fix: set the flag in the Item_func_connection_id::fix_fields().
2007-08-02 14:51:03 +05:00
tsmith@ramayana.hindu.god
8575227571 Merge ramayana.hindu.god:/home/tsmith/m/bk/50
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50
2007-08-01 18:14:50 -06:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
c5209fcbd0 Merge mysql.com:/home/ram/work/b29928.new/b29928.new.5.0
into  mysql.com:/home/ram/work/b29928.new/b29928.new.5.1
2007-08-01 15:31:20 +05:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
7fb417d0ba Fix for bug #29928: INSERT ... VALUES(connection_id(), ...) incorrect
restores from mysqlbinlog out

Problem: using "mysqlbinlog | mysql" for recoveries the connection_id() 
result may differ from what was used when issuing the statement.

Fix: if there is a connection_id() in a statement, write to binlog
SET pseudo_thread_id= XXX; before it and use the value later on.
2007-08-01 15:27:03 +05:00
gshchepa/uchum@gleb.loc
f7010479fb Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.1-opt
2007-07-22 00:53:01 +05:00
gshchepa/uchum@gleb.loc
73b2848f4f Fixed bug #29338.
Optimization of queries with DETERMINISTIC functions in the
WHERE clause was not effective: sequential scan was always
used.
Now a SF with the DETERMINISTIC flags is treated as constant
when it's arguments are constants (or a SF doesn't has arguments).
2007-07-19 18:39:01 +05:00
gshchepa/uchum@gleb.loc
6fc62a8e4a Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.1-opt
2007-06-16 22:40:25 +05:00
gshchepa/uchum@gleb.loc
3d4e75d583 Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.0-opt-28625
2007-06-16 13:49:26 +05:00
gshchepa/uchum@gleb.loc
8f09a374ea Fixed bug #28625:
DECIMAL column was used instead of BIGINT for the minimal possible
BIGINT (-9223372036854775808).

The Item_func_neg::fix_length_and_dec has been adjusted to
to inherit the type of the argument in the case when it's an 
Item_int object whose value is equal to LONGLONG_MIN.
2007-06-16 13:05:07 +05:00
igor@olga.mysql.com
0f0d4720b8 Fixed bug #27932: the function LOCATE returned NULL if any
of its arguments was evaluated to NULL, while the predicate
LOCATE(str,NULL) IS NULL erroneously was evaluated to FALSE.

This happened because the Item_func_locate::fix_length_and_dec
method by mistake set the value of the maybe_null flag for 
the function item to 0. In consequence of this the function 
was considered as the one that could not ever return NULL.
2007-06-14 18:55:07 -07:00
holyfoot/hf@hfmain.(none)
76e0a0768a Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt
into  mysql.com:/d2/hf/mrg/mysql-5.1-opt
2007-06-14 16:35:20 +05:00
igor@olga.mysql.com
20ad515003 Fixed bug #28980: the result of ROUND(<decimal expr>,<int column>)
was erroneously converted to double, while the result of
ROUND(<decimal expr>, <int literal>) was preserved as decimal.
As a result of such a conversion the value of ROUND(D,A) could
differ from the value of ROUND(D,val(A)) if D was a decimal expression.

Now the result of the ROUND function is never converted to 
double if the first argument is decimal.
2007-06-13 09:32:36 -07:00
joerg@trift2.
018a5d403b sql/item_func.cc
Improved check for thread identity in the "embedded" case,
    provided by Monty.
    
    This finishes the fixes for bug#27078.
2007-06-13 13:33:00 +02:00
gkodinov/kgeorge@magare.gmz
eb1fb60975 5.0-opt -> 5.1-opt merge 2007-06-12 18:41:56 +03:00
gkodinov/kgeorge@magare.gmz
fbefe9d552 Merge bk-internal:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/merge-5.1-opt
2007-06-12 16:34:54 +03:00
gkodinov/kgeorge@magare.gmz
5ea9964b9f Bug #28992: trigger fails in pushbuild
- fixed wrong test case for bug 20903
 - closed the dangling connections in trigger.test
 - GET_LOCK() and RELEASE_LOCK() now produce more detailed log
 - fixed an omission in GET_LOCK() : assign the thread_id when
    acquiring the lock.
2007-06-12 14:35:36 +03:00
igor@olga.mysql.com
ca49b83d5a Merge olga.mysql.com:/home/igor/mysql-5.1
into  olga.mysql.com:/home/igor/mysql-5.1-opt-merge
2007-06-03 22:52:02 -07:00