Commit graph

406 commits

Author SHA1 Message Date
monty@mysql.com
3eaa953529 Cleanups and optimization during review of new code 2005-08-18 03:12:42 +03:00
bell@sanja.is.com.ua
7f48830f9e sql_view.cc:
correct exit from mysql_create_view to restore ennvironment (BUG#12468)
view.result, view.test:
  test of CRETE VIEW in SP
2005-08-17 22:42:53 +03:00
evgen@moonbone.local
5dc75a559d Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into moonbone.local:/work/mysql-5.0-bug-11864
2005-08-15 13:21:55 +04:00
sanja@hasky.mysql.fi
562786bc36 table.cc:
remove unneeded multitable_view assignment
sql_view.cc:
  fix potential memorry overrun in ref_array
  asssign multitable_view in time of view creation (BUG#12569)
2005-08-13 17:06:30 +03:00
igor@rurik.mysql.com
3f1f7102ca sql_view.cc:
A safety correction.
2005-08-12 02:17:27 -07:00
evgen@moonbone.local
baf0c9ad08 Fix bug #11864 non unique names are allowed in subquery
Column names weren't checked for uniqueness for subqueries.

Code for names uniqueness checking used for view creation moved into 
separate function named check_duplicate_names(). It's called on 
preparation of subqueries to check uniqueness of names. If duplicate names 
are found then error is raised.
2005-08-10 17:45:00 +04:00
bell@sanja.is.com.ua
4c69fbe632 issue correct error message in case of view presence for duplicated table on update (BUG#10773)
frequently used command sequence replaced with inline function
2005-08-02 22:54:49 +03:00
monty@mishka.local
e73d6c25fd Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mishka.local:/home/my/mysql-5.0
2005-07-31 12:56:02 +03:00
monty@mishka.local
8437e9c1be Fixes during review of new pushed code
Change bool in C code to my_bool
Added to mysqltest --enable_parsning and --disable_parsing to avoid to have to comment parts of tests
Added comparison of LEX_STRING's and use this to compare file types for view and trigger files.
2005-07-31 12:49:55 +03:00
bell@sanja.is.com.ua
b220fc47ef store/restore sql_mode which was in force during ctrigger creation (BUG#5891)
other sql_mode fixes
2005-07-28 22:39:11 +03:00
igor@igor-inspiron.creware.com
db28fb113e view.test, view.result:
Expanded the test case for bug #6120 to cover
  DROP VIEW / CREATE VIEW scenario.
sql_view.cc:
  Expanded the fix for bug #6120 to cover the case of
  DROP VIEW / CREATE_VIEW.
2005-07-12 10:44:32 -07:00
igor@igor-inspiron.creware.com
e5bd22ff06 view.result, view.test:
Added a test case for bug #6120.
sql_view.cc:
  Fixed bug #6120.
  The SP cache must be invalidated when a view is altered.
2005-07-06 09:00:17 -07: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
6201504db9 fixed difference between ps-protocol and usual execution 2005-07-02 13:16:30 +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
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
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
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
igor@rurik.mysql.com
3351233349 Manual merge 2005-05-10 16:41:47 -07:00
igor@rurik.mysql.com
9d4b228b61 Many files:
Fixed bug #8528.
  Representation for single-table views was made similar to
  representation for multi-table views.
view.test:
  Added test case for bug #8528.
view.result:
  Added test case for bug #8528. Fixed other test cases.
2005-05-10 16:31:13 -07:00
dlenev@brandersnatch.localdomain
d60674d665 Fix for bug #9841 "Unexpected read lock when trying to update a view in
a stored procedure" (version 2).

To handle updates and inserts into view in SP properly we should set
lock types for tables of the view's main select when we are opening
view for prelocking purproses.
2005-05-05 19:49:15 +04:00
sergefp@mysql.com
51064c0575 Fix for BUG#10107: Memory leak in view over subquery:
In mysql_make_view when joining subquery lists, take into account that both lists
can have length > 1 (see also fix for BUG#8490) 
(note to bk trigger: this commit is about BUG#10107)
2005-04-23 06:55:43 +04:00
sergefp@mysql.com
307c0cf908 Fix for BUG#8490: In mysql_make_view for join algorithm views we need
to insert view's subqueries into select_lex->slave(->next)* chain. 
In case a join has several such views, don't add the same subqueries several times
(this forms a loop on the above chain which breaks many parts of the code)
2005-04-23 00:13:46 +04:00
bell@sanja.is.com.ua
51b17c974d Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-multi-5.0
2005-04-03 15:30:18 +03:00
bell@sanja.is.com.ua
e2a83fca56 - stackoverflow check added for view of view processing
- fixed bug in join view processing
- postreview fixes (BUG#9398 & BUG#8703)
2005-04-03 01:23:45 +03:00
bell@sanja.is.com.ua
4e916e251b postreview patch 2005-04-02 18:45:44 +03:00
bell@sanja.is.com.ua
3061a749e6 fix of required privileges for altering view VIEW (DELETE->DROP) (BUG#9260) 2005-04-02 18:05:00 +03:00
bell@sanja.is.com.ua
1029e533df postmerge 4.1->5.0 fixes 2005-04-01 02:14:30 +03:00
dlenev@brandersnatch.localdomain
c24820834a Fix for memory leak which was introduced by patch improving locking in SP.
Made mysql_make_view() to call destructor for st_lex_local objects before
throwing them away (this happens in case of error).
2005-03-04 20:54:24 +03: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
bell@sanja.is.com.ua
eb4fb7253d Merge 2005-02-09 00:31:56 +02: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
bell@sanja.is.com.ua
34b85449bb fixed QC invaluidation and processing with view (BUG#8050) (BUG#8054) 2005-01-27 14:21:37 +02:00
monty@mysql.com
de4ec3ed30 Fix accesses to uninitialized memory (found by valgrind) 2005-01-13 03:02:49 +02: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
a8a5f3590c fixed bugs in view code with prepared statemnts 2005-01-04 18:04:16 +02:00
monty@mysql.com
d71c030587 After merge fixes 2004-12-31 00:44:00 +02:00
monty@mysql.com
75d0958dc3 After merge fixes
Fixed compiler warnings
Fix core dump when sending SIGHUP to mysqld
2004-12-06 17:15:54 +02:00
bell@sanja.is.com.ua
5f64e02228 fixed redifinition of variable 2004-11-26 12:28:12 +02:00
bell@sanja.is.com.ua
a1cac9687e spelling fixed/comments added (postreview fixes) 2004-11-25 09:28:32 +02:00
bell@sanja.is.com.ua
1e3d8b0839 post-merge fix 2004-11-25 02:23:13 +02:00
bell@sanja.is.com.ua
072d38eb12 merge 2004-11-21 20:08:12 +02:00
bell@sanja.is.com.ua
8ca32a4ef6 merge 2004-11-21 10:12:11 +02:00
gluh@gluh.mysql.r18.ru
15ada105ac changed field names, fields order according to WL description
fixed bug: "create view v7 as select * from information_schema.tables;" failed
2004-11-20 01:17:18 +03:00
bell@sanja.is.com.ua
f8edd9f9f1 fixing compiler warnings 2004-11-17 14:17:09 +02:00
bell@sanja.is.com.ua
d76db8b999 marge 2004-11-13 19:45:36 +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
gluh@gluh.mysql.r18.ru
321f803784 WL#1629: SHOW with WHERE(partially) &
WL#173:  Create Data Dictionary Tables for SHOW Commands
2004-11-13 13:56:39 +03: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
monty@mysql.com
0ebc50b851 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
2004-11-09 21:47:46 +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
bell@sanja.is.com.ua
7eae926e26 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-view-5.0
2004-11-06 12:46:46 +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
bell@sanja.is.com.ua
13f249a025 VIEW support for CHECK TABLE command (WL#1984) 2004-10-28 19:37:25 +03:00
bell@sanja.is.com.ua
3d389a038e fixed detection of updating table on which we select (BUG#6032) 2004-10-25 17:32:28 +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
bell@sanja.is.com.ua
78997a2acd allow merging views with subqueries in WHERE clause (BUG#5504) 2004-10-07 22:54:31 +03:00
bell@sanja.is.com.ua
d73ba9660d test of DELETE privilege and cyclic reference added in case of altering view (BUG#5148)
fixed ALTER VIEW syntax
fixed WITH CHECK OPTION clause printing in SHOW CREATE VIEW
2004-10-07 15:43:04 +03:00
bell@sanja.is.com.ua
da5a55e3cd sql_updatable_view_key replaced with updatable_views_with_limit
now default behaviour do not prevent any updates of view.
Also updating VIEWs of queries without LIMIT clause will not be checked at all (there will not be even warning)
(changes according to discussion on last dev-conf)
2004-10-07 12:13:42 +03:00
bell@sanja.is.com.ua
c8d5f8991d merge 2004-10-07 11:36:46 +03:00
bell@sanja.is.com.ua
3ef0b19cd3 fixed & added comments (according to Igor's review and a bit more) 2004-10-07 01:45:06 +03:00
bell@sanja.is.com.ua
a78f817d20 merge 2004-10-05 13:41:51 +03:00
bell@sanja.is.com.ua
013512abab merge 2004-09-29 17:10:17 +03:00
bell@sanja.is.com.ua
392292a46b post review changes:
CHECK OPTION moved to one function
view name added to error messages
2004-09-29 16:35:01 +03:00
bell@sanja.is.com.ua
74e7df0d80 SHOW CREATE VIEW (TABLE) privilege now reqiere show create privilege
(BUG#4777)
2004-09-17 22:23:59 +03:00
bell@sanja.is.com.ua
226d4ad8f4 now we allow to careate VIEW without any privileges on view columns (except create view privilege) (BUG#5152) 2004-09-17 00:16:57 +03:00
bell@sanja.is.com.ua
09b316f051 updateability of field with collation support (BUG#5506) 2004-09-16 23:45:20 +03:00
bell@sanja.is.com.ua
67fcac7a87 support of join view updateability (WL#1809) 2004-09-15 23:42:56 +03: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
bell@sanja.is.com.ua
31379fbebe table lists management during VIEW processing code cleanup 2004-09-11 23:52:55 +03:00
bell@sanja.is.com.ua
a23857e071 post merge fixes 2004-09-10 02:22:44 +03:00
bell@sanja.is.com.ua
336cb5f8be merge 2004-09-09 16:52:22 +03:00
monty@mysql.com
49cd04b510 Merge on pull 2004-09-09 07:26:28 +03:00
monty@mysql.com
f2829d0386 After merge fixes of merge with 4.1 that included the new arena code.
Fixed (together with Guilhem) bugs in mysqlbinlog regarding --offset
Prefix addresses with 0x for easier comparisons of debug logs
Fixed problem where MySQL choosed index-read even if there would be a much better range on the same index
This fix changed some 'index' queries to 'range' queries in the test suite
Don't create 'dummy' WHERE clause for trivial WHERE clauses where we can remove the WHERE clause.
This fix removed of a lot of 'Using where' notes in the test suite.
Give NOTE instead of WARNING if table/function doesn't exists when using DROP IF EXISTS
Give NOTE instead of WARNING for safe field-type conversions
2004-09-09 06:59:26 +03:00
bell@sanja.is.com.ua
425857f5b2 test of updating and fetching from the same table check (BUG##5157) 2004-09-08 10:18:04 +03:00
bell@sanja.is.com.ua
ee03178f01 merge 2004-09-06 15:56:38 +03:00
bell@sanja.is.com.ua
6d8e178523 merge 2004-09-05 22:14:27 +03:00
bell@sanja.is.com.ua
bb62c80201 memory leaks fixed 2004-09-04 23:05:12 +03:00
bell@sanja.is.com.ua
161662ba4c 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-04 15:32:13 +03:00
monty@mysql.com
46ff90738b Merge with pulled code 2004-09-03 22:38:45 +03:00
monty@mysql.com
cbd67f49e1 Cleanup of new code pushed into 5.0 since last pull
Merged the different find_xxxx_table_in_list functions to one + some inline functions
2004-09-03 21:43:04 +03:00
bell@sanja.is.com.ua
3cdb85a08c ufter review fix 2004-09-03 21:38:01 +03:00
bell@sanja.is.com.ua
bd2c119176 CHECK OPTIONs added (WL#1983) 2004-09-03 15:18:40 +03:00
bell@sanja.is.com.ua
f1bbfdf4a6 checked INTO clause during view creation (BUG#5332) 2004-09-02 12:09:26 +03:00
bell@sanja.is.com.ua
d38bd725ef system charset (with wich VIEW printed) saved in .frm and restored before parsing view (BUG#5163) 2004-09-01 22:48:59 +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
bell@sanja.is.com.ua
94bfede7e1 new method to detect commands where all VIEWs should be temporary tables (BUG#4803) 2004-08-24 22:51:23 +03:00
bell@sanja.is.com.ua
be31afd176 Fixed UNION support in view creation (BUG#4664) 2004-08-24 19:50:16 +03:00
bell@sanja.is.com.ua
618e65cd28 fixed error processing of prepare in VIEW creation (BUG#4801) 2004-08-23 12:38:55 +03:00
bell@sanja.is.com.ua
bc98f2146d made different fields for view updatebility in principle and updatability during this execution (BUG#4601) 2004-07-22 17:52:04 +03:00
serg@serg.mylan
aa35efd292 after merge fixes 2004-07-22 00:26:33 +02:00
bell@sanja.is.com.ua
7145dedb3d test of duplicate field names (BUG#4608) 2004-07-21 12:14:45 +03:00
bell@sanja.is.com.ua
ad9a6e0858 error message interception (Bug#4598)
error handling of view initialization fixed (Bug#4599)
2004-07-21 04:26:20 +03:00
bell@sanja.is.com.ua
8bc592f1b0 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-07-20 22:10:47 +03:00
bell@sanja.is.com.ua
10ce8cdef5 fixed quoting of identifiers in VIEWs (BUG#4613) 2004-07-20 18:51:02 +03:00
bell@sanja.is.com.ua
054cdbe72c fix case what VIEW have not tables (BUG#4614) 2004-07-20 10:34:39 +03:00
bell@sanja.is.com.ua
1e3f10a4b1 mark subquery in the FROM clause like derived and quoate all identifiers (BUG#4609) 2004-07-20 08:48:28 +03:00
konstantin@mysql.com
09b501d6be Fixes for MSVC++ compiler. 2004-07-19 13:43:19 -07:00
bell@sanja.is.com.ua
b93aa71d15 satisfy VC++ 2004-07-16 23:44:14 +03:00
bell@sanja.is.com.ua
bbe121c0c9 memory leak removing 2004-07-16 15:20:51 +03:00
bell@sanja.is.com.ua
9336d36cf8 VIEW
two TABLE_LIST copy eliminated
2004-07-16 01:15:55 +03:00