Commit graph

89 commits

Author SHA1 Message Date
sergefp@mysql.com
e1f49888bf WL#2985 "Partition Pruning" 2005-12-22 12:29:00 +03: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
guilhem@mysql.com
1379dd180f Merge mysql.com:/home/mysql_src/mysql-4.1-gca
into  mysql.com:/home/mysql_src/mysql-5.0-release
2005-11-10 15:13:12 +01:00
guilhem@mysql.com
2df7d97281 Declaring some class members public for BUG#12377:
"Item_date_add_interval needs to have the int_type member as Public".
As explained in the bug report, this change is is to help http://search.cpan.org/~philips/DBIx-MyParse-0.20/
So please keep those members public.
2005-11-10 15:12:22 +01:00
monty@mysql.com
e5f48e13bf Reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort
Fix for bug #14536: SELECT @a,@a:=... fails with prepared statements
2005-11-01 15:54:30 +02:00
monty@mysql.com
19502e8eb5 Review of new pushed code
Removed wrong fix for bug #14009 (use of abs() on null value causes problems with filesort)
Mark that add_time(), time_diff() and str_to_date() can return null values
2005-11-01 13:00:02 +02:00
jani@ua141d10.elisa.omakaista.fi
af50eff0d2 Merge 4.1 - 5.0 2005-10-28 02:36:19 +03: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
jimw@mysql.com
9e4a9e23c6 Make SYSDATE() behave as in Oracle: always the current datetime, not the
datetime of when the current statement began. This also makes SYSDATE()
not safe in replication. (Bug #12562)
2005-08-24 15:50:58 -07:00
evgen@moonbone.local
0f9b982970 Fix bug #12298 Typo in timestampdiff() function name results in erroneous
view being created.

Item_func_timestamp_diff::func_name() were returning function name as
"timestamp_diff" thus when view was executed function parameters wasn't 
properly recognized and error was raised.
2005-08-12 22:42:50 +04:00
sergefp@mysql.com
0dba629a5e Manual merge 2005-08-07 21:30:46 +00:00
evgen@moonbone.local
697836c77f Fix bug#12266 GROUP BY DATE(LEFT(column,8)) returns result strings with reduced
length.

When temporary field created for DATE(LEFT(column,8)) expression, max_length
value is taken from Item_date_typecast, and it is getting it from underlaid
Item_func_left and it's max_length is 8 in given expression. And all this
results in stripping last 2 digits.

To Item_date_typecast class added its own fix_length_and_dec() function 
that sets max_length value to 10, which is proper for DATE field.
2005-08-04 18:05:33 +04:00
bell@sanja.is.com.ua
d3905f3d0e Name resolution context added (BUG#6443) 2005-07-01 07:05:42 +03:00
bell@sanja.is.com.ua
02cac1c5e6 fixed time_format printing (BUG#7521) 2005-06-20 14:56:17 +03:00
bell@sanja.is.com.ua
a11677026f fixed printing of sum(distinct ) & avg(distinct ) & cast(... as decimal) (BUG#7015, BUG#11387) 2005-06-17 17:27:47 +03:00
msvensson@neptunus.(none)
34cec09efb Merge neptunus.(none):/home/msvensson/mysql/bug10241
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
2005-05-09 11:26:48 +02:00
msvensson@neptunus.(none)
5b5565c30a BUG#10241 cygwin port: invalid pragma interface directives
- Introduce ifdefs so we can control when to use #pragma interface on cygwin
2005-05-04 15:05:56 +02:00
hf@deer.(none)
b94a482ee9 Precision Math implementation 2005-02-09 02:50:45 +04:00
dlenev@mysql.com
2276bfa374 Manual merge of fixes for bugs #7899 "CREATE TABLE .. SELECT .. and
CONVERT_TZ() function does not work well together" and bug #7705 
"CONVERT_TZ() crashes with subquery/WHERE on index column" in 5.0
tree.
2005-01-28 10:22:50 +03:00
dlenev@brandersnatch.localdomain
80282016c2 Fix for bug #7899 "CREATE TABLE .. SELECT .. and CONVERT_TZ() function
does not work well together". Now using simplier and more correct
implementation of st_lex::unlink_first_table()/link_first_table_back() 
(It also nicely handles case when global table list is created because
of implictly used time zone tables). (2nd attempt)

Fix for bug #7705 "CONVERT_TZ() crashes with subquery/WHERE on index
column". Implemented new approach for caching objects for constant
time zone arguments. Now instead of determining whenever these arguments
are constants and performing time zone lookup at fix_fields() stage, we
do it on first get_date() invocation.

Cleanup of global @@time_zone variable handling.
2005-01-26 22:25:02 +03:00
konstantin@mysql.com
e5f4c7a0bd Rename: Item::val -> Item::val_real(). 2004-11-11 21:39:35 +03:00
monty@mysql.com
afbe601302 merge with 4.1 2004-10-29 19:26:52 +03:00
bar@mysql.com
2c86049dec Bug #5228 ORDER BY CAST(enumcol) sorts incorrectly under certain conditions 2004-09-07 15:42:19 +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
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
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
pem@mysql.com
dfd59e296e Merge 4.1 -> 5.0. 2004-04-07 19:07:44 +02:00
dlenev@jabberwock.localdomain
f6bff2e6c6 WL#1266 "Separate auto-set logic from TIMESTAMP type."
Final version of patch.

Adds support for specifying of DEFAULT NOW() and/or ON UPDATE NOW()
clauses for TIMESTAMP field definition.
Current implementation allows only one such field per table and
uses several unireg types for storing info about this properties of
field. It should be replaced with better implementation when new
.frm format is introduced.
2004-04-02 10:12:53 +04:00
bell@sanja.is.com.ua
2b45b53066 DBUG_ASSERT(fixed == 1); added to val*
small optimisation in signed_literal
2004-03-18 15:14:36 +02:00
gluh@gluh.mysql.r18.ru
df0ede69fc Task #835: additional changes fot str_to_date 2004-03-15 18:28:21 +04:00
jani@ua72d24.elisa.omakaista.fi
8dcb41d8d9 Fixed Bug#3115. CAST AS DATE with malformed string returns NULL but IS NULL
is false.
2004-03-09 22:03:01 +02: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
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
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
bell@sanja.is.com.ua
934fa2a104 Merge 2003-10-22 20:52:47 +03:00
gluh@gluh.mysql.r18.ru
62b0b8b800 Scrum task 835 - text-to-datetime conversion function 2003-10-20 13:24:18 +05:00
bell@laptop.sanja.is.com.ua
ddf4d1e529 fixed printability of Items (all items except subselects)
(SCRUM) (WL#1274)
2003-10-12 17:56:05 +03:00
bell@sanja.is.com.ua
334841d902 tmp_table_field() renamed to get_tmp_table_field() to avoid redifinition of tmp_table_field(TABLE *t_arg) 2003-08-29 16:24:03 +03:00
bar@bar.mysql.r18.ru
8c55440ba4 CAST(expr AS CHAR(10)) is now working 2003-08-21 14:15:25 +05:00
monty@mashka.mysql.fi
10c4acfb4f merge 2003-08-19 00:10:21 +03:00
monty@mashka.mysql.fi
2263e3e51f Merge with 4.0.14 2003-08-11 22:44:43 +03:00
dlenev@dlenev.mshome
921ac8af8b Implemented UTC_TIME, UTC_DATE and UTC_TIMESTAMP functions (WL#345) 2003-08-11 23:43:01 +04:00
bar@bar.mysql.r18.ru
a60acfcfe0 Old style charset() and set_charset() were removed. 2003-08-05 12:52:37 +05:00
gluh@gluh.mysql.r18.ru
5709ed20ab SAPDB date/time finctions 2003-07-08 15:06:05 +05:00
gluh@gluh.mysql.r18.ru
66af4b5c9a Internal commit 2003-06-23 12:56:44 +05:00
hf@deer.(none)
8fea9b451a Bugfix for #614
Item_extract needs special implementation for eq().
Item_func::eq doesn't work correctly because we have to compare 
Item_extract::int_type parameters also

We need to propagate this to 4.1
2003-06-11 20:09:37 +05:00