Commit graph

196 commits

Author SHA1 Message Date
igor@rurik.mysql.com
f878cc589d Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2005-11-02 22:24:36 -08:00
igor@rurik.mysql.com
44dd303c47 Post review fixes. 2005-11-02 22:13:10 -08:00
igor@rurik.mysql.com
fddc99bcd8 #view.test#:
new file
sql_table.cc, handler.h:
  Fixed bug #14540.
  Added error mnemonic code HA_ADMIN_NOT_BASE_TABLE
  to report that an operation cannot be applied for views.
view.test, view.result:
  Added a test case for bug #14540.
errmsg.txt:
  Fixed bug #14540.
  Added error ER_CHECK_NOT_BASE_TABLE.
2005-11-02 13:44:58 -08:00
evgen@moonbone.local
2343ff86ca Fix bug #14466 lost sort order in GROUP_CONCAT() in a view
Item_func_group_concat::print() wasn't printing sort order thus creating wrong
view. This results in reported error.
2005-11-01 17:27:10 +03:00
pem@mysql.com
d201f2443d Fixed BUG#14256: definer in view definition is not fully qualified
Changed the parser test for wildcards in hostname to checking for empty
  strings instead (analogous with the test in default_view_definer()),
  since wildcards do appear in the definer's host-part sometimes.
2005-10-28 12:11:32 +02:00
monty@mysql.com
5513ab69b7 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2005-10-12 00:59:52 +03: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
evgen@moonbone.local
65325ecbbb Fix bug#13327 check_equality() wasn't checking view's fields
check_equality() finds equalities among field items. It checks input items
to be Item_fields thus skipping view's fields, which are represented by
Item_direct_view_ref. Because of this index wasn't applied in all cases
it can be.

To fix this problem check_equality() now takes real item of
Item_direct_view_ref, except outer view refs (with depended_from set).
2005-10-10 18:53:57 +04:00
timour@mysql.com
77cf84186e Fix for BUG#13410 - qualified reference to a view column in the HAVING clause cannot be resolved.
The problem was then when a column reference was resolved to a view column, the new Item
created for this column contained the name of the view, and not the view alias.
2005-10-01 09:35:30 +03:00
igor@rurik.mysql.com
6e2fb27af6 item.cc:
Fixed bug #13410.
  Fixed name resolution for qualified reference to a view column
  in the HAVING clause.
view.result, view.test:
  Added a test case for bug #13410.
2005-09-26 23:29:02 -07:00
igor@rurik.mysql.com
a43b341c8a sql_base.cc, item.cc:
Fixed bug #13411.
  Fixed name resolution for non-qualified reference to a view column
  in the HAVING clause.
view.result, view.test:
  Added a test case for bug #13411.
2005-09-26 20:18:59 -07:00
serg@serg.mylan
86ad035270 test case fixed to pass w/o innodb 2005-09-25 15:44:05 +02:00
georg@lmy002.wdf.sap.corp
541d3ae89b Merge grichter@bk-internal.mysql.com:/home/bk/mysql-5.0
into lmy002.wdf.sap.corp:/home/georg/work/mysql/bugs/mysql-5.0-master
2005-09-19 05:32:38 +02:00
georg@lmy002.wdf.sap.corp
afe8dcf2e7 Fix for bug#5508 after Sanja's review 2005-09-16 17:13:21 +02:00
evgen@moonbone.local
fcfcc016bd Merge 2005-09-15 20:50:10 +04:00
evgen@moonbone.local
ac32450609 Fix bug #11416 Server crash if using a view that uses function convert_tz
When parser parses function convert_tz it loads available timezone tables in
thd->lex->time_zone_tables_used. But view have another lex that main query.
Thus time_zone_tables_used of main query left uninitialized.
When Item_func_conver_tz is fixed it takes timezone tables from main query
and later when it executed it assumes that timezone tables are loaded and
failed that assertion.
2005-09-15 00:08:12 +04:00
aivanov@mysql.com
a42b5000ca Merge mysql.com:/home/alexi/mysql-5.0
into  mysql.com:/home/alexi/dev/mysql-5.0-13000
2005-09-14 20:32:59 +04:00
aivanov@mysql.com
53e90b53bc Fixed BUG#12963, BUG#13000: wrong VIEW creation with DAYNAME(),
DAYOFWEEK(), and WEEKDAY().
2005-09-14 20:25:00 +04:00
bell@sanja.is.com.ua
914b961d01 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-owner2-5.0
2005-09-14 11:07:04 +03:00
bell@sanja.is.com.ua
71ffbbf81b part 1 (ver 2, postreview fix) of WL#2787
view definer information syntax/storage/replication
fixed SOURCE field of .frm
2005-09-14 10:53:09 +03:00
evgen@moonbone.local
62fa6c5eae Merge 2005-09-13 22:22:51 +04:00
timour@mysql.com
9d862db743 Fix for BUG#6808.
The problem was in that add_table_to_list was testing for duplicate tables
in a list of tables that included the created view.
2005-09-12 17:01:17 +03:00
evgen@moonbone.local
75841099ca Fix bug #12993 View column rename broken in subselect
When view column aliased in subselect alias is set on ref which represents
field. When tmp table is created for subselect, it takes name of original field
not ref. Because of this alias on view column in subselect is lost. Which
results in reported error.

Now when alias is set on ref, it's set on ref real item too.
2005-09-12 02:46:35 +04:00
evgen@moonbone.local
f2d6282f6b Manual merge 2005-09-07 22:55:49 +04:00
evgen@moonbone.local
80c3a0b1b6 Fix bug #12922 if(sum(),...) with group from view returns wrong results
Fields of view represented by Item_direct_view_ref. When complex expression
such as if(sum()>...,...) is splited in simpler parts by refs was ignored.
Beside this direct ref doesn't use it's result_field and thus can't store
it's result in tmp table which is needed for sum() ... group.
All this results in reported bug.

Item::split_sum_func2() now converts Item_direct_view_ref to Item_ref to
make fields from view being storable in tmp table.
2005-09-07 22:38:36 +04:00
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
da64c1eab3 postmerge changes 2005-09-02 09:50:17 +03: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
msvensson@neptunus.(none)
1026fa2fe3 Fix for spelling miss and eol junk 2005-09-01 20:02:08 +02: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.
dde57f082b fix for bug #12533 (crash on DESCRIBE <view> after renaming base table column) 2005-08-25 09:24:21 +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
6fae8f6c8d Manual merge 2005-08-18 15:18:26 -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
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
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
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
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