Commit graph

195 commits

Author SHA1 Message Date
sergefp@mysql.com
99870f616d Fix for BUG#12941: in create_tmp_field(), if the passed item is an Item_ref, put newly
created item into item->result_field, not *(item->ref)->result_field.
2005-09-07 11:50:41 +04:00
bell@sanja.is.com.ua
dd7ab17059 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-bug3-5.0
2005-09-01 22:42:37 +03:00
evgen@moonbone.local
dc53ac6d1f Fix bug #12489 wrongly printed strcmp() function results in creation of broken
view.

For Item_func_strcmp print() was not defined and for this class was called
print_op of it's parent class. Because of this strcmp() was printed wrongly
and this results int creation of broken view.

Added function Item_func_strcmp::print() which correctly prints strcmp()
function.
2005-08-31 00:54:41 +04:00
bell@sanja.is.com.ua
5963573c05 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-bug1-5.0
2005-08-25 17:47:18 +03:00
andrey@lmy004.
d4a25c1b36 Merge lmy004.:/work/mysql-5.0-clean
into lmy004.:/work/mysql-5.0-bug12533-2
2005-08-25 09:38:59 +02:00
andrey@lmy004.
dde57f082b fix for bug #12533 (crash on DESCRIBE <view> after renaming base table column) 2005-08-25 09:24:21 +02:00
georg@lmy002.wdf.sap.corp
254db48603 Fix for bug#5501 (SHOW TABLE STATUS should show "view" in upper case) 2005-08-24 12:51:00 +02:00
bell@sanja.is.com.ua
144c847da6 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-bug3-5.0
2005-08-23 23:17:36 +03:00
igor@rurik.mysql.com
743917759c Manual merge 2005-08-18 15:17:04 -07:00
igor@rurik.mysql.com
5ac7d86793 view.test:
Added a test case for bug #10970.
view.result:
  Added a test case for bug #10970.
  Modified the error messages for error ER_VIEW_SELECT_TMPTABLE.
sql_view.cc:
  Fixed bug #10970.
  In the function mysql_create_view if a view does not refer
  any tables directly the variable table must be updated
  after the call of open_and_lock_tables.
errmsg.txt:
  Modified the error messages for error ER_VIEW_SELECT_TMPTABLE
  (when fixing bug #10970).
2005-08-17 22:19:12 -07: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
69319f17e7 Fix bug #10624 Views with multiple UNION and UNION ALL produce incorrect
results.

st_select_lex_unit::print() was losing UNION ALL if in statement were present
UNION DISTINCT.
2005-08-15 23:05:05 +04:00
evgen@moonbone.local
0f9b982970 Fix bug #12298 Typo in timestampdiff() function name results in erroneous
view being created.

Item_func_timestamp_diff::func_name() were returning function name as
"timestamp_diff" thus when view was executed function parameters wasn't 
properly recognized and error was raised.
2005-08-12 22:42:50 +04:00
igor@rurik.mysql.com
da441e949c sql_base.cc:
Fixed bug #12470.
  A misplaced initialization of the cond_count counter
  resulted in a wrong calculation of it. This caused a memory
  corruption since this counter was used as a parameter of
  some memory allocation.
view.test:
  Added a test case for bug #12470.
2005-08-12 01:27:04 -07:00
igor@rurik.mysql.com
0aff8a13dc sql_base.cc:
Fixed bug #12382.
  INSERT statement effectively changed thd->set_query_id to 0,
  while SELECT statement changed it to 0. As a result
  the insert_fields function that expanded '*' was called
  with different values of thd->set_query_id for the query
  SELECT * FROM view depending on whether it was run after
  an INSERT or after a SELECT statement. This was corrected
  by restoring the old value of thd->set_query_id when
  returning from the function setup_fields where possible
  reset could occur.
  If the value of thd->set_query_id == 0 then the fields
  substituted instead of '*' were not registered as used
  for bitmaps used_keys. This caused selection of an invalid
  execution plan for the query SELECT * from <view>.
view.result, view.test:
  Added a test case for bug #12382.
2005-08-11 16:10:34 -07: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
jimw@mysql.com
995b5dd02d Fix out-of-order results in view results file 2005-08-04 16:33:29 -07:00
evgen@moonbone.local
1894cff045 Manual merge of #11335 bugfix 2005-08-05 00:34:42 +04:00
sergefp@mysql.com
f595847ec0 Manual merge 2005-08-03 03:47:07 +00: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
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
evgen@moonbone.local
fa0ea36507 Fix bug #11335 View redefines TinyInt(1) column definition
Item_type_holder doesn't store information about length and exact type of
original item which results in redefining length to max_length and geometry 
type to longtext.

Changed the way derived tables except unions are built. Now they are created
from original field list instead of list of Item_type_holder.
2005-07-30 05:53:35 +04:00
igor@rurik.mysql.com
24d148d025 sql_select.cc:
Fixed bug #11412.
  Reversed the patch of cs 1.1934 for the function 
  create_tmp_table. Modified the function to support
  tem_ref objects created for view fields.
item_buff.cc:
  Fixed bug #11412.
  Modified implementation of new_Cached_item to support
  cacheing of view fields.
item.h:
  Fixed bug #11412.
  Changed implementation of Item_ref::get_tmp_table_field and
  added Item_ref::get_tmp_table_item to support Item_ref objects
  created for view fields.
view.test, view.result:
  Added a test case for bug #11412.
2005-07-25 12:57:23 -07:00
evgen@moonbone.local
ef1d27e02a Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into moonbone.local:/work/mysql-5.0-bug-11760
2005-07-20 06:59:31 +04:00
evgen@moonbone.local
6b25219fea Fix bug #11760 Typo in Item_func_add_time::print() results in NULLs returned
by subtime() in view

Item_func_add_time::print() were printing arg[0] instead of arg[1] which
results in wrongly created view. Functions addtime() and subtime were
affected by this bug.
2005-07-20 06:55:51 +04: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
konstantin@mysql.com
8b0adacbc6 After-merge fixes (4.1 -> 5.0). 2005-07-16 16:10:42 +04:00
bell@sanja.is.com.ua
8aad35f9d2 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-bug6-5.0
2005-07-16 00:17:05 +03:00
bell@sanja.is.com.ua
6114bee47c stop evaluation constant functions in WHERE (BUG#4663)
correct value of CURRENT_USER() in SP with "security definer" (BUG#7291)
2005-07-16 00:01:44 +03:00
bell@sanja.is.com.ua
a7834de02d take into account table lock mode when opening table:
try to find most suitable table, to avouid pickup table with too low locking mode or occupy table with write mode for select when it will be need for update later
(BUG#9597)
2005-07-15 01:22:14 +03:00
kent@mysql.com
aab8220342 Merge 2005-07-13 02:39:23 +02:00
evgen@moonbone.local
693c7272f0 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into moonbone.local:/work/mysql-5.0-bug-11709
2005-07-13 04:39:22 +04:00
evgen@moonbone.local
d72f1c9b0c view.result, view.test:
Fix for test case for bug#11709
2005-07-13 04:10:19 +04:00
evgen@moonbone.local
bb1f81607c Merge 2005-07-12 23:24:35 +04:00
evgen@moonbone.local
de016ca78a Fix bug#11709 View was ordered by wrong column.
When searching column to sort on, item was compared to field under view
column, but not the column itself. Because names of view column and underlaid
field may differ, it leads to possibly choosing wrong column for sorting on.

This patch makes Item_direct_view_ref::eq(Item *item,...) compare
item's name with it's own name proir to comparing to *ref item.
2005-07-12 23:22:08 +04: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
7725eb3141 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0
into igor-inspiron.creware.com:/home/igor/mysql-5.0
2005-07-12 10:44:31 -07:00
evgen@moonbone.local
7d20cad2db Merge 2005-07-12 20:49:43 +04:00
evgen@moonbone.local
dc5949b336 Fix bug #11399 Column alias was lost during view preraration.
New item created in find_field_in_table() to fix view's item, was created 
without taking into account original item's alias. This patch checks if alias 
is set to the original item and if so sets it to newly created item.
2005-07-12 20:45:34 +04:00
igor@igor-inspiron.creware.com
26ee0b2ef8 view.result, view.test:
Added a test case for bug #11771.
item.h:
  Fixed bug #11771.
  Added method reset_query_id_processor to be able to adjust
  query_id for fields generated from * in queries like this:
  SELECT * FROM <view> ...
sql_base.cc:
  Fixed bug #11771.
  Adjusted query_id for fields generated from * in queries
  like this: SELECT * FROM <view> ...
2005-07-12 05:18:05 -07:00
ramil@mysql.com
48e1013492 portability fix: the Max_data_length replaced with # 2005-07-08 16:25:07 +05: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
jimw@mysql.com
af5f5ab3ed Merge mysql.com:/home/jimw/my/mysql-5.0-6903
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-07-05 17:05:31 -07:00
bell@sanja.is.com.ua
4bc6bd38ec Merge 2005-07-05 13:42:19 +03:00
bell@sanja.is.com.ua
cee0f3f608 fixed environment creation and cleaning up for processing view one by one during checking (BUG#11337) 2005-07-05 13:37:02 +03:00
bell@sanja.is.com.ua
a8e9ca1b51 merge 2005-07-05 11:21:47 +03:00
bell@sanja.is.com.ua
40abfc1b6f fixed var_samp printing (BUG#10651) 2005-07-02 16:12:32 +03:00
bell@sanja.is.com.ua
6201504db9 fixed difference between ps-protocol and usual execution 2005-07-02 13:16:30 +03:00
igor@rurik.mysql.com
3d06031887 Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2005-07-01 03:50:48 -07:00
igor@rurik.mysql.com
347687f71e view.result:
Fixed the results of a test for group_concat.
  After the fix foor bug #11639 the results became
  correct.
olap.result, olap.test:
  Added a test case for bug #11639.
sql_select.cc:
  Fixed bug #11639: a wrong result set when using a view
  instead of the underlying table in a rollup query 
  executed through filesort.
  The old code did not take into account that we always
  use an Item_ref object when referring to a view column.
item.h:
  Fixed bug #11639.
  Now if two Item_ref items ref1 and ref2 refer to the same field
  then ref1->eq(ref2) returns 1.
2005-07-01 03:46:08 -07:00