Commit graph

128 commits

Author SHA1 Message Date
kroki@mysql.com
dbdecef495 Bug#20570: CURRENT_USER() in a VIEW with SQL SECURITY DEFINER returns
invoker name

The bug was fixed similar to how context switch is handled in
Item_func_sp::execute_impl(): we store pointer to current
Name_resolution_context in Item_func_current_user class, and use
its Security_context in Item_func_current_user::fix_fields().
2006-07-02 14:35:45 +04:00
kroki@mysql.com
c8e22ff70b Bug#16461: connection_id() does not work properly inside trigger
CONNECTION_ID() was implemented as a constant Item, i.e. an instance of
Item_static_int_func class holding value computed at creation time.
Since Items are created on parsing, and trigger statements are parsed
on table open, the first connection to open a particular table would
effectively set its own CONNECTION_ID() inside trigger statements for
that table.

Re-implement CONNECTION_ID() as a class derived from Item_int_func, and
compute connection_id on every call to fix_fields().
2006-04-12 19:31:00 +04:00
aivanov@mysql.com
53e90b53bc Fixed BUG#12963, BUG#13000: wrong VIEW creation with DAYNAME(),
DAYOFWEEK(), and WEEKDAY().
2005-09-14 20:25:00 +04:00
sergefp@mysql.com
95c3afc5d9 Fix for BUG#12335 (SP replication) : New binlogging strategy for stored PROCEDUREs/FUNCTIONs.
"Interleaved SPs execution is now binlogged properly, "SELECT spfunc()" is binlogged too.
The known remaining issue is binlogging/replication of "a routine is deleted while it is executed" scenario.
2005-08-25 17:34:34 +04:00
jimw@mysql.com
a3c893e0b8 Fix cases where SLEEP() calls would get optimized away or cached. (Bug #12689) 2005-08-19 15:51:40 -07:00
jimw@mysql.com
898aae5e0f Add SLEEP(seconds) function, which always returns 0 after the given
number of seconds (which can include microseconds). (Bug #6760)
2005-08-11 18:58:22 -07:00
bell@sanja.is.com.ua
6114bee47c stop evaluation constant functions in WHERE (BUG#4663)
correct value of CURRENT_USER() in SP with "security definer" (BUG#7291)
2005-07-16 00:01:44 +03:00
reggie@mdk10.(none)
4bb4a285ab Merge mdk10.(none):/home/reggie/bk/mysql-4.1
into mdk10.(none):/home/reggie/bk/mysql-5.0
2005-04-11 09:29:49 -05:00
dlenev@brandersnatch.localdomain
831a612483 Merging fix for bug #9796 "Query Cache caches queries with CURRENT_USER()
function" into 4.1 tree.
2005-04-11 10:44:48 +04:00
dlenev@mysql.com
b0dd388190 Merge mysql.com:/home/dlenev/src/mysql-4.0-bg9796
into mysql.com:/home/dlenev/src/mysql-4.1-merges
2005-04-11 09:53:54 +04:00
dlenev@mysql.com
06e3647274 Fix for bug #9796 "Query Cache caches queries with CURRENT_USER()
function".

We should not cache queries using CURRENT_USER() function as we do it
for some other functions, e.g. USER() function.
2005-04-11 00:30:23 +04:00
bar@mysql.com
d50d213162 Merge 2005-03-05 18:20:35 +04:00
bar@mysql.com
7e8e033290 type_blob.result, func_system.result, func_str.result, ctype_collate.result:
fixing test results accordingly.
func_system.test:
  New test that illegal mix of collations does not happen anymore.
item_strfunc.h:
    safe_charset_converter() was added for system constants.
item_strfunc.cc:
  safe_charset_converter() was added for system constants.
item_func.cc, item.h, item.cc:
  Bug#8291: Illegal collation mix with USER() function.
  After discussion with PeterG and Serge, a new coercibility
  level for "system constants" was introduced, between
  COERRIBLE and IMPLICIT. Thus:
  SELECT col1 = USER() FROM t1; - is done according to col1 collation.
  SELECT 'string' = USER(); - is done according to USER() collation.
  At the same time, "nagg" and "strong" members were removed as unused.
item_create.cc:
  Version is a system constant too.
2005-03-04 14:20:49 +04:00
hf@deer.(none)
b94a482ee9 Precision Math implementation 2005-02-09 02:50:45 +04:00
serg@serg.mylan
d8f35cec21 Merge serg.mylan:/usr/home/serg/Abk/mysql-4.1
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
2005-01-26 09:05:58 +01:00
serg@serg.mylan
7084b494c4 innobase/include/univ.i
remove a change that broke the test
2005-01-26 08:57:43 +01:00
serg@serg.mylan
c76405a7ee merged 2005-01-24 19:41:42 +01:00
serg@serg.mylan
67ba2e367a fixes/cleanups according to Coverity report 2005-01-24 15:48:25 +01:00
monty@mysql.com
071001950e Merge with 4.1 to get in latest bug fixes 2004-11-04 15:06:24 +02:00
bar@mysql.com
7577c8bfc9 A fix according to Monty's request:
"uint *errors" is now a non-optional parameter in String:copy()
and copy_and_convert().
2004-10-29 17:00:39 +05:00
monty@mysql.com
31122efde7 Merge with 4.1
(Includes merge of arena code in 4.1 and 5.0)
2004-09-06 15:14:10 +03:00
bell@sanja.is.com.ua
5abb148d01 items for functions which is converted to constants internally to support its correct printing added (BUG#4663) 2004-08-24 18:46:27 +03:00
dlenev@brandersnatch.localdomain
f49d4f5350 Fix for bug #4508 "CONVERT_TZ() function with new time zone as param crashes server".
Instead of trying to open time zone tables during calculation of CONVERT_TZ() function
or setting of @@time_zone variable we should open and lock them with the rest of 
statement's table (so we should add them to global table list) and after that use such 
pre-opened tables for loading info about time zones.
2004-08-10 12:42:31 +04:00
monty@mysql.com
1e31199995 Merge with 4.1.3-beta 2004-07-07 11:29:39 +03:00
pem@mysql.comhem.se
34ddd9c515 Fixed BUG#3486: FOUND_ROWS() fails inside stored procedure [and prepared statement]. 2004-06-22 19:38:07 +02:00
dlenev@brandersnatch.localdomain
09ba29e539 WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
  
WL#1266 "CONVERT_TZ() - basic time with time zone conversion 
function".
  
Fixed problems described in Bug #2336 (Different number of warnings 
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated 
at Field object level not in conversion functions).
  
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
2004-06-18 10:11:31 +04:00
bar@mysql.com
c64d93b274 Allocate memory when a character set is requested:
- For simple character sets: from_uni convertion table.
- For UCA: alternative weight arrays.
Use mbminlen instead of MY_CS_NONTEXT
2004-06-11 16:29:16 +05:00
pem@mysql.com
dfd59e296e Merge 4.1 -> 5.0. 2004-04-07 19:07:44 +02:00
serg@serg.mylan
46c03de1a9 Merge bk-internal:/home/bk/mysql-4.1/
into serg.mylan:/usr/home/serg/Abk/mysql-4.1
2004-03-05 00:20:24 +01:00
serg@serg.mylan
de6d3b8dff UNHEX() function 2004-03-04 23:18:54 +01:00
monty@mashka.mysql.fi
93dd971bed Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mashka.mysql.fi:/home/my/mysql-4.1
2004-03-04 10:07:32 +02:00
monty@mashka.mysql.fi
afd8f38f4e Optimized GIS functions 2004-03-04 08:50:37 +02:00
serg@serg.mylan
ed2e1aa14d my_gethwaddr() for linux/freebsd
UUID() function
2004-02-27 20:30:08 +01:00
pem@mysql.com
c8585f3283 Merge 4.1 into 5.0. 2004-02-10 18:44:02 +01:00
hf@deer.(none)
6dcda5153b SCRUM:
WL#1163 (Making spatial code optional)
Pack of changes to do in sql/ code.
2004-01-15 21:06:22 +04:00
sergefp@mysql.com
23b25675f2 Merge mysql.com:/home/psergey/mysql-5.0-latest-pull
into mysql.com:/dbdata/psergey/mysql-5.0-imerge-unique
2003-12-20 00:54:38 +03:00
sergefp@mysql.com
a8456e6801 Numerous small fixes to index_merge read time estimates code 2003-12-20 00:53:14 +03:00
pem@mysql.com
12187684ca Merging lex-pointer change from 4.1 to 5.0. 2003-12-19 20:13:48 +01:00
konstantin@oak.local
d37da004f6 THD::lex now points to THD::main_lex like in 5.0
All tests pass (client_test included)
2003-12-19 20:52:13 +03:00
gluh@gluh.mysql.r18.ru
d9a412dcc3 post-merge fixes 2003-12-08 15:18:29 +04:00
gluh@gluh.mysql.r18.ru
ec8749249a WL#530&531: TIMESTAMPADD, TIMESTAMPDIFF functions
Syntax for TIMESTAMPADD:

TIMESTAMPADD(interval, integer_expression, datetime_expression)

interval:= FRAC_SECOND | SECOND | MINUTE | HOUR | DAY | WEEK | MONTH | 
QUARTER | YEAR

Supported SQL_TSI_  prefix  (like SQL_TSI_SECOND)

Syntax for TIMESTAMPDIFF:

TIMESTAMPDIFF(interval, datetime_expression1, datetime_expression2)

interval:= FRAC_SECOND | SECOND | MINUTE | HOUR | DAY | WEEK | MONTH | 
QUARTER | YEAR

Supported SQL_TSI_  prefix  (like SQL_TSI_SECOND)
2003-12-08 14:41:41 +04:00
pem@mysql.com
28a2c6a96b Merging 4.1->5.0. 2003-11-19 15:19:46 +01:00
bell@sanja.is.com.ua
b404412877 changed name of bit on more descriptive (after rewie change) 2003-11-18 22:04:01 +02:00
bell@sanja.is.com.ua
cb19ad9ac1 fixed using 'uncachable' tag and RAND_TABLE_BIT setting 2003-11-17 20:53:40 +02:00
gluh@gluh.mysql.r18.ru
5ade64831e WL#1253: LAST_DAY 2003-11-17 18:02:08 +04:00
monty@narttu.mysql.fi
6b79cd5c23 Merge 2003-11-03 22:48:03 +02:00
monty@narttu.mysql.fi
a444a3449f Simplified 'wrong xxx name' error messages by introducing 'general' ER_WRONG_NAME error
Cleaned up (and disabled part of) date/time/datetime format patch. One can't anymore change default read/write date/time/formats.
This is becasue the non standard datetime formats can't be compared as strings and MySQL does still a lot of datetime comparisons as strings
Changed flag argument to str_to_TIME() and get_date() from bool to uint
Removed THD from str_to_xxxx functions and Item class.
Fixed core dump when doing --print-defaults
Move some common string functions to strfunc.cc
Dates as strings are now of type my_charset_bin instead of default_charset()
Introduce IDENT_QUOTED to not have to create an extra copy of simple identifiers (all chars < 128)
Removed xxx_FORMAT_TYPE enums and replaced them with the old TIMESTAMP_xxx enums
Renamed some TIMESTAMP_xxx enums to more appropriate names
Use defines instead of integers for date/time/datetime string lengths
Added to build system and use the new my_strtoll10() function.
2003-11-03 14:01:59 +02:00
bell@sanja.is.com.ua
5ad2f38f5d amall fix 2003-10-31 11:52:01 +02:00
bell@sanja.is.com.ua
33346e26af added code covarage for functions convert(), nullif(), crc32(), is_used_lock(), char_lengtrh(), bit_xor()
added string length for more speed
made code covarage for print() method of Item
fixed printability of some items (SCRUM) (WL#1274)
2003-10-30 12:57:26 +02:00
pem@mysql.com
337238b78a Merging 4.1->5.0 2003-10-22 16:10:22 +02:00