Commit graph

347 commits

Author SHA1 Message Date
ndbdev@dl145c.mysql.com
dc595c9b1d merge 2005-09-15 07:36:47 +02:00
dlenev@mysql.com
2a96aa110f Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg12704-2
2005-09-15 03:57:59 +04:00
dlenev@mysql.com
e231ebe5fb Fix for bug #12704 "Server crashes during trigger execution".
This bug occurs when some trigger for table used by DML statement is created
or changed while statement was waiting in lock_tables(). In this situation
prelocking set which we have calculated becames invalid which can easily lead
to errors and even in some cases to crashes.

With proposed patch we no longer silently reopen tables in lock_tables(),
instead caller of lock_tables() becomes responsible for reopening tables and
recalculation of prelocking set.
2005-09-15 03:56:09 +04: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
ndbdev@dl145c.mysql.com
f40c1576b0 Merge 2005-09-06 09:20:15 +02:00
konstantin@mysql.com
a3ddcdf8fb Rename:
- current_arena to stmt_arena: the thread may have more than one
'current' arenas: one for runtime data, and one for the parsed 
tree of a statement. Only one of them is active at any moment.
- set_item_arena -> set_query_arena, because Item_arena was renamed to 
Query_arena a while ago
- set_n_backup_item_arena -> set_n_backup_active_arena;
the active arena is the arena thd->mem_root and thd->free_list
are currently pointing at.
- restore_backup_item_arena -> restore_active_arena (with the same
rationale)
- change_arena_if_needed -> activate_stmt_arena_if_needed; this
method sets thd->stmt_arena active if it's not done yet.
2005-09-02 17:21:19 +04:00
brian@zim.(none)
57403ddc9d Merge zim.(none):/home/brian/mysql/mysql-5.0
into  zim.(none):/home/brian/mysql/mysql-5.1

Resolved to minor issues.
2005-08-30 14:40:02 -07:00
andrey@lmy004.
950a277988 retest the fix for bug #10362 (SHOW PROCEDURE always qualifies name with database)
(already approved)
2005-08-27 12:29:36 +02:00
pappa@c-4a09e253.1238-1-64736c10.cust.bredbandsbolaget.se
02056f8e3a Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.0
into  c-4a09e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-5.1
2005-08-25 13:11:38 -04:00
jimw@mysql.com
2d34276417 Merge mysql.com:/home/jimw/my/mysql-5.0-12318
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-08-15 12:39:36 -07:00
timour@mysql.com
354ce1d024 Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into  mysql.com:/home/timka/mysql/src/5.0-2486-merge
2005-08-12 19:27:54 +03:00
timour@mysql.com
a247282aa6 Implementation of WL#2486 -
"Process NATURAL and USING joins according to SQL:2003".

* Some of the main problems fixed by the patch:
  - in "select *" queries the * expanded correctly according to
    ANSI for arbitrary natural/using joins
  - natural/using joins are correctly transformed into JOIN ... ON
    for any number/nesting of the joins.
  - column references are correctly resolved against natural joins
    of any nesting and combined with arbitrary other joins.

* This patch also contains a fix for name resolution of items
  inside the ON condition of JOIN ... ON - in this case items must
  be resolved only against the JOIN operands. To support such
  'local' name resolution, the patch introduces a stack of
  name resolution contexts used at parse time.

NOTICE:
- This patch is not complete in the sense that
  - there are 2 test cases that still do not pass -
    one in join.test, one in select.test. Both are marked
    with a comment "TODO: WL#2486".
  - it does not include a new test specific for the task
2005-08-12 17:57:19 +03:00
jimw@mysql.com
3a815f45bd Avoid spurious error when restoring INFORMATION_SCHEMA as the current
database after failing to execute a stored procedure in an inaccessible
database. (Bug #12318)
2005-08-11 17:04:16 -07:00
sergefp@mysql.com
9125477df5 Merge mysql.com:/home/psergey/mysql-5.0-bug12228-r4
into mysql.com:/home/psergey/mysql-5.0-bug12228-r5
2005-08-10 21:17:52 +00:00
dlenev@mysql.com
0c38d33507 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-is
2005-08-09 11:43:55 +04:00
sergefp@mysql.com
c6db76b076 Fix for BUG#12228: SP cache code:
* Cleanup SP Cache code, now SP Cache only deletes sp_head objects in 
  sp_cache_flush_obsolete() invalidates all pointers to routines in the cache.
* Use new SP Cache use contract in the code.

There is no test case because it doesn't seem to be possible to cause thread races to end
the same way they end in heavy-load test. This patch removes the crash in heavy test.
2005-08-08 23:23:34 +00:00
dlenev@mysql.com
615baa9f23 Fix for bug #10055 "Using stored function with information_schema causes empty
result set".

To enable full access to contents of I_S tables from stored functions
or statements that use them, we manipulate with thread's open tables
state and ensure that we won't cause deadlock when we open tables by
ignoring flushes and name-locks.
Building of contents of I_S.TABLES no longer requires locking of tables
since we use use handler::info() method with HA_STATUS_AUTO flag instead
of handler::update_auto_increment() for obtaining information about
auto-increment values. But this also means that handlers have to implement
support for HA_STATUS_AUTO flag (particularly InnoDB needs it).
2005-08-08 17:46:06 +04: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
sergefp@mysql.com
31a73da815 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/psergey/mysql-5.0-sp-no-lock-r7
2005-08-03 10:14:01 +00:00
sergefp@mysql.com
f595847ec0 Manual merge 2005-08-03 03:47:07 +00:00
sergefp@mysql.com
b6a6fe0849 Prelocking-free SPs, post-review fixes:
* Don't activate prelocking mode for evaluating procedure arguments when it is not necessary.
* Code structure simplification and cleanup.
* Cleanup in .test files
2005-08-03 03:37:32 +00:00
jimw@mysql.com
de46ae18c2 Merge mysql.com:/home/jimw/my/mysql-5.0-11602
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-08-02 16:50:12 -07:00
sergefp@mysql.com
de02193bdd Added Non-prelocked SP execution: Now a PROCEDURE doesn't enter/leave prelocked mode for
its body, but lets each statement to get/release its own locks. This allows a broader set
of statements to be executed inside PROCEDUREs (but breaks replication)
This patch should fix BUG#8072, BUG#8766, BUG#9563, BUG#11126
2005-07-30 08:19:57 +00:00
monty@mysql.com
b3cbd0048f Cleanups during review of new code
Ensure mysql_close() is called if mysql_set_character_set() fails
2005-07-28 16:10:14 +03:00
jimw@mysql.com
0536bd6679 Increase allowed size of stored procedure bodies to 4GB, and
produce a sensible error when that limit is exceeded. (Bug #11602)
2005-07-26 18:08:49 -07:00
tulin@dl145b.mysql.com
a6c21a0791 merge 2005-07-19 21:56:10 +02:00
dlenev@mysql.com
8a3e723b74 Fix for bugs #5892/6182/8751/8758/10994 (based on Antony's patch)
"Triggers have the wrong namespace"
  "Triggers: duplicate names allowed"
  "Triggers: CREATE TRIGGER does not accept fully qualified names"
  "SHOW TRIGGERS"
2005-07-19 20:06:49 +04:00
mronstrom@mysql.com
67087e2aa7 Patch for push of wl1354 Partitioning 2005-07-18 13:31:02 +02:00
dlenev@mysql.com
8a28d604f5 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-mysqlproc
2005-07-13 15:08:13 +04:00
dlenev@mysql.com
f334ea1fc6 Implementation of Monty's idea: Now we can open mysql.proc table for lookup
of stored routines definitions even if we already have some tables open and
locked. To avoid deadlocks in this case we have to put certain restrictions
on locking of mysql.proc table.

This allows to use stored routines safely under LOCK TABLES without explicitly
mentioning mysql.proc in the list of locked tables. It also fixes bug #11554
"Server crashes on statement indirectly using non-cached function".
2005-07-13 13:48:13 +04:00
pem@mysql.com
6f54e27e5e Merge mysql.com:/usr/local/bk/mysql-5.0
into  mysql.com:/home/pem/work/mysql-5.0
2005-07-11 12:46:42 +02:00
dlenev@mysql.com
4e8c22f296 Manual fixes after merging patch for bug #8406 "Triggers crash if referencing
a table" with main tree.
2005-07-09 23:11:17 +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
pem@mysql.com
5ce9198f20 Fixed BUG#11365: Stored Procedure: Crash on Procedure operation
Two separate problems. A key buffer was too small in sp.cc for multi-byte
  fields, and the creation and fixing of mysql.proc in the scripts hadn't been
  updated with the correct character sets and collations (like the other
  system tables had).
  Note: No special test case, as the use of utf8 for mysql.proc will make
  any existing crash (if the buffer overrrun wasn't fixed).
2005-07-08 16:33:15 +02:00
bell@sanja.is.com.ua
2941da3971 do not register changes of stack variable 2005-07-03 00:51:02 +03:00
bell@sanja.is.com.ua
d3905f3d0e Name resolution context added (BUG#6443) 2005-07-01 07:05:42 +03:00
pem@mysql.comhem.se
76073d7bf5 Fixed BUG#9529: Stored Procedures: No Warning on truncation of procedure name
during creation.
  Although it returns an error, consistent with the behaviour for other objects.
  (Unclear why we would allow the creation of SPs with truncated names.)
2005-05-31 18:36:32 +02:00
konstantin@mysql.com
2d6a70c42a Preparatory (and the most problematic) patch for Bug#7306
"the server side preparedStatement error for LIMIT placeholder",
which moves all uses of LIMIT clause from PREPARE to OPTIMIZE
and later steps.
After-review fixes.
2005-05-30 20:54:37 +04:00
monty@mysql.com
6cca51f06a Fixed references to uninitialized memory 2005-05-19 04:48:22 +03: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
dlenev@brandersnatch.localdomain
d85bed1121 Fix for bug #9566 "explicit LOCK TABLE and store procedures result in
illegal state".

We should not assume that mysql.proc table does not exist if we are
unable to open it under LOCK TABLES or in prelocked mode (and
remember this fact by setting mysql_proc_table_exists to zero).
2005-04-07 01:40:29 +04:00
monty@mysql.com
5ba3f707f7 Don't use -lsupc++ with gcc 3.3 and below as this gives linking problems when linking staticly
Fix that mysql.proc works with new VARCHAR fields
Give warnings for wrong zero dates
2005-04-04 16:43:25 +03:00
acurtis@pcgem.rdg.cyberkinetica.com
759ad1a13e More portability fixes 2005-03-10 19:42:57 +00:00
acurtis@ltantony.rdg.cyberkinetica.homeunix.net
be3c863ba0 Merge in fix Bug#3788 2005-03-08 22:32:09 +00:00
dlenev@brandersnatch.localdomain
e6a506c397 Fix for yet another memleak caused by SP-locking patch.
Improved handling of situations when we encounter error during
CREATE PROCEDURE (FUNCTION/TRIGGER/...) and bail out of yyparse()
without restoring proper THD::lex.
2005-03-05 16:31:58 +03: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
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
pem@mysql.comhem.se
027c5a6dac Fixed BUG#8762: Stored Procedures: Inconsistent behavior
of DROP PROCEDURE IF EXISTS statement.
2005-03-02 17:25:58 +01: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
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
monty@mysql.com
34d5331cee Merge with global tree 2004-12-31 00:50:30 +02:00
monty@mysql.com
d71c030587 After merge fixes 2004-12-31 00:44:00 +02: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
ram@gw.mysql.r18.ru
f7fb35c518 A fix (Bug #6843: Wrong function name crashes MySQL if mysql.proc table is missi 2004-12-16 16:29:47 +04:00
bell@sanja.is.com.ua
69ec6a4592 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-join-5.0
2004-11-25 02:27:02 +02:00
bell@sanja.is.com.ua
1e3d8b0839 post-merge fix 2004-11-25 02:23:13 +02:00
pem@mysql.comhem.se
43aefd66fd Fix compiler warnings on some systems. (Unused variables)
Fixed bug in DROP FUNCTION for UDFs.
Note: It still doesn't work properly, but that bug is somewhere else.
2004-11-23 19:19:09 +01:00
bell@sanja.is.com.ua
072d38eb12 merge 2004-11-21 20:08:12 +02: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
bell@sanja.is.com.ua
0ef0b030a5 merge 2004-11-11 21:18:10 +02:00
timour@mysql.com
e61b4454da Merge of WL#1972 "Evaluate HAVING before SELECT select-list" 2004-11-11 11:31:58 +02: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
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
timour@mysql.com
09f1c7096c WL#1972 "Evaluate HAVING before SELECT select-list"
- Changed name resolution for GROUP BY so that derived columns do not shadow table columns
  from the FROM clause. As a result GROUP BY now is handled as a true ANSI extentsion.
- Issue a warning when HAVING is resolved into ambiguous columns, and prefer the columns from
  the GROUP BY clause over SELECT columns.
2004-11-02 18:23:15 +02:00
bell@sanja.is.com.ua
dff05eb951 merge 2004-10-28 11:02:48 +03:00
pem@mysql.comhem.se
7944acbbfa Fixed BUG#6022: Stored procedure shutdown problem with self-calling function.
Fixed the pre-caching of functions. It now gives the expected stack overrun
  error for functions recursing too deep.
2004-10-23 13:30:05 +02:00
pem@mysql.comhem.se
ebf8dc0da6 Fixed BUG#6027: Stored procedures can be renamed.
Removed the support for renaming SPs. It's non-standard, conflicted with a standard
syntax, and was a bit broken anyway.
2004-10-22 19:05:17 +02:00
bell@sanja.is.com.ua
42d6d6765a 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-20 16:11:16 +03:00
bell@sanja.is.com.ua
4714a6e744 errors without code removed
net_printf/send_error calls replaced by my_error family functions
-1/1 (sent/unsent) error reporting removed
(WL#2133)
2004-10-20 04:04:37 +03:00
pem@mysql.comhem.se
4043c0f3db Implemented the stored procedure data access characteristics:
NO SQL
CONTAINS SQL (default)
READS SQL DATA
MODIFIES SQL DATA

These are needed as hints for the replication.
(Before this, we did have the default in the mysql.proc table, but no support in the parser.)
2004-10-14 18:07:09 +02:00
bell@sanja.is.com.ua
f797298fc5 fixed merged view fields names (BUG#5147)
support of merged VIEW over several tables added (WL#1809)
2004-09-14 19:28:29 +03:00
pem@mysql.comhem.se
b83af8607a Fixed BUG#5000: SPs can be created with no default database.
Easy to prevent crash, but the question was how to treat this case?
  We ended up implementing the "global" SPs (i.e. with no associated
  db), which were planned but left unresolved when SPs moved into dbs.
  So now things like "call .p()" work too.
2004-09-08 14:23:14 +02:00
pem@mysql.comhem.se
3aa2a62f37 Fixed BUG#5258: Stored procedure modified date is 0000-00-00.
Althought techically not a but (as it's functioning as designed),
  it was decided that the design should be changed. Some users have
  a problem with dates being '0000-00-00' and the SQL standard specifies
  that the modification date should be the same as the creation date
  at creation.
2004-09-08 11:42:18 +02:00
bell@sanja.is.com.ua
31dacc6ede Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-5.0
2004-09-02 07:52:29 +03:00
bell@sanja.is.com.ua
56d8567a3d adding mysql.proc to table list if view contains stored procedures (BUG#5151) 2004-09-01 19:00:41 +03:00
pem@mysql.comhem.se
f723438555 Fixed BUG#5251: mysql changes creation time of a procedure/function when altering. 2004-08-27 16:41:34 +02:00
pem@mysql.comhem.se
7e1b622639 Fixed BUG#4934: Caching issue with stored procedures.
...and added new test file, sp-threads, for multiple connection tests
  (apart from the security tests that are in sp-security).
2004-08-06 18:11:14 +02:00
konstantin@mysql.com
e67584151e Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/kostja/mysql/mysql-5.0-sap-new
2004-08-03 03:33:51 -07:00
konstantin@mysql.com
d3e520ce7e Port of cursors to be pushed into 5.0 tree:
- client side part is simple and may be considered stable
- server side part now just joggles with THD state to save execution
  state and has no additional locking wisdom.
  Lot's of it are to be rewritten.
2004-08-03 03:32:21 -07:00
pem@mysql.comhem.se
51eb64402a WL#2001: Optimize stored procedure code.
Added a simple optimizer that shortcuts jumps and skip unused instructions.
2004-08-02 18:05:31 +02:00
serg@serg.mylan
aa35efd292 after merge fixes 2004-07-22 00:26:33 +02:00
bell@sanja.is.com.ua
9336d36cf8 VIEW
two TABLE_LIST copy eliminated
2004-07-16 01:15:55 +03:00
monty@mysql.com
5b3c418b48 After merge fixes
Note: The following tests fails
- fulltext (Sergei has promised to fix)
- rpl_charset (Guilhem should fix)
- rpl_timezone (Dimitray has promised to fix)

Sanja needs to check out the calling of close_thread_tables() in sp_head.cc
2004-07-15 04:19:07 +03:00
monty@mysql.com
fa7f63d46d After merge fixes 2004-07-12 07:43:38 +03:00
pem@mysql.comhem.se
ecd424ac58 Fixed BUG#3339: Stored procedures in nonexistent schemas are uncallable.
Also added some related security tests and corrected related error messages.
2004-06-15 15:42:28 +02:00
pem@mysql.com
7aa3207cb3 Merge mysql.com:/usr/local/bk/mysql-5.0
into mysql.com:/home/pem/work/mysql-5.0-merge
2004-06-09 14:44:44 +02:00
pem@mysql.comhem.se
cc897576fe Fixed BUG#2564: SHOW CREATE inconsistent W.R.T ANSI_QUOTES.
It's not possible to quote the definition according to the current sql_mode
setting, so instead we use the setting stored with the SP (that's how it's
parsed anyway), and show this setting in the SHOW CREATE output.
2004-06-09 14:19:43 +02:00
pem@mysql.comhem.se
e3132d9a7c Fixed proper restoring of current db on errors.
This fixes part of BUG#3229: Stored procedure comment causes packets out of order.
2004-06-08 18:41:18 +02:00
monty@mysql.com
1d528a4d55 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
2004-05-11 12:21:38 +03:00
pem@mysql.comhem.se
d42b145817 Post-merge fixes, some quite complex. client/mysqlbinlog.cc and sql/log_event.cc
merged manually by guilhem.
2004-04-28 12:08:54 +02:00
monty@mysql.com
d54b3f8d25 Merge with 5.0 2004-03-26 13:20:05 +02:00
monty@mysql.com
034a2f357f Speed up things if mysql.proc doesn't exists 2004-03-26 13:14:40 +02:00
pem@mysql.comhem.se
5954e94fa7 Fixed BUG#3259: Stored procedure names are case sensitive.
Procedure names were unintentionally case-sensitive when read from the database
(but case-insensitive when fetched from the cache).
Note that the DB-part of qualified names is still case-sensitive (for consistency
with other usage in mysql).
2004-03-23 12:04:40 +01:00
pem@mysql.comhem.se
5476eb0709 WL#1366: Use the schema (db) associated with an SP.
Phase 4 (final): Remove associated stored procedures when a database is dropped.
2004-03-22 14:44:41 +01:00
pem@mysql.comhem.se
13987057f6 WL#1366: Use the schema (db) associated with an SP.
Phase 3: Made qualified names work for functions as well.
2004-03-19 19:01:54 +01:00
pem@mysql.com
786f823248 Merge 2004-03-18 15:08:17 +01:00
pem@mysql.comhem.se
0411f45801 Fix BUG#2674: Crash if return system variable in stored procedures.
Had to initialize some fields in lex before parsing an SP read from
mysql.proc.
2004-03-17 12:09:03 +01:00
pem@mysql.comhem.se
6c6bbba007 WL#1366: Use the schema (db) associated with an SP.
Phase 2: Make SPs belong to a DB, and use qualified names.
  As a side effect, using USE in an SP is no longer allowed.
  (It just doesn't work otherwise.)
2004-03-11 17:18:59 +01:00
pem@mysql.comhem.se
b205759949 WL#1366: Use the schema (db) associated with an SP.
Phase 1: Introduced sp_name class, for qualified name support.
2004-02-17 17:36:53 +01:00
pem@mysql.comhem.se
f9e73c7716 Post-merge fixes. 2004-02-11 18:21:55 +01:00
pem@mysql.comhem.se
a1ff4d65ff Fixed BUG#2267: Lost connect if stored procedure has SHOW FUNCTION STATUS.
(This might not be enough, could be more statements that must be detected...)
2004-01-14 18:18:29 +01:00
monty@mysql.com
26aae2abbb Fixed memory leaks in SP
Some code cleanup
2003-12-21 12:48:03 +02:00
monty@mysql.com
c6ed2a625b Update for VC++
(Fixed project files, compiler warnings etc..)
2003-12-21 02:07:45 +02:00
pem@mysql.comhem.se
7a1fddaa1f Renamed the "schema" column to "db" in mysql.proc to keep it in style with
all the other mysql.* tables.
2003-12-16 19:14:10 +01:00
pem@mysql.comhem.se
45e5896363 Fixed various memory leaks. 2003-12-15 13:24:16 +01:00
pem@mysql.comhem.se
07541b6abf WL#1365: Implement definer's rights execution of stored procedures.
(Also put the hostpart back in the definer column.)
2003-12-13 16:40:52 +01:00
pem@mysql.comhem.se
2796e299e6 Don't want host in the definer's column. 2003-12-12 14:12:38 +01:00
pem@mysql.comhem.se
7a20e5282e In order to make ALTER PROCEDURE|FUNCTION work correctly, and in general to
make characteristics (and SHOW) work right, we had to separate the old
definition blob in the mysql.proc table into separate fields for parameters,
return type, and body, and handle the characteristics (like SQL SECURITY)
separately... and then reassemble the CREATE string for parsing, of course.
This is rather ugly, mostly the parser bit. (Hopefully that will be better
with the new parser.)
2003-12-12 14:05:29 +01:00
pem@mysql.comhem.se
7bfbfc308f WL#1364: Store some environmental values with SPs and use at invokation
sql_mode is stored and used with SPs.
sql_select_limit is always unlimited in SPs.
2003-12-11 12:23:50 +01:00
pem@mysql.comhem.se
b27e9d6052 WL#1363: Update the mysql.proc table and add new fields.
Also made the parsing and handling of SP characteristics
more general and extendable, and added a few ch:istics.
2003-12-10 19:05:37 +01:00
pem@mysql.comhem.se
96f1252899 Bugfixes in SHOW CREATE PROCEDURE/FUNCTION and SHOW PROCEDURE/FUNCTION STATUS;
- dropped routines should not show up in status
- error handling for non-existing routines

+ some cleanup.
2003-11-20 15:07:22 +01:00
gluh@gluh.mysql.r18.ru
ee4ed0c969 WL#1241: SHOW PROCEDURE/FUNCTION
WL#1263: Support for the attributes COMMENT and SUID
         in CREATE/ALTER PROCEDURE/FUNCTION
2003-11-17 21:21:36 +04:00
pem@mysql.comhem.se
055559bcaa Added more error handling for abnormal cases (like a broken mysql.proc table). 2003-10-30 10:25:45 +01:00
pem@mysql.comhem.se
70ea503662 Bugfix of previous WL#1265 commit.
Need a sp_cache_remove() function with implicit name lookup to make the WL task
to work. It's a cleaner and more convenient interface anyway...
2003-10-21 18:13:14 +02:00
pem@mysql.comhem.se
e42a724fa7 WL#1265: Fix proper ALTER/DROP support in the SP cache.
New sp_cache C API. When an SP is dropped, old caches (in other threads)
become invalid and are cleared.
Also, the caches in THD are only created on demand.
2003-10-21 12:08:35 +02:00
pem@mysql.telia.com
6e55a3428a Post-merge fixes. 2003-09-24 15:26:20 +02:00
pem@mysql.telia.com
b8e4dc03d8 Fix bug in sp.cc:db_find_routine() which made tables remain open in some cases. 2003-09-17 12:30:05 +02:00
pem@mysql.telia.com
a8a29a39d2 Merging 4.1 into 5.0 (second pass; post-merge fixes).
One test in subselect.test still wrong.
Had to reconstruct all errmsg.txt files completely, since auto-merge made
a mess of the lot. :-(
2003-07-09 17:07:12 +02:00
pem@mysql.com
c908b555ff Fixed the old kludge for pre-loading functions and made it more efficient
using a hash table instead (and made it work with lex pointers).
Some additional code cleanup too.
2003-07-07 14:55:10 +02:00
pem@mysql.com
6d225437ed Code cleanup (and moved sp cache to separate file). 2003-07-03 15:58:37 +02:00
pem@mysql.com
1d3c703d58 SP cache (WL#730). (Mostly by vva, additions by pem.) 2003-07-01 18:14:24 +02:00
pem@mysql.com
4006e95808 Bugfixes for the sp_head memroot stuff. 2003-07-01 17:19:48 +02:00
pem@mysql.com
9f14ae7516 sp_head now has its own mem_root (WL#961).
Also fixed some difficult memory leaks that became apparent
in this task.
2003-06-29 18:15:17 +02:00
gluh@gluh.mysql.r18.ru
7c6522a74e 'Expand the mysql.proc table to include (almost) all fields' task(851)
Fix after review
2003-06-02 14:25:01 +05:00
pem@mysql.com
4523a7b179 Adopt SP stuff to the new lex pointer. 2003-05-23 15:32:31 +02:00
vva@eagle.mysql.r18.ru
384b10e2af Merge eagle.mysql.r18.ru:/home/vva/work/mysql.orig/clear/mysql-5.0
into eagle.mysql.r18.ru:/home/vva/work/LEX_PTR/mysql-5.0
2003-05-14 19:48:58 -04:00
gluh@gluh.mysql.r18.ru
33cabdc3b1 Expand the mysql.proc table 2003-05-06 21:09:20 +05:00
vva@eagle.mysql.r18.ru
afd581edd3 made lex a pointer in THD 2003-05-05 14:54:37 -04:00
pem@mysql.com
6c85c6aa6a Post-fix of bug #302 fix.
Fixed bug #320.
Some new tests and cosmetic changes.
Another strcasecmp() replaced.
2003-04-27 17:35:54 +02:00
pem@mysql.com
462430ba55 Post merge fixes. 2003-04-04 15:47:43 +02:00
pem@mysql.com
5c4122d3e0 Fixed the last memory leaks in the SP code. 2003-04-03 20:00:52 +02:00
pem@mysql.com
c673fcb813 Getting rid of lots of memory leaks (but not quite all of them yet,
some will go away when temporary code is replaced).
2003-04-02 20:42:28 +02:00
pem@mysql.com
9b6d015a85 ...and got rid of the strncasecmps too. 2003-03-27 17:47:25 +01:00
pem@mysql.com
ac44a5f66e Replaced a couple of strcasecmps. 2003-03-27 17:35:27 +01:00
pem@mysql.com
8049daf202 Made FUNCTIONs work in insert and select queries, as well as nested function invocations.
Had to add a cahing mechanism which is in parts an ugly kludge, but it will be
reworked once the real SP caching is implemented.
2003-03-02 19:17:41 +01:00
pem@mysql.com
b6ab762dc1 Closing tables during SP execution the proper way. 2003-02-28 15:07:14 +01:00
pem@mysql.com
ca2e77ca7a Made stored FUNCTION invokation work almost always. Still buggy and unstable, and
various known problems, but good enough for a checkpoint commit.
2003-02-26 19:22:29 +01:00
pem@mysql.com
d8c75ec8aa Most of the groundwork for sprint task 729 (implement FUNCTIONs).
Expanded the mysql.proc table, reworked the find/create/drop functions
completely, added new functions for FUNCTIONs (lotta functions here :),
got rid of some unnecessary use of Item_strings while at it. Extended
the parser correspondingly, and fiddled around a bit to make SP FUNCTIONs
coexist with UDFs.
Can now CREATE and DROP FUNCTIONs. Invoking yet to come...
2003-02-21 17:37:05 +01:00
pem@mysql.com
02211a600b Post-merge fixes (adapting new SP code to 4.1 changes). 2003-02-18 19:58:03 +01:00
pem@mysql.com
d53fc31958 Fixed some DBUGing, and optimized SET slightly. 2003-02-12 16:17:03 +01:00
pem@mysql.com
f2d6ec9321 Some new stuff in the Docs/sp-* files, and renamed a few functions in preparation
for future work.
2003-02-04 17:40:18 +01:00
pem@mysql.com
77b671f594 Moved create/find/drop functions to a separate files (sp.cc,sp.h).
Fixed backpatching of forward jumps.
Implemented LOOP, WHILE, REPEAT (temporarily known as SPREPEAT).

Known bug: Expression evaluation still not quite ok (e.g. "x > 0"),
which is why IF and CASE is not yet implemented.
2002-12-12 13:14:23 +01:00