Commit graph

397 commits

Author SHA1 Message Date
sergefp@mysql.com
749d78fcd4 Merge mysql.com:/home/psergey/mysql-5.0-bug14026-r2
into mysql.com:/home/psergey/mysql-5.0-oct03-push
2005-11-03 16:21:21 +03:00
msvensson@neptunus.(none)
06c17bac2a Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0
2005-10-28 19:10:05 +02:00
bell@sanja.is.com.ua
6143c6543e Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-owner7-5.0
2005-10-28 00:24:13 +03:00
bell@sanja.is.com.ua
1b164c7b83 support of view underlying tables and SP functions security check added (BUG#9505) (WL#2787) 2005-10-28 00:18:23 +03:00
msvensson@neptunus.(none)
905658fc9a Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/bug12258/my50-bug12258
2005-10-26 15:06:17 +02:00
msvensson@neptunus.(none)
b8fdad5d26 Merge neptunus.(none):/home/msvensson/mysql/bug12258/my41-bug12258
into  neptunus.(none):/home/msvensson/mysql/bug12258/my50-bug12258
2005-10-26 14:15:04 +02:00
msvensson@neptunus.(none)
ac895b0342 Bug #12258 mysql_client_test failure on FC4
- Fix for gcc 4.0.1, use cast packet arg local variable
2005-10-26 14:14:08 +02:00
sergefp@mysql.com
1441f1c188 BUG#13126: When choosing join order for join with nested joins, don't produce join
orders that cannot be handled by the executioner.
2005-10-25 19:28:27 +04:00
anozdrin@mysql.com
6105040ac4 Fix for BUG#13095: Cannot create VIEWs in prepared statements
- allow CREATE VIEW as well as DROP VIEW to use in prepared statements;
  - fix CREATE VIEW implementation to make it work in prepared statements.
2005-10-25 00:54:04 +04:00
monty@mysql.com
f5fdf3e87a Reviewing new pushed code
- CHAR() now returns binary string as default
- CHAR(X*65536+Y*256+Z) is now equal to CHAR(X,Y,Z) independent of the character set for CHAR()
- Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
  (Some old systems returns ETIME and it's safer to test for both values
   than to try to write a wrapper for each old system)
- Fixed new introduced bug in NOT BETWEEN X and X
- Ensure we call commit_by_xid or rollback_by_xid for all engines, even if one engine has failed
- Use octet2hex() for all conversion of string to hex
- Simplify and optimize code
2005-10-12 00:58:22 +03:00
monty@mysql.com
17d7ba931d Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2005-10-08 03:37:23 +03:00
monty@mysql.com
f577ebb88f Simple changes during review of code
Added back flag that I accidently removed in last patch
2005-10-08 00:57:40 +03:00
monty@mysql.com
78e828d32f Review of code pushed since last 5.0 pull:
Ensure that ccache is also used for C programs
mysql: Ensure that 'delimiter' works the same way in batch mode as in normal mode
mysqldump: Change to use ;; (instead of //) as a stored procedure/trigger delimiter
Fixed test cases by adding missing DROP's and rename views to be of type 'v#'
Removed MY_UNIX_PATH from fn_format()
Removed current_db_used from TABLE_LIST
Removed usage of 'current_thd' in Item_splocal
Removed some compiler warnings
A bit faster longlong2str code
2005-10-06 17:54:43 +03:00
konstantin@mysql.com
2d4c54ba1b Merge mysqldev@production.mysql.com:my/mysql-5.0-release
into  mysql.com:/opt/local/work/mysql-5.0-root
2005-09-23 00:46:59 +04:00
evgen@moonbone.local
2ba1eb1486 Manual merge 2005-09-22 02:38:14 +04:00
konstantin@mysql.com
6f8d3c4844 A fix and a test case for Bug#6513 "Test Suite: Values inserted by using
cursor is interpreted latin1 character and Bug#9819 "Cursors: Mysql Server
Crash while fetching from table with 5 million records."
A fix for a possible memory leak when fetching into an SP cursor
in a long loop.
The patch uses a common implementation of cursors in the binary protocol and 
in stored procedures and implements materialized cursors.
For implementation details, see comments in sql_cursor.cc
2005-09-22 02:11:21 +04:00
evgen@moonbone.local
b7e8c8b112 Fix bug #13180 thd->allow_sum_funcs wasn't reset before query processing.
thd->allow_sum_func was left 'true' after previous statement thus allowing
sum funcs to be present in conditions.

thd->allow_sum_func should be set to 0 for each query and each prepared
statement reinitialization. This is done in lex_start() and 
reset_stmt_for_execute().
2005-09-22 01:38:39 +04: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
gluh@mysql.com
2184915127 Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/gluh/MySQL/Bugs/5.0.cml
2005-09-14 12:11:19 +05:00
gluh@eagle.intranet.mysql.r18.ru
cc395fc0c2 Bug#9683 INFORMATION_SCH: Creation of temporary table allowed in
Information_schema DB 
Bug#9846 Inappropriate error displayed while
         dropping table from 'INFORMATION_SCHEMA'
Bug#10734 Grant of privileges other than 'select' and 
         'create view' should fail on schema 
Bug#10708 SP's can use INFORMATION_SCHEMA as ROUTINE_SCHEMA

 cumulative fix for bugs above(after review, 2nd version)
 added privilege check for information schema db & tables
2005-09-13 16:07:38 +05:00
kent@mysql.com
ffc213a192 sql_prepare.cc:
VC6 can't handle initializing const in declaration
2005-09-13 10:15:48 +02:00
konstantin@mysql.com
38486e83c1 Implement WL#2661 "Prepared Statements: Dynamic SQL in Stored Procedures".
The idea of the patch is to separate statement processing logic,
such as parsing, validation of the parsed tree, execution and cleanup, 
from global query processing logic, such as logging, resetting
priorities of a thread, resetting stored procedure cache, resetting
thread count of errors and warnings.
This makes PREPARE and EXECUTE behave similarly to the rest of SQL
statements and allows their use in stored procedures.
This patch contains a change in behaviour:
until recently for each SQL prepared statement command, 2 queries
were written to the general log, e.g.
[Query]   prepare stmt from @stmt_text;
[Prepare] select * from t1 <-- contents of @stmt_text
The chagne was necessary to prevent [Prepare] commands from being written
to the general log when executing a stored procedure with Dynamic SQL.
We should consider whether the old behavior is preferrable and probably
restore it.
This patch refixes Bug#7115, Bug#10975 (partially), Bug#10605 (various bugs
in Dynamic SQL reported before it was disabled).
2005-09-03 03:13:18 +04: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
elliot@mysql.com
55b81af671 Merge mysql.com:/home/emurphy/src/bk-clean/mysql-4.1
into  mysql.com:/home/emurphy/src/work/mysql-5.0
2005-08-19 15:29:30 -04:00
elliot@mysql.com
d9efe655ed Bug#11338 Fixes from review (identical functionality). 2005-08-19 14:49:34 -04:00
elliot@mysql.com
197782605f BUG#11338 (logging of prepared statement w/ blob type)
In cp932, '\' character can be the second byte in a 
multi-byte character stream. This makes it difficult to use
mysql_escape_string. Added flag to indicate which languages allow
'\' as second byte of multibyte sequence so that when putting a prepared
statement into the binlog we can decide at runtime whether hex encoding
is really needed.
2005-08-17 04:26:32 -04:00
dlenev@mysql.com
0f75d64734 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg11973-2
2005-08-11 10:39:33 +04: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
sergefp@mysql.com
fbab5fc568 BUG#12228: Post review fixes: Added test case, code cleanup. 2005-08-10 21:17:02 +00:00
dlenev@mysql.com
60511c3df2 Clumsy but working fix for bug #11973 "SELECT .. INTO var_name; in trigger
cause crash on update".

Let us update "thd" pointer in LEX, all its units and in LEX::result before
executing statement in trigger body, since triggers are associated with TABLE
object and because of this can be used in different threads.
2005-08-10 00:23:56 +04: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
konstantin@mysql.com
043f77ccdf A fix and a test case for Bug#11909 "mysql_stmt_attr_set
CURSOR_TYPE_READ_ONLY nested queries corrupt result"
2005-08-08 19:24:56 +04: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
georg@lmy002.wdf.sap.corp
7344bae480 Merge grichter@bk-internal.mysql.com:/home/bk/mysql-5.0
into lmy002.wdf.sap.corp:/home/georg/work/mysql/prod/mysql-5.0
2005-07-29 16:11:49 +02:00
monty@mysql.com
e60d786dde Ensure we free all items for prepared statements
Before the fix in ~Prepared_statments we got a memory leak when executing mysql_client_test.test
Note that test 'variables.test' fails.
This will be fixed when Jimw pushes the fix for Bug 10351
2005-07-29 05:06:35 +03:00
georg@lmy002.wdf.sap.corp
e676faa789 fix for bug#9968 (slow query log contains useless entries)
Query has to be written to the log before calling
thd->set_statement(&stmt_backup), otherwise query will be empty.
Setting thd->enabe_slow_log to FALSE prevents that dispatch_command
logs the (empty) query again.
2005-07-27 12:45:32 +02:00
jimw@mysql.com
2a06e5756e Merge bk-internal:/home/bk/mysql-5.0
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-07-19 19:59:32 -07:00
konstantin@mysql.com
14344b658a A fix and a test case for Bug#10760 and complementary cleanups.
The idea of the patch
is that every cursor gets its own lock id for table level locking.
Thus cursors are protected from updates performed within the same 
connection. Additionally a list of transient (must be closed at
commit) cursors is maintained and all transient cursors are closed
when necessary. Lastly, this patch adds support for deadlock
timeouts to TLL locking when using cursors.
+ post-review fixes.
2005-07-19 22:21:12 +04:00
jimw@mysql.com
80c1c6b33f Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-07-19 11:05:49 -07:00
monty@mishka.local
7e83d09ce7 Simple fixes during review of new code 2005-07-19 19:25:05 +03:00
monty@mishka.local
2278e0319c Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mishka.local:/home/my/mysql-5.0
2005-07-18 19:03:01 +03:00
monty@mishka.local
78c65b5adc Cleanups during review
Changed defaults option --instance to --defaults-group-suffix
Changed option handling to allow --defaults-file, --defaults-extra-file and --defaults-group-suffix to be given in any order
Changed MYSQL_INSTANCE to MYSQL_GROUP_SUFFIX
mysql_print_defaults now understands --defaults-group-suffix
Remove usage of my_tempnam() (not safe function)
if( -> if ( and while( to while (
2005-07-18 15:33:18 +03:00
tomas@poseidon.ndb.mysql.com
cd590a6a02 Merge poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-release
into poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-new
2005-07-15 13:32:08 +02:00
lenz@mysql.com
d9de51cf23 Merge mysql.com:/space/my/mysql-4.1.13-clone
into mysql.com:/space/my/mysql-5.0-build
2005-07-15 09:23:36 +02:00
ramil@mysql.com
07d4f27195 Jim's fix for the #10443.
Fix handling of floats and doubles when using prepared statements             
API in the embedded server.
2005-07-15 11:17:57 +05:00
konstantin@mysql.com
509531421c Implement MarkM optimization request to avoid redundnat packet exchange
in cursors.
2005-07-14 15:27:24 +04:00
konstantin@mysql.com
618f7d9449 Merge mysql.com:/opt/local/work/mysql-4.1-11458
into  mysql.com:/opt/local/work/mysql-5.0-root
2005-07-13 18:05:57 +04:00
konstantin@mysql.com
bef558b7ee - a fix for Bug#11458 "Prepared statement with subselects return random
data": remove the fix for another bug (8807) that
added OUTER_REF_TABLE_BIT to all subqueries that used a placeholder
to prevent their evaluation at prepare. As this bit hanged in 
Item_subselect::used_tables_cache for ever, a constant subquery with
a placeholder was never evaluated as such, which caused wrong 
choice of the execution plan for the statement.
- to fix Bug#8807 backport a better fix from 5.0
- post-review fixes.
2005-07-13 17:38:55 +04:00