The problem was in that add_table_to_list was testing for duplicate tables
in a list of tables that included the created view.
mysql-test/r/view.result:
Test for BUG#6808
mysql-test/t/view.test:
Test for BUG#6808
sql/sql_parse.cc:
When testing for table name uniquness, skip the first table the current
statement is CREATE VIEW. Notice that the first table is skipped differently
for CREATE TABLE ... SELECT ... statements, so we don't have to handle that
case here (see production 'create_select', the call 'to save_and_clear').
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.
sql/item.h:
Fix bug #12922 if(sum(),...) with group from view returns wrong results
Added function ref_type() to distinguish Item_ref subclasses
sql/item.cc:
Fix bug #12922 if(sum(),...) with group from view returns wrong results
Item::split_sum_func2() now converts Item_direct_view_ref to Item_ref to make fields from view being storable in tmp table.
mysql-test/t/view.test:
Test case for bug#12922 if(sum(),...) with group from view returns wrong results
mysql-test/r/view.result:
Test case for bug#12922 if(sum(),...) with group from view returns wrong results
created item into item->result_field, not *(item->ref)->result_field.
mysql-test/r/view.result:
Tescase for BUG#12941
mysql-test/t/view.test:
Tescase for BUG#12941
mysql-test/t/lowercase_view.test:
error code changed after merege
mysql-test/t/view.test:
error code changed after merege
sql/item.cc:
inline function used instead of frequently used expression
removed old TODO
sql/sql_base.cc:
layoutfixed
inline function used instead of frequently used expression
sql/sql_insert.cc:
inline function used instead of frequently used expression
into sanja.is.com.ua:/home/bell/mysql/bk/work-bug3-5.0
BitKeeper/etc/config:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/table.h:
Auto merged
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.
sql/item_cmpfunc.h:
Fix bug #12489 wrongly printed strcmp() function results in creation of broken view.
mysql-test/r/view.result:
Test case for bug #12489 wrongly printed strcmp() function results in creation of broken view.
mysql-test/t/view.test:
Test case for bug #12489 wrongly printed strcmp() function results in creation of broken view.
mysql-test/r/view.result:
result of test for bug #12533
mysql-test/t/view.test:
test for bug #12533 (crash on DESCRIBE <view> after renaming base table column)
sql/sql_show.cc:
close thread tables even if process_table bails out
into sanja.is.com.ua:/home/bell/mysql/bk/work-bug3-5.0
BitKeeper/etc/config:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/table.cc:
Auto merged
mysql-test/r/view.result:
merge
mysql-test/t/view.test:
merge
sql/share/errmsg.txt:
merge
sql/sql_insert.cc:
merge
sql/table.h:
merge
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).
sql/share/errmsg.txt:
Modified the error messages for error ER_VIEW_SELECT_TMPTABLE
(when fixing bug #10970).
sql/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.
mysql-test/r/view.result:
Fixed bug #10970.
Modified the error messages for error ER_VIEW_SELECT_TMPTABLE.
mysql-test/t/view.test:
Added a test case for bug #10970.
correct exit from mysql_create_view to restore ennvironment (BUG#12468)
view.result, view.test:
test of CRETE VIEW in SP
mysql-test/t/view.test:
test of CRETE VIEW in SP
mysql-test/r/view.result:
test of CRETE VIEW in SP
sql/sql_view.cc:
correct exit from mysql_create_view to restore ennvironment
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.
mysql-test/r/func_time.result:
Fix test result after bugfix #12298
sql/item_timefunc.h:
Fix bug #12298 Typo in timestampdiff() function name results in wrong view being created.
mysql-test/t/view.test:
Test case for bug #12298 Typo in timestampdiff() function name results in erroneous view being created.
mysql-test/r/view.result:
Test case for bug #12298 Typo in timestampdiff() function name results in erroneous view being created.
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.
mysql-test/t/view.test:
Added a test case for bug #12470.
sql/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.
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.
mysql-test/t/view.test:
Added a test case for bug #12382.
mysql-test/r/view.result:
Added a test case for bug #12382.
sql/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>.
* 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.
mysql-test/r/type_bit.result:
Drop the tables this test tries to create
mysql-test/r/view.result:
Drop function this test creates
mysql-test/t/type_bit.test:
Drop the tables this test tries to create
mysql-test/t/view.test:
Drop function this test creates
sql/sp.cc:
Fix for BUG#12228: When a routine is deleted/modified, invalidate all cached SPs in all
threads. We need to do so because sp_lex_keeper::{prelocking_tables, query_tables_own_last}
in one SP may depend on another SP sp_lex_keeper::m_lex is using.
sql/sp_cache.cc:
Fix for BUG#12228:
* Move class sp_cache to here from sp_cache.h, document the functions.
* sp_cache_insert, sp_cache_remove, sp_cache_invalidate and sp_cache_lookup must not delete
sp_head* objects as they may be called during SP execution when sp_head objects are used.
* Added sp_cache_flush_obsolete() function that may delete sp_head objects.
* Removed sp_cache_remove as there is no need for it now - when we change one SP we should
invalidate all other SPs, because sp_lex_keeper::{prelocking_tables,
query_tables_own_last} from one SP depend on content of another SP (used in
sp_lex_keeper::m_lex).
sql/sp_cache.h:
Fix for BUG#12228:
* Move class sp_cache to sp_cache.cc it is not needed in .h file
* Added comments
sql/sql_parse.cc:
Fix for BUG#12228: Call new sp_cache_flush_obsolete() function before running the query
sql/sql_prepare.cc:
Fix for BUG#12228: Call new sp_cache_flush_obsolete() function before preparing/executing a PS
mysql-test/r/sp.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_trigger.h:
Auto merged
frequently used command sequence replaced with inline function
BitKeeper/etc/config:
logging switching off
mysql-test/r/lowercase_view.result:
hided view underlying tables from error message
mysql-test/r/view.result:
hided view underlying tables from error message
mysql-test/t/lowercase_view.test:
hided view underlying tables from error message
mysql-test/t/view.test:
hided view underlying tables from error message
sql/mysql_priv.h:
subroutine which return correct error message
sql/share/errmsg.txt:
new error message
sql/sql_base.cc:
subroutine which issue correct error message in case of view presence for duplicated table on update
sql/sql_delete.cc:
issue correct error message in case of view presence for duplicated table on update
sql/sql_insert.cc:
issue correct error message in case of view presence for duplicated table on update
sql/sql_parse.cc:
issue correct error message in case of view presence for duplicated table on update
sql/sql_update.cc:
issue correct error message in case of view presence for duplicated table on update
sql/sql_view.cc:
frequently used command sequence replaced with inline function
sql/table.cc:
frequently used command sequence replaced with inline function
sql/table.h:
frequently used command sequence replaced with inline function
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.
client/client_priv.h:
Added OPT_TRIGGERS (to get rid of compiler warning)
client/mysql.cc:
Added cast to get rid of compiler warning
client/mysqldump.c:
Added OPT_TRIGGERS (to get rid of compiler warning)
Abort if we can't write to outfile (even if --ignore-errors is given)
client/mysqltest.c:
Added --enable_parsning and --disable_parsing to avoid to have to comment parts of tests
include/my_sys.h:
Make my_progname const
include/my_time.h:
Avoid using 'bool' in C programs
mysql-test/lib/init_db.sql:
Align with mysql_create_system_tables
(Ideally this file should be auto-generated from the above script)
mysql-test/r/mysqltest.result:
Test for --enable_parsing
mysql-test/r/variables.result:
Update results after fix for overflow checking of max_heap_table_size
mysql-test/t/information_schema.test:
USe --enable/disable parsing instead of comments
mysql-test/t/mysqltest.test:
Test for --enable_parsing
mysql-test/t/sp.test:
USe --enable/disable parsing instead of comments
mysql-test/t/variables.test:
Portability fix for 64 bit systems
mysql-test/t/view.test:
USe --enable/disable parsing instead of comments
mysys/my_init.c:
May my_progname const
mysys/my_static.c:
May my_progname const
mysys/thr_lock.c:
Remove not needed casts
sql-common/my_time.c:
Change bool -> my_bool as bool is not portable in C programs
sql/field.cc:
Test number_to_datetime() for -1 instead of < 0 (Safety fix)
New prototype for TIME_to_timestamp()
sql/item.h:
Don't have prototypes for both uint32 and ulong as these 'may' be the same thing
sql/item_timefunc.cc:
New prototype for TIME_to_timestamp()
sql/log.cc:
Remove compiler warnings
sql/mysql_priv.h:
New prototype for TIME_to_timestamp()
Added function for comparing LEX_STRING
sql/set_var.cc:
Added overflow checking when setting ulong variable
sql/sql_base.cc:
Added function is_equal()
Changed strncmp -> is_equal() as strncmp() to not match "V" (instead of "VIEW")
sql/sql_class.cc:
Added comment
sql/sql_select.cc:
Portability fixes
After review fixes
sql/sql_trigger.cc:
Use 'tables_alias_charset' for comparing database name
Use 'is_equal()' to compare file type. (Old code didn't do the comparison correctly)
sql/sql_view.cc:
Use 'is_equal()' to compare file type. (Old code didn't do the comparison correctly)
sql/time.cc:
New prototype for TIME_to_timestamp() to allow easyer mapping to C function
sql/tztime.cc:
bool -> my_bool (to allow calling C code from C++ code)
sql/tztime.h:
bool -> my_bool (to allow calling C code from C++ code)
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
mysql-test/r/sp-security.result:
Drop tables this test attempts to create
mysql-test/r/sp-threads.result:
Update test results
mysql-test/r/sp.result:
Disabled a test that triggers BUG#11986, cleanup used tables when tests start.
mysql-test/r/view.result:
Enabled a test case that now works with prelocking-free SPs
mysql-test/t/sp-security.test:
Drop tables this test attempts to create
mysql-test/t/sp.test:
Disabled a test that triggers BUG#11986, cleanup used tables when tests start.
mysql-test/t/view.test:
Enabled a test case that now works with prelocking-free SPs
sql/handler.cc:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/item_func.cc:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/sp.cc:
Non-prelocked SP execution: Added support for skipping prelocking of procedure body for
"CALL proc(...)" statements.
sql/sp.h:
Non-prelocked SP execution: Added support for skipping prelocking of procedure body for
"CALL proc(...)" statements.
sql/sp_cache.h:
Added comments
sql/sp_head.cc:
Non-prelocked SP execution:
* Try to unlock tables after PROCEDURE arguments have been evaluated.
* Make sp_lex_keeper be able to execute in 2 modes: A) when already in prelocked mode
B) when its statement enters/leaves prelocked mode itself.
sql/sp_head.h:
Non-prelocked SP execution: Make sp_lex_keeper to additionally keep list of tables it
needs to prelock when its statement enters/leaves prelocked mode on its own.
sql/sql_base.cc:
Non-prelocked SP execution: Make open_tables() to
* detect 'CALL proc(...)' and not to do prelocking for procedure body statements.
* Make lex->query_tables_last to point precisely to a boundary in lex->query_tables
list where 'own' tables and views' tables end and added-for-prelocking tables begin.
(it was not true before - view's tables could end up after query_tables_own_last)
sql/sql_class.cc:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/sql_class.h:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/sql_lex.cc:
Non-prelocked SP execution: More rigourous cleanup in st_lex::cleanup_after_one_table_open()
sql/sql_parse.cc:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt, remove outdated comments
sql/sql_trigger.h:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
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.
mysql-test/r/subselect.result:
Fixed wrong test case result. bug#11335
mysql-test/r/view_grant.result:
Fixed wrong test case result. bug#11335
mysql-test/r/view.result:
Added test case for bug #11335. Fixed wrong test case result.
mysql-test/t/view.test:
Test case for bug #11335 View redefines TinyInt(1) column definition.
sql/sql_union.cc:
Fix bug #11335 View redefines TinyInt(1) column definition.
Changed the way derived tables except unions are built. Now they are created from original field list instead of list of Item_type_holders.
sql/sql_select.cc:
Fix bug #11335 View redefines TinyInt(1) column definition.
Added special handling of DATE/TIME fields to preserve field's type in tmp field creation.
In create_tmp_field() for Item_field added special handling of case when item have to be able to store NULLs but underlaid field is NOT NULL.
sql/item_sum.cc:
Fix bug #11335 View redefines TinyInt(1) column definition.
Added special handling of DATE/TIME fields to preserve field's type while tmp
field created in Item_sum_hybrid::create_tmp_field().
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.
mysql-test/r/view.result:
Added a test case for bug #11412.
mysql-test/t/view.test:
Added a test case for bug #11412.
sql/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.
sql/item_buff.cc:
Fixed bug #11412.
Modified implementation of new_Cached_item to support
cacheing of view fields.
sql/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.
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.
sql/item_timefunc.cc:
Fix bug #11760 Typo in Item_func_add_time::print() results in wrongly created view
mysql-test/t/view.test:
Test case for bug #11760 Typo in Item_func_add_time::print() results in wrongly created view
mysql-test/r/view.result:
Test case for bug #11760 Typo in Item_func_add_time::print() results in wrongly created view
mysql-test/r/date_formats.result:
Fixed wrong test result. Affected by bug#11760
"Triggers have the wrong namespace"
"Triggers: duplicate names allowed"
"Triggers: CREATE TRIGGER does not accept fully qualified names"
"SHOW TRIGGERS"
mysql-test/r/information_schema.result:
Added tests for new INFORMATION_SCHEMA.TRIGGERS view and SHOW TRIGGERS command.
mysql-test/r/information_schema_db.result:
INFORMATION_SCHEMA.TRIGGERS view was added.
mysql-test/r/rpl_sp.result:
Now DROP TRIGGER interprets first part of trigger identifier as database
name and not as table name. Adjusted tests properly.
mysql-test/r/trigger.result:
Now DROP TRIGGER interprets first part of trigger identifier as database
name and not as table name. Adjusted tests properly.
Added test checking that triggers have database wide namespace.
Added test for bug #8791 "Triggers: Allowed to create triggers on a subject
table in a different DB".
mysql-test/r/view.result:
Now DROP TRIGGER interprets first part of trigger identifier as database
name and not as table name. Adjusted tests properly.
mysql-test/t/information_schema.test:
Added tests for new INFORMATION_SCHEMA.TRIGGERS view and SHOW TRIGGERS command.
mysql-test/t/rpl_sp.test:
Now DROP TRIGGER interprets first part of trigger identifier as database
name and not as table name. Adjusted tests properly.
mysql-test/t/trigger.test:
Now DROP TRIGGER interprets first part of trigger identifier as database
name and not as table name. Adjusted tests properly.
Added test checking that triggers have database wide namespace.
Added test for bug #8791 "Triggers: Allowed to create triggers on a subject
table in a different DB".
mysql-test/t/view.test:
Now DROP TRIGGER interprets first part of trigger identifier as database
name and not as table name. Adjusted tests properly.
sql/handler.cc:
Added .TRN tho the list of known file extensions assoicated with tables.
sql/item.h:
trg_action_time_type/trg_event_type enums:
Added TRG_ACTION_MAX/TRG_EVENT_MAX elements which should be used instead of
magical values in various loops where we iterate through all types of trigger
action times or/and trigger event types.
sql/lex.h:
Added new symbol "TRIGGERS".
sql/mysql_priv.h:
Added declaration of constant holding extension for trigger name (.TRN) files.
sql/mysqld.cc:
Added statistical variable for SHOW TRIGGERS command.
sql/share/errmsg.txt:
Added error message saying that one attempts to create trigger in wrong schema.
sql/sp.cc:
Replaced magical values with TRG_EVENT_MAX/TRG_ACTION_MAX constants.
sql/sql_base.cc:
open_unireg_entry():
Now Table_triggers_list::check_n_load() has one more argument which
controls whether we should prepare Table_triggers_list with fully functional
triggers or load only their names.
sql/sql_lex.h:
Added element for new SHOW TRIGGERS command to enum_sql_command enum.
sql/sql_parse.cc:
prepare_schema_table():
Added support for SHOW TRIGGERS statement.
sql/sql_show.cc:
Added new INFORMATION_SCHEMA.TRIGGERS view and SHOW TRIGGERS command.
sql/sql_table.cc:
mysql_rm_table_part2():
Replaced simple deletion of .TRG file with call to
Table_triggers_list::drop_all_triggers which will also delete .TRN files
for all triggers associated with table.
sql/sql_trigger.cc:
Now triggers have database wide namespace. To support it we create special .TRN
file with same name as trigger for each trigger. This file contains name of
trigger's table so one does not need to specify it explicitly in DROP TRIGGER.
Moreover DROP TRIGGER treats first part of trigger identifier as database name
now. Updated mysql_create_or_drop_trigger() routine and
Table_triggers_list::create_trigger()/drop_trigger()/check_n_load() methods
accordingly. Added add_table_for_trigger() routine and
Table_triggers_list::drop_all_triggers() method.
Added Table_triggers_list::get_trigger_info() for obtaining trigger metadata.
sql/sql_trigger.h:
Table_triggers_list:
Use TRG_EVENT_MAX, TRG_ACTION_MAX instead of magic values.
Added get_trigger_info() method for obtaining trigger's meta-data.
Added drop_all_triggers() method which drops all triggers for table.
Added declarations of trg_action_time_type_names/trg_event_type_names
arrays which hold names of triggers action time types and event types.
sql/sql_yacc.yy:
Changed grammar for CREATE/DROP TRIGGER to support database wide trigger
namespace. Added new SHOW TRIGGERS statement.
sql/table.h:
enum enum_schema_tables:
Added constant for new INFORMATION_SCHEMA.TRIGGERS view.
into sanja.is.com.ua:/home/bell/mysql/bk/work-bug6-5.0
BitKeeper/etc/config:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/sp-security.result:
merge
mysql-test/r/view.result:
merge
mysql-test/t/sp-security.test:
merge
mysql-test/t/view.test:
merge
sql/item_cmpfunc.cc:
merge
sql/sql_class.h:
merge
correct value of CURRENT_USER() in SP with "security definer" (BUG#7291)
BitKeeper/etc/config:
switch off open logging
mysql-test/r/sp-security.result:
correct value from current_user() in function run from "security definer"
mysql-test/r/view.result:
evaluation constant functions in WHERE (BUG#4663)
mysql-test/t/sp-security.test:
correct value from current_user() in function run from "security definer"
mysql-test/t/view.test:
evaluation constant functions in WHERE (BUG#4663)
sql/item.cc:
Item_static_string_func creation if it is need
sql/item.h:
support of Item_static_string_func creation
sql/item_cmpfunc.cc:
do not evaluate items during view creation
sql/item_create.cc:
create Item_func_user
sql/item_strfunc.cc:
Item_func_sysconst in case of converting value still have to correctly print itself
=> use Item_static_string_func instead of Item_string
Item_func_user return USER() or CURRENT_USER()
sql/item_strfunc.h:
support of correct charset conversion procedure in Item_func_sysconst
sql/sql_class.h:
new method
sql/sql_yacc.yy:
Item_func_user now support both USER() and CURRENT_USER(), so we have to pass parametr what it is
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)
mysql-test/r/view.result:
opening table in correct locking mode test
mysql-test/t/view.test:
opening table in correct locking mode test
sql/sql_base.cc:
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
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.
sql/item.cc:
Fix bug #11709 View was ordered by wrong column
sql/item.h:
Fix bug #11709 View was ordered by wrong column
mysql-test/t/view.test:
Test case for bug #11709 View was ordered by wrong column.
mysql-test/r/view.result:
Test case for bug #11709 View was ordered by wrong column.
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.
sql/sql_view.cc:
Expanded the fix for bug #6120 to cover the case of
DROP VIEW / CREATE_VIEW.
mysql-test/r/view.result:
Expanded the test case for bug #6120 to cover
DROP VIEW / CREATE VIEW scenario.
mysql-test/t/view.test:
Expanded the test case for bug #6120 to cover
DROP VIEW / CREATE VIEW scenario.
into igor-inspiron.creware.com:/home/igor/mysql-5.0
sql/sql_base.cc:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/view.test:
Auto merged
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.
sql/sql_base.cc:
Fix bug#11399 Alias wasn't set on view column
mysql-test/t/view.test:
Test case for bug#11399 Use an alias in a select statement on a view
mysql-test/r/view.result:
Test case for bug#11399 Use an alias in a select statement on a view
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> ...
sql/sql_base.cc:
Fixed bug #11771.
Adjusted query_id for fields generated from * in queries
like this: SELECT * FROM <view> ...
sql/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> ...
mysql-test/t/view.test:
Added a test case for bug #11771.
mysql-test/r/view.result:
Added a test case for bug #11771.
Added a test case for bug #6120.
sql_view.cc:
Fixed bug #6120.
The SP cache must be invalidated when a view is altered.
sql/sql_view.cc:
Fixed bug #6120.
The SP cache must be invalidated when a view is altered.
mysql-test/t/view.test:
Added a test case for bug #6120.
mysql-test/r/view.result:
Added a test case for bug #6120.
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_table.cc:
Auto merged
mysql-test/r/view.result:
SCCS merged
mysql-test/t/view.test:
SCCS merged
mysql-test/r/view.result:
checking views after some view with error (BUG#11337)
mysql-test/t/view.test:
checking views after some view with error (BUG#11337)
sql/sql_lex.cc:
environment cleaning up for processing view one by one
sql/sql_lex.h:
methods for lex cleunup during view processing one by one
sql/sql_table.cc:
fixed environment creation and cleaning up for processing view one by one (BUG#11337)
mysql-test/r/view.result:
Using var_samp with view (BUG#10651)
mysql-test/t/view.test:
Using var_samp with view (BUG#10651)
sql/item_sum.h:
fixed var_samp printing
include/my_bitmap.h:
new bitmap operation
mysql-test/r/view.result:
added warnings
Correct inserting data check (absence of default value) for view underlying tables (BUG#6443)
mysql-test/t/view.test:
Correct inserting data check (absence of default value) for view underlying tables (BUG#6443)
mysys/my_bitmap.c:
new bitmap operation
sql/field.h:
index of field in table added
sql/item.cc:
Name resolution context added
table list removed from fix_fields() arguments
sql/item.h:
Name resolution context added
table list removed from fix_fields() arguments
sql/item_cmpfunc.cc:
table list removed from fix_fields() arguments
sql/item_cmpfunc.h:
table list removed from fix_fields() arguments
sql/item_func.cc:
table list removed from fix_fields() arguments
sql/item_func.h:
table list removed from fix_fields() arguments
sql/item_row.cc:
table list removed from fix_fields() arguments
sql/item_row.h:
table list removed from fix_fields() arguments
sql/item_strfunc.cc:
fixed server crash on NULL argument
sql/item_strfunc.h:
table list removed from fix_fields() arguments
sql/item_subselect.cc:
table list removed from fix_fields() arguments
sql/item_subselect.h:
table list removed from fix_fields() arguments
sql/item_sum.cc:
table list removed from fix_fields() arguments
sql/item_sum.h:
table list removed from fix_fields() arguments
sql/item_timefunc.cc:
table list removed from fix_fields() arguments
sql/item_timefunc.h:
table list removed from fix_fields() arguments
sql/item_uniq.h:
table list removed from fix_fields() arguments
sql/log_event.cc:
Name resolution context added
sql/log_event.h:
Name resolution context added
sql/mysql_priv.h:
Name resolution context added
sql/set_var.cc:
table list removed from fix_fields() arguments
sql/share/errmsg.txt:
new error message
sql/sp.cc:
Name resolution context added
sql/sp_head.cc:
table list removed from fix_fields() arguments
sql/sp_head.h:
Name resolution context added
sql/sql_base.cc:
table list removed from fix_fields() arguments
Name resolution context added
sql/sql_class.cc:
renamed variable
sql/sql_delete.cc:
Name resolution context added
sql/sql_derived.cc:
Name resolution context added
sql/sql_do.cc:
table list removed from fix_fields() arguments
sql/sql_handler.cc:
Name resolution context added
sql/sql_help.cc:
Name resolution context added
sql/sql_insert.cc:
Name resolution context added
table list removed from fix_fields() arguments
sql/sql_lex.cc:
Name resolution context added
sql/sql_lex.h:
removed resolve mode (information stored into name resolution context)
sql/sql_load.cc:
table list removed from fix_fields() arguments
sql/sql_olap.cc:
Name resolution context added
sql/sql_parse.cc:
Name resolution context added
sql/sql_prepare.cc:
table list removed from fix_fields() arguments
sql/sql_select.cc:
table list removed from fix_fields() arguments
sql/sql_show.cc:
Name resolution context added
sql/sql_trigger.cc:
table list removed from fix_fields() arguments
sql/sql_udf.h:
table list removed from fix_fields() arguments
sql/sql_union.cc:
Name resolution context added
sql/sql_update.cc:
Name resolution context added
sql/sql_view.cc:
Name resolution context added
sql/sql_view.h:
table list removed from fix_fields() arguments
sql/sql_yacc.yy:
Name resolution context added
sql/table.cc:
Name resolution context added
merged view processing moved
sql/table.h:
merged view processing moved
Wrong comparing method were choosen which results in false comparison.
Make Item_bool_func2::fix_length_and_dec() to get type and field from
real_item() to make REF_ITEM pass the check.
sql/item_cmpfunc.cc:
Fix bug#11325 Wrong date comparison in views
mysql-test/t/view.test:
Test case for bug#11325 Wrong date comparison in views.
mysql-test/r/view.result:
Test case for bug#11325 Wrong date comparison in views.