Commit graph

37 commits

Author SHA1 Message Date
malff/marcsql@weblab.(none)
21f00113b4 Bug#8153 (Stored procedure with subquery and continue handler, wrong result)
Before this fix,
- a runtime error in a statement in a stored procedure with no error handlers
was properly detected (as expected)
- a runtime error in a statement with an error handler inherited from a non
local runtime context (i.e., proc a with a handler, calling proc b) was
properly detected (as expected)
- a runtime error in a statement with a *local* error handler was executed
as follows :
a) the statement would succeed, regardless of the error condition, (bug)
b) the error handler would be called (as expected).

The root cause is that functions like my_messqge_sql would "forget" to set
the thread flag thd->net.report_error to 1, because of the check involving
sp_rcontext::found_handler_here().
Failure to set this flag would cause, later in the call stack,
in Item_func::fix_fields() at line 190, the code to return FALSE and consider
that executing the statement was successful.

With this fix :
- error handling code, that was duplicated in different places in the code,
is now implemented in sp_rcontext::handle_error(),
- handle_error() correctly sets thd->net.report_error when a handler is
present, regardless of the handler location (local, or in the call stack).

A test case, bug8153_subselect, has been written to demonstrate the change
of behavior before and after the fix.

Another test case, bug8153_function_a, as also been writen.
This test has the same behavior before and after the fix.
This test has been written to demonstrate that the previous expected
result of procedure bug18787, was incorrect, since select no_such_function()
should fail and therefore not produce a result.

The incorrect result for bug18787 has the same root cause as Bug#8153,
and the expected result has been adjusted.
2006-08-02 22:18:49 -07:00
msvensson@shellback.(none)
2d5634b592 Add extre DBUG_PRINT in push_warning 2006-03-16 12:06:39 +01:00
pem@mysql.com
e585315703 Additional fix for BUG#7049, after review.
Make sure "select" aborts when finding a SP condition handler beyond the current scope.
2005-10-17 15:07:47 +02:00
bell@sanja.is.com.ua
15d02e60e1 merge 2005-07-05 11:38:05 +03:00
bell@sanja.is.com.ua
b49b5805eb abort storing query to query cache if warnings appeared (BUG#9414) 2005-06-28 00:52:21 +03:00
konstantin@mysql.com
9f379d7f05 Patch two (the final one) for Bug#7306 "the server side preparedStatement
error for LIMIT placeholder".
The patch adds grammar support for LIMIT ?, ? and changes the
type of ST_SELECT_LEX::select_limit,offset_limit from ha_rows to Item*,
so that it can point to Item_param.
2005-06-07 14:11:36 +04:00
konstantin@mysql.com
f0233c2e3d Fix show warnings limit 0 and show warnings limit 0, 0.
Add test coverage for SHOW WARNINGS LIMIT a, b;
2005-06-04 14:58:32 +04:00
pem@mysql.comhem.se
057b8aa9a8 Fixed BUG#9004: Inconsistent behaviour of SP re. warnings 2005-04-22 12:53:48 +02:00
monty@mysql.com
48de1ff277 Don't generate message in send_kill_message() if wrong data. (Caused core dump for wrong data in ALTER TABLE on some system) 2005-04-05 01:19:48 +03:00
monty@mysql.com
1be0a0c82a Now one gets an error if one tries to insert an invalid value via a stored procedure in STRICT mode. (Bug #5907) 2005-04-05 00:32:48 +03: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
marty@linux.site
e6d7c9fc5d Fix for Bug #8897 Test ndb_autodiscover: Spurious warning in --ps-protocol on NDB 2005-03-09 14:29:22 +01:00
monty@mysql.com
cd78e701a5 Show all generated warnings in SHOW ERROR
Previously we only stored the first given error (the error sent to the client)
2005-02-24 23:33:42 +02:00
lars@mysql.com
c60e676371 Manual merge 4.1->5.0 2005-02-22 22:42:49 +01:00
lars@mysql.com
1d3c67000b BUG#6662: Changes after Guilhems and Sergs review 2005-02-22 12:40:31 +01:00
lars@mysql.com
be28ef0a20 BUG#6662: Importing mysqldumps should not show any warnings of level "notes". 2005-02-21 18:40:28 +01: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
monty@mysql.com
6fbc869d18 A lot of fixes for prepared statements (PS):
New mysqltest that can run mysqltest with PS
Added support for ZEROFILL in PS
Fixed crash when one called mysql_stmt_store_result() without a preceding mysql_stmt_bind_result()
Updated test cases to support --ps-protocol
(Some tests are still run using old protocol)
Fixed crash in PS when using SELECT * FROM t1 NATURAL JOIN t2...
Fixed crash in PS when using sub queries
Create table didn't signal when table was created. This could cause a "DROP TABLE created_table" in another thread to wait "forever"
Fixed wrong permissions check in PS and multi-table updates (one could get permission denied for legal quries)
Fix for PS and SELECT ... PROCEDURE
Reset all warnings when executing a new PS query
group_concat(...ORDER BY) didn't work with PS
Fixed problem with test suite when not using innodb
2004-10-26 19:30:01 +03: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
monty@mysql.com
ede8169d24 Added missing SSL library (Should be in source distribution)
Fixed compiler warnings (a lot of hidden variables detected by the Forte compiler)
Added a lot of 'version_xxx' strings to 'show variables'
Prevent copying of TMP_TABLE_PARAM (This caused core dump bug on Solaris)
Fixed problem with printing sub selects to debug log
2003-11-28 12:18:13 +02:00
venu@myvenu.com
eb137c063c Support of warnings for all DML statements (Insert, Update and Alter)
Fix LOAD DATA INFILE warnings to have a better meanigful messages
Fix to make the mysql command line to automatically show the warnings count for all basic commands
2003-04-30 00:02:28 -07:00
monty@narttu.mysql.fi
4a4838059f Fixed bug in warning handling (Memory was allocated from wrong MEM_ROOT) 2003-04-03 21:19:14 +03:00
wax@kishkin.ru
74e32241c4 Auto merged 2003-04-02 18:15:16 +06:00
lenz@mysql.com
1c3047360c - fixed comments so mysql_copyright does not eat the whole files 2003-03-25 13:46:10 +01:00
monty@narttu.mysql.fi
48a9c1239c Added support for ULONG division with DIV
Fixed non fatal memory leak in slave code.
2003-03-19 21:23:13 +02:00
wax@kishkin.ru
12f1cb55b5 This is full commit of group_concat with support subselects 2003-03-18 04:07:40 +05:00
bar@bar.mysql.r18.ru
caf31a0790 Preparing to client<->server autoconvert 2003-03-17 13:14:04 +04:00
monty@mashka.mysql.fi
1f6ecc0cd3 Changed mysql-test to print warnings for not existing table to DROP TABLE
Cleaned up test; Removed wrong DROP TABLE commands and use standard table and database names.
changed store_warning() -> push_warning_print()
2003-01-06 01:48:59 +02:00
monty@mashka.mysql.fi
d49167bae5 Fixes for binary protocol (complement to last push)
Changed timestamp to return string in YYYY-MM-DD HH:MM:SS format.
DATE_ADD() and related functions now returns correct DATE/DATETIME type depending on argument types.
Now all tests passes, still some work left to remove warnings in log files from mysql-test-run
2002-12-14 17:43:01 +02:00
monty@mashka.mysql.fi
d3eb993a27 rename of net_pkg.cc to protocol.cc
Class for sending data from server to client (Protocol)
This handles both the old ( <= 4.0 ) protocol and then new binary protocol that is used for prepared statements.
2002-12-11 09:17:51 +02:00
venu@myvenu.com
9e4dc3fba5 sql_error.cc:
make tests to go ; becuase of DROP TABLE ID EXISTS warnings
2002-12-05 12:34:22 -08:00
venu@myvenu.com
91558620e0 Return a warning for DROP DATABASE/TABLE IF EXISTS <non_existing_db/table(s)> 2002-12-04 03:19:08 -08:00
venu@myvenu.com
a9aebd433d protocol merge 2002-11-22 10:20:14 -08:00
venu@myvenu.com
b74c43f475 protocol fixups 2002-11-22 10:04:42 -08:00
monty@mashka.mysql.fi
305d16a7cb Automatic conversion from CHAR(length) to BLOB when length > 255
New operators MOD and DIV
SELECT ... FROM DUAL
TRUE = 1 and FALSE = 0
2002-11-21 02:07:14 +02:00
monty@mashka.mysql.fi
d69250a969 Fixes and code cleanups after merge with 4.0.3
Warning handling and initial prepared statement handling (last not complete yet)
Changed a lot of functions that returned 0/1 to my_bool type.
GRANT handling now uses read/write locks instead of mutex
Change basic net functions to use THD instead of NET
(needed for 4.1 protocol)
Use my_sprintf instead of sprintf() + strlen()
Added alloc_query() to be able to chare query initialization code with
prepared statements.
Cleanup handling of SHOW COUNT(*) WARNINGS and SELECT LAST_INSERT_ID()

Note that the following test fails (will be fixed ASAP):
sub_select, union, rpl_rotate_logs and rpl_mystery22
2002-10-02 13:33:08 +03:00
venu@myvenu.com
5a33842a16 sql_error.cc, sql_prepare.cc:
new file

  Client-server protocol 4.1 changes - Server side:

 * Enhanced metadata information:
    - SHOW [COUNT(*)] ERRORS [LIMIT [offset,] rows]
    - SHOW [COUNT(*)] WARNING [LIMIT [offset,] rows]
    - SHOW TABLE TYPES
    - SHOW PRIVILEGES
    - SHOW COLUMN TYPES (Not fully implemented)

 * Prepared execution
 * Long data handling in pieces
 * And other misc changes
2002-06-12 14:13:12 -07:00