Commit graph

776 commits

Author SHA1 Message Date
konstantin@mysql.com
8b0adacbc6 After-merge fixes (4.1 -> 5.0). 2005-07-16 16:10:42 +04:00
konstantin@mysql.com
8e72214d74 Merge mysql.com:/opt/local/work/mysql-4.1-root
into  mysql.com:/media/sda1/mysql/mysql-5.0-merge
2005-07-16 13:45:32 +04:00
konstantin@mysql.com
e08caeeee2 A fix and a test case for Bug#9359 "Prepared statements take snapshot
of system vars at PREPARE time": implement a special Item
to handle system variables. This item substitutes itself with 
a basic constant containing variable value at fix_fields.
2005-07-16 03:29:13 +04:00
konstantin@mysql.com
1da2b9b4d7 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/media/sda1/mysql/mysql-5.0-10760-new
2005-07-14 20:02:36 +04: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
sergefp@mysql.com
86d3c07836 Merge mysql.com:/home/psergey/mysql-4.1-build-tree
into mysql.com:/home/psergey/mysql-4.1-merge-from-build
2005-07-14 16:02:30 +00:00
konstantin@mysql.com
9c6f14aa3d Get rid of checking for ETIME return value of pthread_cond_timedwait.
ETIME was returned by cond_timedwait (sic, the pre-POSIX1001b function) on 
Solaris 2.6 and 2.7. pthread_cond_timedwait on Solaris returns ETIMEDOUT.
The standard requirement is that the only additional return value
of pthred_cond_timedwait compared to pthread_cond_wait is ETIMEDOUT.
Let us not bloat the application code with redundant checks,
and if we're ever to work on a platform that returns a non-standard 
value, we should write a wrapper for that platform (like we do, e.g., for
Windows).
2005-07-14 19:42:56 +04:00
sergefp@mysql.com
0b3db181bf Fix for BUG#11869: In Item_func_match::fix_index() handle the case when there is no
source table present (this happens for ORDER BY after UNION)
2005-07-14 15:19:26 +00:00
konstantin@mysql.com
b6da7f6227 Merge mysql.com:/opt/local/work/mysql-4.1-9379
into  mysql.com:/opt/local/work/mysql-5.0-root
2005-07-13 23:49:45 +04:00
konstantin@mysql.com
1755df7649 A fix and a test case for Bug#9379 (collation of a parameter marker is
binary).
2005-07-13 23:43:46 +04:00
dlenev@mysql.com
75b8d4fa08 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg8406
2005-07-09 22:04:18 +04:00
dlenev@mysql.com
923fe817e0 Enable support of access to tables from triggers. Thus fix bug #8406 "Triggers
crash if referencing a table" and several other related bugs.
Fix for bug #11834 "Re-execution of prepared statement with dropped function
crashes server." which was spotted during work on previous bugs.

Also couple of nice cleanups:
- Replaced two separate hashes for stored routines used by statement with one.
- Now instead of doing one pass through all routines used in statement for
  caching them and then doing another pass for adding their tables to table
  list, we do only one pass during which do both things.
2005-07-09 21:51:59 +04:00
hf@deer.(none)
3ddd2771d6 Fix for bug #11708 (real function returns wrongly rounded decimal) 2005-07-07 20:28:47 +05: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
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
f3b6ec6e5f removed unneed line 2005-06-23 19:33:19 +03:00
bell@sanja.is.com.ua
56b2fc10a8 fixed environment restoring in case of error during SP function execution (BUG#9503)
#define macro improvement
2005-06-23 18:29:10 +03:00
jimw@mysql.com
1fa7b95d98 Fix multiplication of abs() by a negative value. (Bug #11402) 2005-06-22 20:00:21 -07:00
bell@sanja.is.com.ua
a7ca9cb38e fixed view fields names check and generation (changed after Trudy review: underlying field names treat as user set ones) (BUG#7448) 2005-06-21 20:30:48 +03:00
bell@sanja.is.com.ua
6d030c637b Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-bug4-5.0
2005-06-17 20:30:11 +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
serg@serg.mylan
1e3eb38724 Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
2005-06-15 20:24:13 +02:00
serg@serg.mylan
01b3c70926 renamed:
Item_buff -> Cached_item
  Item_arena -> Query_arena
  TEST_ASSERT -> YYERROR_UNLESS
2005-06-15 19:58:35 +02:00
hf@deer.(none)
971eaa189d Fix for bug #10337 (cast(NULL DECIMAL) crashes the server) 2005-06-15 19:02:35 +05:00
ramil@mysql.com
3ac1c2ca17 a fix (#11235: Expression with IFNULL yields 18 where 1 is correct). 2005-06-14 13:40:12 +05:00
pem@mysql.comhem.se
ca0a72f815 Post-merge fix. 2005-06-10 18:06:12 +02:00
pem@mysql.com
b42bf3cc55 Merge mysql.com:/usr/local/bk/mysql-5.0
into mysql.com:/home/pem/work/mysql-5.0
2005-06-10 16:56:34 +02:00
pem@mysql.comhem.se
46619fa0e3 Post review and additional fix for BUG#10968: Stored procedures: crash if long loop.
Fixed valgrind complaints. This fixes the memory leak problems for
  procedured, and partially for functions. There's still a leak involving
  results from functions that turned out to be too involved, so it will be
  fixed separately.
2005-06-10 16:14:01 +02:00
holyfoot@hf-ibm.(none)
717d92f6a6 Fix for bug #10083 (round doesn't increase scale) 2005-06-09 15:27:26 +05:00
dlenev@mysql.com
054139fc64 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-bg10015
2005-06-07 14:54:48 +04:00
dlenev@brandersnatch.localdomain
270b695f59 Fix for bug #10015 "Crash in InnoDB if stored routines are used".
We should not allow explicit or implicit transaction commits inside
of stored functions or triggers (so in autocommit mode we should not
do commits after execution of sub-statement).
Also since we don't support nested statement transactions in 5.0,
we shouldn't commit or rollback stmt transactions while we are inside
stored functions or triggers. This should be fixed in later (>=5.1)
releases.
2005-06-07 14:53:08 +04:00
monty@mysql.com
068bd3eb97 After merge fixes 2005-06-07 05:43:59 +03:00
monty@mysql.com
775f17667b Merge with 4.1 2005-06-07 00:31:53 +03:00
monty@mysql.com
b46f2ecf2f Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
2005-06-06 19:43:07 +03:00
lenz@mysql.com
13afa9129b Some Windows compile improvements:
- removed some unreferenced variables
 - fixed the libmysql project file by removing a duplicate file reference (merge error)
2005-06-06 15:23:04 +02: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
monty@mysql.com
4b7882dc73 merge 2005-06-05 17:19:50 +03:00
monty@mysql.com
25a2c4a71e Cleanup during review
Simple optimization for 2 argument usage to function of variable arguments
Fix stack overrun when using 1+1+1+1+1+1+1+....
Update crash-me results for 5.0
Don't call post_open if pre_open() fails (optimization)
2005-06-05 17:01:20 +03: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
serg@serg.mylan
91f6308d00 yassl template instantiation - don't do too much
mysys/my_access.c: remove incorrect fix
comments
2005-06-03 13:43:17 +02:00
igor@igor-inspiron.creware.com
e5ac58e64a Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0
into igor-inspiron.creware.com:/home/igor/mysql-5.0
2005-06-02 08:46:10 -07:00
igor@igor-inspiron.creware.com
380411607a Merge igor-inspiron.creware.com:/home/igor/mysql-5.0
into igor-inspiron.creware.com:/home/igor/dev/mysql-5.0-0
2005-06-02 07:33:31 -07:00
igor@igor-inspiron.creware.com
186e8c5891 item_func.h:
Fixed bug #9939: a wrong conversion of arguments
  for functions COALESCE and IFNULL.
  The str_op virtual method was added into Item_func_numhybrid.
item_func.cc:
  Fixed bug #9939: a wrong conversion of arguments
  for functions COALESCE and IFNULL.
  The str_op virtual method was added into Item_func_numhybrid.
item_cmpfunc.h, item_cmpfunc.cc:
  Fixed bug #9939: a wrong conversion of arguments
  for functions COALESCE and IFNULL.
  Item_func_coalesce and Item_func_ifnull now
  inherit from a modified Item_func_numhybrid.
case.test, case.result:
  Added test cases for bug #9939.
2005-06-02 07:27:02 -07:00
serg@serg.mylan
cdb1474dae Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
2005-06-02 15:46:55 +02:00
serg@serg.mylan
4df47b9e4a cleanup 2005-06-02 15:45:20 +02:00
bar@mysql.com
95484f7996 Merge mysql.com:/usr/home/bar/mysql-4.1.sysvar
into mysql.com:/usr/home/bar/mysql-5.0
2005-06-02 17:13:37 +05:00
bar@mysql.com
e686057259 item_func.cc:
set_var.cc:
variables.result
variables.test

  Bug #10904 Illegal mix of collations between a system variable and a constant
  Changing coercibility of system variables to SYSCONST,
  to be the same with USER(), DATABASE(), etc.
2005-06-02 16:17:44 +05:00
kent@mysql.com
f0fcc54b0c Merge 2005-06-02 04:45:09 +02:00
jimw@mysql.com
1c387c8f71 Restore a bit of code accidently deleted during merge 2005-06-01 18:08:39 -07:00
kent@mysql.com
f889f0884c Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/Users/kent/mysql/bk/mysql-4.1
2005-06-02 02:57:18 +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
jimw@mysql.com
5a271e2c12 Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-06-01 16:13:24 -07:00
jimw@mysql.com
7ac7bfc3c8 Fix handling of NULL fields in FIELD(). (Bug #10944) 2005-06-01 09:48:25 -07:00
pem@mysql.comhem.se
063896a6e7 Post-review fixes of BUG#9937: Crash on call to stored procedure. 2005-05-31 12:06:15 +02:00
pem@mysql.com
e496b24304 Merge mysql.com:/usr/local/bk/mysql-5.0
into mysql.com:/home/pem/work/mysql-5.0
2005-05-30 11:06:31 +02:00
pem@mysql.comhem.se
fcb3b0326e Fixed BUG#9559: Functions: Numeric Operations using -ve value gives incorrect
results.
  Actually a problem when converting decimal to int for user variables.
2005-05-27 14:48:33 +02:00
msvensson@neptunus.(none)
697cfe7f07 Merge from 4.1 2005-05-26 21:01:55 +02:00
pem@mysql.comhem.se
3eca4bf22e Fixed BUG#9937: Crash on call to stored procedure.
This only showed up on two known platforms, both ia64 (one HP-UX and one Linux wich icc).
For some reason, they only get half the stack size they are supposed to have, which
makes deep SP recursion overrun the stack before check_stack_overrun() is triggered.
Also made som minor fixes in the check_stack_overrun() definition, supporting variable
margins.
No test case added, but the reason for the bug report was a failed existing test case
on these machines, which now works.
2005-05-26 20:36:14 +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
ramil@mysql.com
b06181bccd hf's fix for bug #9060 (FORMAT returns incorrect result)
we need proper rounding there
2005-05-20 01:04:08 +05:00
ramil@mysql.com
eed75b052d a fix (bug #10599: Numeric function 'abs' make server crash). 2005-05-19 17:59:14 +05:00
georg@lmy002.wdf.sap.corp
2b04efe21e fixed fatal compiler error (windows) 2005-05-18 14:13:58 +02:00
acurtis@xiphis.org
8df5887ad5 Bug#10246 - Parser: bad syntax for GRANT EXECUTE
Rename some functions
  more fine-grained sp privileges
  make grant/revoke sp grammar less ambigious
2005-05-17 19:54:20 +01:00
monty@mysql.com
9db45adb60 Merge with 4.1 2005-05-14 18:31:22 +03:00
monty@mysql.com
beb5867dfb After merge fixes 2005-05-14 16:24:36 +03:00
monty@mysql.com
b4e92e6360 Merge with 4.0 2005-05-14 00:01:40 +03:00
hf@deer.(none)
3dbe7fb2ca Fix for valgrind bug in decimal code 2005-05-13 14:29:30 +05:00
dlenev@mysql.com
e7f29e1904 Manual merge of fix for bug #9913 into 5.0 tree. 2005-05-09 16:21:57 +04:00
dlenev@mysql.com
12621f349b Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/dlenev/src/mysql-4.1-bg9913
2005-05-09 12:18:19 +04:00
svoj@mysql.com
c7f0fcab23 BUG#7709 fix - Boolean fulltext query against unsupported engines does not
fail.
2005-05-07 15:48:56 +05:00
monty@mishka.local
015cd1cd21 merge 2005-05-06 13:51:58 +03:00
monty@mishka.local
a9f6aab4c9 Fixes while reviewing new code
Added option --count to mysqlshow (to show number of rows)
Fixed possible core dump in information schema
2005-05-06 11:39:30 +03:00
holyfoot@mysql.com
556504287b Merge 2005-05-05 20:10:50 +05: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
gbichot@quadita2.mysql.com
b72ae4fe57 Approximative fixes for BUG#2610,2611,9100 i.e. WL#2146 binlogging/replication of routines (stored procs and functions).
Approximative, because it's using our binlogging way (what we call "query"-level) and this is not as good as record-level binlog (5.1) would be. It imposes several
  limitations to routines, and has caveats (which I'll document, and for which the server will try to issue errors but that is not always possible).
  Reason I don't propagate caller info to the binlog as planned is that on master and slave
  users may be different; even with that some caveats would remain.
2005-05-05 14:20:53 +02:00
konstantin@mysql.com
92e4e1a3f8 Manual merge of Bug#9096 2005-05-03 19:32:29 +04:00
konstantin@mysql.com
018b8025c0 Merge mysql.com:/opt/local/work/mysql-4.1-root
into mysql.com:/opt/local/work/mysql-4.1-9096-fresh
2005-05-03 12:49:22 +04:00
konstantin@mysql.com
3589e78fda A fix and test case for Bug#9096 "select doesn't return all matched
records if prepared statements is used".
This fix changes equality evaluation method of basic constants from
by-name to by-value, thus effectively enabling use of parameter markers
in some optimizations (constants propagation, evaluation of possible
keys for query).
2005-05-03 12:47:27 +04:00
serg@serg.mylan
530b6ba541 Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
2005-05-01 23:10:55 +02:00
serg@serg.mylan
9c332d8d2a yassl changeset 2:
remove FIX_GCC_LINKING_PROBLEM and -DDEFINE_CXA_PURE_VIRTUAL
  replace echo in configure.in with AC_MSG_WARN/AC_MSG_ERROR
  don't set -DUSE_MYSYS_NEW for gcc 2.95
  set $USE_MYSYS_NEW even if CXX is g++
  yassl bugfixes
  instantiate all yassl templates explicitly
2005-04-30 19:48:45 +02:00
dlenev@brandersnatch.localdomain
8ee6d33bdd Fix for Bug #9913 "udf_deinit is not called after execution of PS"
(aka "deinit is not called when calling udf from trigger").

We should call udf_deinit() function during cleanup phase after prepared
(or ordinary) statement execution instead of calling it from Item's
desctructor.

No test case is provided since it is hard to test UDF's from our test
suite.
2005-04-30 20:23:40 +04:00
monty@mysql.com
28a5491d3d Merge with 4.1 2005-04-30 09:46:08 +03:00
monty@mysql.com
c0e8a8d625 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
2005-04-30 03:46:38 +03:00
monty@mysql.com
129c604032 Setting a variable to CAST(NULL as X) set the result type of the variable to X. (Bug #6598) 2005-04-30 03:14:42 +03:00
monty@mysql.com
fbf31c4a8c CAST(string_argument AS UNSIGNED) didn't work for big integers above the signed range. (Bug #7036)
Produce warnings of wrong cast of strings to signed/unsigned.
Don't block not resolved IP's if DNS server is down (Bug #8467)
Fix compiler problems with MinGW (Bug #8872)
2005-04-29 17:03:34 +03:00
pem@mysql.comhem.se
f769a7a8b0 Post-review fixes of the patch for BUG#8408: Stored procedure crash if function contains SHOW
(Review on irc by monty)
2005-04-27 16:35:49 +02:00
pem@mysql.comhem.se
281c0a8130 Fixed BUG#8408: Stored procedure crash if function contains SHOW
We simply have to disallow any kind of result set being sent back
  from a function. Can't see any way to make that to work.
2005-04-26 17:31:59 +02:00
acurtis@xiphis.org
8689083aca Bug#9775 - Stored procedures: crash if create function that returns enum or set
Fix bug and implement return type casting.
2005-04-20 18:08:42 +01:00
ramil@mysql.com
775010a40d A fix (bug #9837: round(1, 6) delivers wrong value in create table context). 2005-04-19 14:44:54 +05:00
bar@eagle.intranet.mysql.r18.ru
8e028d2f88 item_func.cc:
Post merge additional fix for DECIMAL type:
  Bugs: #9425: A user variable doesn't always have implicit coercibility
2005-03-28 14:15:43 +05:00
bar@eagle.intranet.mysql.r18.ru
ef81035ff4 Merge eagle.intranet.mysql.r18.ru:/home/bar/mysql-4.1
into eagle.intranet.mysql.r18.ru:/home/bar/mysql-5.0
2005-03-28 14:08:25 +05:00
bar@mysql.com
e60daecc87 Bug#9425 A user variable doesn't always have implicit coercibility
Coercibility fixes for numeric types and not defined values were done.
2005-03-28 14:01:57 +05:00
jimw@mysql.com
9307f61cb2 Clarify comment to add which version of the C compiler for AIX needs to have
some code in a specific order.
2005-03-23 17:27:52 -08:00
jimw@mysql.com
4c67678f15 Fix Windows compile warnings, declarations of walk functions 2005-03-22 00:00:24 +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
gluh@gluh.mysql.r18.ru
b435d6e862 Merge 4.1 -> 5.0 2005-03-17 16:51:07 +03:00
monty@mysql.com
f42941073d Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
2005-03-16 22:59:06 +02: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
bar@mysql.com
a7b877df78 Bugs#9129: CHARSET(), COLLATION(), COERCIBILITY()
not always correct for NULL values.
Now they always result a non NULL value even
the argument is NULL. It is more usefull for 
debugging purposes.
2005-03-16 17:44:29 +04:00
dlenev@brandersnatch.localdomain
f169114042 WL#874 "Extended LOAD DATA".
Now one can use user variables as target for data loaded from file
(besides table's columns). Also LOAD DATA got new SET-clause in which
one can specify values for table columns as expressions.

For example the following is possible:
LOAD DATA INFILE 'words.dat' INTO TABLE t1 (a, @b) SET c = @b + 1;

This patch also implements new way of replicating LOAD DATA.
Now we do it similarly to other queries.
We store LOAD DATA query in new Execute_load_query event
(which is last in the sequence of events representing LOAD DATA).
When we are executing this event we simply rewrite part of query which
holds name of file (we use name of temporary file) and then execute it
as usual query. In the beggining of this sequence we use Begin_load_query
event which is almost identical to Append_file event
2005-03-16 04:32:47 +03:00
acurtis@pcgem.rdg.cyberkinetica.com
1a996a7140 Cleanup for VC++ 2005-03-09 21:53:04 +00:00
acurtis@ltantony.rdg.cyberkinetica.homeunix.net
be3c863ba0 Merge in fix Bug#3788 2005-03-08 22:32:09 +00:00
bar@mysql.com
d50d213162 Merge 2005-03-05 18:20:35 +04:00
acurtis@pcgem.rdg.cyberkinetica.com
5e1d2ad68c Bug#3788
Crashes with stored procedure return non-string values
  Also fixes Bug#2773
2005-03-04 21:14:35 +00:00
hf@deer.(none)
d3ee99ad91 Fix for bug #8431 (FLOOR returns incorrect result) 2005-03-04 23:06:00 +04:00
hf@deer.(none)
af329d532f Merge bk@192.168.21.1:/usr/home/bk/mysql-5.0
into deer.(none):/home/hf/work/mysql-5.0.8915
2005-03-04 22:01:21 +04:00
hf@deer.(none)
7e7d98a291 Fix for bug #8430 (CEILING returns incorrect result) 2005-03-04 20:35:55 +04:00
dlenev@mysql.com
5b16dbf960 Manual merge SP-locking improvements patch with current tree. 2005-03-04 17:46:45 +03:00
dlenev@brandersnatch.localdomain
5a6c7027f0 Better approach for prelocking of tables for stored routines execution
and some SP-related cleanups.

- We don't have separate stage for calculation of list of tables
  to be prelocked and doing implicit LOCK/UNLOCK any more.
  Instead we calculate this list at open_tables() and do implicit
  LOCK in lock_tables() (and UNLOCK in close_thread_tables()).
  Also now we support cases when same table (with same alias) is
  used several times in the same query in SP.

- Cleaned up execution of SP. Moved all common code which handles
  LEX and does preparations before statement execution or complex
  expression evaluation to auxilary sp_lex_keeper class. Now 
  all statements in SP (and corresponding instructions) that
  evaluate expression which can contain subquery have their
  own LEX.
2005-03-04 16:35:28 +03: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
jimw@mysql.com
6a082b36ed Merge bk-internal:/home/bk/mysql-5.0
into mysql.com:/home/jimw/my/mysql-5.0-clean
2005-03-03 08:34:27 -08:00
jimw@mysql.com
d596af2c97 Merge bk-internal:/home/bk/mysql-5.0
into mysql.com:/home/jimw/my/mysql-5.0-clean
2005-03-02 10:23:07 -08:00
guilhem@mysql.com
d1f089b3d7 Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/mysql_src/mysql-5.0-xa
2005-03-02 16:40:04 +01:00
guilhem@mysql.com
c4ac232d17 First part of fix for BUG#7998 "Replication should be more clever about when to replicate RELEASE_LOCK()"
(next part is updating test results)
2005-03-02 16:37:54 +01:00
serg@serg.mylan
02d88c398f bug#8151 - truncate leaves a transaction open
deadlock in MYSQL_LOG::new_file()
style fixes
2005-03-02 10:38:25 +01:00
jimw@mysql.com
bf0c6ffd57 Merge mysql.com:/home/jimw/my/mysql-5.0-8678
into mysql.com:/home/jimw/my/mysql-5.0-clean
2005-03-01 15:25:18 -08:00
jimw@mysql.com
775f6a472d Move some code around to appease the IBM AIX compiler. (Bug #8678) 2005-02-24 11:10:12 -08:00
mskold@mysql.com
364492239b Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into mysql.com:/usr/local/home/marty/MySQL/test/mysql-5.0-ndb
2005-02-23 15:54:22 +01:00
monty@mysql.com
e2ea35ec67 Merge with 4.1 2005-02-22 15:47:00 +02:00
bar@mysql.com
89a5530822 A user variable are now always have IMPLICIT coercibility,
independently from the expression it is initialized from.
In other words, this change treats a user variable like
a table with one column and one record. Discussed with 
PeterG, Serg and Lars. This change also simplifies replication
allowing not to replicate variables' coercibility.
2005-02-22 15:55:40 +04:00
mskold@mysql.com
b3d3f73753 Merge 2005-02-21 16:13:29 +01:00
monty@mysql.com
5bfcabf7cd Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
2005-02-19 21:56:24 +02:00
georg@beethoven.site
88afe50565 Merge grichter@bk-internal.mysql.com:/home/bk/mysql-5.0
into beethoven.site:/home/georg/work/mysql/mysql-5.0
2005-02-19 18:47:33 +01:00
monty@mysql.com
88d2e2973d Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
2005-02-19 19:00:41 +02:00
monty@mysql.com
218e00ac68 Fixed BUILD script to use --with-berkeley-db instead of --with-bdb
Lots of small fixes to multi-precision-math path
Give Note for '123.4e'
Added helper functions type 'val_string_from_real()
Don't give warnings for end space for string2decimal()
Changed storage of values for SP so that we can detect length of argument without strlen()
Changed interface for str2dec() so that we must supple the pointer to the last character in the buffer
2005-02-19 18:58:27 +02:00
georg@beethoven.site
26e3685b02 Changes and fixes for windows compilation 2005-02-18 15:17:17 +01:00
serg@serg.mylan
fd828e5b4d manually merged 2005-02-14 21:50:09 +01:00
mskold@mysql.com
66343612d1 Merge 2005-02-11 22:30:37 +01:00
mskold@mysql.com
828a785610 Condition pushdown v.2 2005-02-11 22:05:24 +01:00
monty@mysql.com
a1a39fab84 Merge with 4.1 2005-02-10 02:27:37 +02:00
hf@deer.(none)
96558f6ad3 Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into deer.(none):/home/hf/work/mysql-5.0.clean
2005-02-09 02:54:08 +04:00
hf@deer.(none)
b94a482ee9 Precision Math implementation 2005-02-09 02:50:45 +04:00
pem@mysql.comhem.se
2c26ebe359 WL#2130: Table locking for stored FUNCTIONs
Collect all tables and SPs refered by a statement, and open all tables
with an implicit LOCK TABLES. Do find things refered by triggers and views,
we open them first (and then repeat this until nothing new is found), before
doing the actual lock tables.
2005-02-08 20:52:50 +01:00
monty@mysql.com
79ec81071a Better bugfix for "HAVING when refering to RAND()" (Bug #8216)
Ensure that references in HAVING, ORDER BY or GROUP BY are calculated after fields in SELECT.
This will ensure that any reference to these has a valid value.
Generalized the code for split_sum_func()
2005-02-08 14:41:09 +02:00
monty@mysql.com
dcb7865548 Merge with 4.1 to get bug fix 2005-02-07 19:42:03 +02:00
monty@mysql.com
3fe60486e4 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1
2005-02-07 18:14:31 +02:00
monty@mysql.com
32f91f48e8 Fixed bug in HAVING when refering to RAND() through alias
(BUG 8216)
2005-02-07 18:13:57 +02:00
jimw@mysql.com
3c10ccd3f7 Merge bk-internal:/home/bk/mysql-5.0
into mysql.com:/home/jimw/my/mysql-5.0-clean
2005-02-05 07:52:55 -08:00
monty@mysql.com
80b3e02462 Fixed bug detected by sp-tests
Cleanup during reviews of new pushed code
2005-02-05 16:05:46 +02:00
jimw@mysql.com
8c8553af81 Merge changes 2005-02-04 11:59:02 -08:00
serg@serg.mylan
47f354bca7 Merge serg@bk-internal.mysql.com:/home/bk/mysql-4.1/
into serg.mylan:/usr/home/serg/Abk/mysql-4.1
2005-02-04 15:31:39 +01:00
serg@serg.mylan
cc1ee6475f indexless boolean fulltext search was depending on default_charset_info - Bug#8159
ftbw->off wasn't cleared on reinit - Bug#8234
2005-02-04 15:24:06 +01:00
pekka@mysql.com
8e4fca2a55 Merge 2005-02-04 10:35:09 +01:00
acurtis@pcgem.rdg.cyberkinetica.com
1cb1dcb0f3 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into pcgem.rdg.cyberkinetica.com:/var/db/bk/work-acurtis/bug8057
2005-02-03 21:16:36 +00:00
acurtis@pcgem.rdg.cyberkinetica.com
b8ceaa4a1f Bug#8057
Fix crash with LAST_INSERT_ID() in UPDATE,
  Tests included,
2005-02-03 21:11:12 +00:00
monty@mysql.com
422c2eb868 4.1 -> 5.0 merge 2005-02-03 13:18:30 +02:00
serg@serg.mylan
3c5060981f query_id and my_xid -> ulonglong
fix for binlog+autocommit+tclog
comments, style fixes
2005-01-27 22:38:56 +01:00
bell@sanja.is.com.ua
76ae5caca0 fixed column number fetchinmg for subqueries. (BUG#8020)
fixed cols() method call (it have to be called only after fix_fields())
2005-01-24 14:25:44 +02:00
mskold@mysql.com
346aeda888 Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into mysql.com:/usr/local/home/marty/MySQL/test/mysql-5.0-ndb
2005-01-07 15:34:25 +01:00
monty@mysql.com
bda0a78184 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
2005-01-06 13:31:31 +02:00
monty@mysql.com
d35140a851 First stage of table definition cache
Split TABLE to TABLE and TABLE_SHARE (TABLE_SHARE is still allocated as part of table, will be fixed soon)
Created Field::make_field() and made Field_num::make_field() to call this
Added 'TABLE_SHARE->db' that points to database name; Changed all usage of table_cache_key as database name to use this instead
Changed field->table_name to point to pointer to alias. This allows us to change alias for a table by just updating one pointer.
Renamed TABLE_SHARE->real_name to table_name
Renamed TABLE->table_name to alias
Renamed TABLE_LIST->real_name to table_name
2005-01-06 13:00:13 +02:00
bell@sanja.is.com.ua
dffac28b76 fixed views with PS protocol 2005-01-05 16:48:23 +02:00
mskold@mysql.com
881b3a023f Merge 2005-01-03 15:20:06 +01:00
serg@sergbook.mysql.com
a04fc26c54 manually merged 2004-12-31 15:26:24 +01:00
monty@mysql.com
5e03ebbcad After merge fixes
Cleanup of mi_print_error() handling
Deleted 'merge' directory
2004-12-31 03:47:56 +02:00
monty@mysql.com
34d5331cee Merge with global tree 2004-12-31 00:50:30 +02:00
mskold@mysql.com
a5204f692b Merge 2004-12-29 10:02:03 +01:00
acurtis@pcgem.rdg.cyberkinetica.com
b1e30904d5 WL#925 - Privileges for stored routines
Implement fine-grained control over access to stored procedures
  Privileges are cached (same way as existing table/column privs)
2004-12-23 10:46:24 +00:00
monty@mishka.local
4f4bbfc279 Merge with 4.1 2004-12-22 13:54:39 +02:00
ram@gw.mysql.r18.ru
dfbdbfd006 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into gw.mysql.r18.ru:/usr/home/ram/work/4.1.b7281
2004-12-21 10:51:11 +04:00
mskold@mysql.com
dac1551a2b Condition pushdown to storage engine, optimizations 2004-12-20 10:58:00 +01:00
ram@gw.mysql.r18.ru
da562b7e02 A fix (bug #7281: RAND(RAND) crashes server). 2004-12-20 13:47:38 +04:00
mskold@mysql.com
3edf243875 Condition pushdown to storage engine 2004-12-17 21:13:22 +01:00
sergefp@mysql.com
da332aca40 Fix for BUG#6825: When calculating Item_func_neg::max_length, add 1 for '-'.
For numeric constants we only need to add, since the parser doesn't produce 
negative numbers. 
For strings we only add (we actually could substract 1 if given string is a constant 
and it has '-number' form but we're not doing that because 
 * we set max_length bigger then necessary in other cases as well.  
 * the current solution is simpler and safer (bigger max_length is better then cutting out)
2004-12-17 12:14:45 +03:00
sergefp@mysql.com
3c8f48d2e3 * Added comments and one assert
* Backport of safety measures from 5.0: make numeorous replaces:
    s/item->fix_fields()/if (!item->fixed) item->fix_fields()
2004-12-14 03:36:19 +03:00
sergefp@mysql.com
3ceb04a5d8 Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0
* Added Item_ref::set_properties 
 * Item_ref::Item_ref now expects to get in *item either
     NULL - then fix_fields() will be called later  or 
     ptr to Item it will refer to - then an equivalent of fix_fields() call is performed
2004-12-14 01:07:06 +03:00
sergefp@mysql.com
9ed8cd701b Merging fix for BUG#6976 from 4.0 to 4.1
The problem in 4.1 was the same as in 4.0 - fix_fields() not called for created Item_ref. 
The fix is similar too - initialize Item_refs in ctor (but don't interfere with cases when 
Item_ref is used by subselects).
2004-12-13 20:06:06 +03:00
monty@mysql.com
563500994a Update results for new varchar handling
Fixed compiler warnings
String results in CREATE ... SELECT are now created as CHAR(0), VARCHAR(X) or TEXT() depending on item->max_length
2004-12-07 15:47:00 +02:00
monty@mysql.com
0de4777187 Merge with 4.1 2004-12-06 11:38:56 +02:00
mats@mysql.com
fe70f8c747 Merge mysql.com:/space/bkroot/mysql-4.1
into mysql.com:/space/bk/b6391-mysql-4.1
2004-12-03 12:15:31 +01:00
mats@mysql.com
2bbdf2403d Bug#6391 (binlog-do-db rules ignored)
CREATE DATABASE statement used the current database instead of the
  database created when checking conditions for replication.
  CREATE/DROP/ALTER DATABASE statements are now replicated based on
  the manipulated database.
2004-12-03 12:13:51 +01:00
serg@serg.mylan
3ce8209994 compatibility fix 2004-12-02 20:53:54 +01:00
serg@serg.mylan
5a07b871cc don't cast LEX_STRING to char* :) 2004-11-28 21:55:38 +01:00
tomas@poseidon.ndb.mysql.com
538a3f7a53 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
2004-11-25 13:33:31 +00:00
ram@gw.mysql.r18.ru
511eb626bf Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into gw.mysql.r18.ru:/usr/home/ram/work/4.1.b6441
2004-11-25 16:18:46 +04:00
serg@serg.mylan
2d3dd65cc1 merged 2004-11-20 18:36:41 +01:00
bar@mysql.com
770c9be8c2 Bug #6658 MAX(column) returns incorrect coercibility
Also, Item_sum_hybrid->charset was removed as redundant,
and switched to use collation.collation instead.
2004-11-19 19:35:36 +04:00
serg@serg.mylan
e68bd85b77 merged 2004-11-17 18:04:36 +01:00
konstantin@mysql.com
ed2674d0a7 Fix warnings and compilation failures (Windows). 2004-11-17 13:45:05 +03:00
konstantin@mysql.com
a38ac4b26d Fix comment. 2004-11-16 23:27:31 +03:00
bell@sanja.is.com.ua
7210195f1e now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement
2004-11-13 19:35:51 +02:00
bell@sanja.is.com.ua
1555469b64 merge 2004-11-12 15:36:31 +02:00
bell@sanja.is.com.ua
31f7811183 post-review fixes 2004-11-12 14:34:00 +02:00
konstantin@mysql.com
e5f4c7a0bd Rename: Item::val -> Item::val_real(). 2004-11-11 21:39:35 +03:00
monty@mysql.com
2bba55b57f After merge fixes
Added push_back(void *, MEM_ROOT *) to make some list-handling code easier that needs to be allocated in a different mem-root
(Before one had to change thd->mem_root ; push_back(); restore mem_root.
2004-11-09 03:58:44 +02:00
monty@mysql.com
1087186657 Merge with 4.1 to get new thd->mem_root handling 2004-11-08 17:53:32 +02:00
monty@mysql.com
07f9c634ad After merge fixes 2004-11-08 01:51:10 +02:00
monty@mysql.com
b903a129e2 Simpler arena swapping code
Now thd->mem_root is a pointer to thd->main_mem_root and THR_MALLOC is a pointer to thd->mem_root.
This gives us the following benefits:
- Allow us to easily detect if arena has already been swapped before (this fixes a bug in setup_conds() where arena was swaped twice in some cases)
- Faster swaps of arenas (as we don't have to copy the whole MEM_ROOT)
- We don't anymore have to call my_pthread_setspecific_ptr(THR_MALLOC,...) to change where memory is alloced. Now it's enough to set thd->mem_root
2004-11-08 01:13:54 +02:00
ram@gw.mysql.r18.ru
167c9489fa A fix (bug #6441: Aggregate UDF in multi-table query crashes MySQL when returning multiple rows). 2004-11-06 09:37:30 +04:00
bar@mysql.com
5543f312b0 As it is wrong and confusing to associate any
character set with NULL, @a should be latin2
after this query sequence:

   SET @a=_latin2'string';
   SET @a=NULL;

I.e. the second query should not change the charset
to the current default value, but should keep the
original value assigned during the first query.
In order to do it, we don't copy charset
from the argument if the argument is NULL
and the variable has previously been initialized.
2004-11-05 13:37:36 +04:00
monty@mysql.com
071001950e Merge with 4.1 to get in latest bug fixes 2004-11-04 15:06:24 +02:00
monty@mysql.com
47bbf768d4 Fixes after merge with 4.1
FOUND is not a reserved keyword anymore
Added Item_field::set_no_const_sub() to be able to mark fields that can't be substituted
Added 'simple_select' method to be able to quickly determinate if a select_result is a normal SELECT
Note that the 5.0 tree is not yet up to date: Sanja will have to fix multi-update-locks for this merge to be complete
2004-11-03 12:39:38 +02:00
bar@mysql.com
6a3b1d443f Many files:
Allow mixing of different character sets for more SQL functions.
item_func.h:
  Allow mixing of different character sets for more SQL functions..
2004-11-02 16:02:12 +04:00
monty@mysql.com
afbe601302 merge with 4.1 2004-10-29 19:26:52 +03: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
bar@mysql.com
ea49a5181a Allow to convert to non-Unicode charset when mixing a string
constant with a column. The string is converted into the column
character set. It conversion doesn't lose data, then operation
is possible. Otherwise, give an error, as it was earlier.
2004-10-29 16:00:03 +05:00
bar@mysql.com
2fc0d7e422 An extra "separator" class member was removed from Item_func_concat_ws.
args[0] is now used instead.
2004-10-28 11:43:31 +05:00
bell@sanja.is.com.ua
b1617371d2 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-error-5.0
2004-10-22 09:51:20 +03:00
ram@gw.mysql.r18.ru
136652522e A fix (bug #6138: MOD operator should not round non-integral argument). 2004-10-21 19:52:55 +05:00