Commit graph

14357 commits

Author SHA1 Message Date
gluh@eagle.intranet.mysql.r18.ru
ae72df07f2 Bug#17204 "second CALL to procedure crashes Server"
Bug#18282 "INFORMATION_SCHEMA.TABLES provides inconsistent info about invalid views"
This bug caused crashes or resulted in wrong data being returned
when one tried to obtain information from I_S tables about views
using stored functions.

It was caused by the fact that we were using LEX representing
statement which were doing select from I_S tables as active LEX
when contents of I_S table were built. So state of this LEX both
affected and was affected by open_tables() calls which happened
during this process. This resulted in wrong behavior and in
violations of some of invariants which caused crashes.

This fix tries to solve this problem by properly saving/resetting
and restoring part of LEX which affects and is affected by the
process of opening tables and views in get_all_tables() routine.
To simplify things we separated this part of LEX in a new class
and made LEX its descendant.
2006-05-30 10:45:23 +05:00
elliot@mysql.com
47f7438333 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/emurphy/iggy/mysql-5.0
2006-05-26 15:00:09 -04:00
gkodinov@mysql.com
393d1b69e0 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/kgeorge/mysql/5.0/clean
2006-05-26 12:13:48 +03:00
gkodinov@mysql.com
b6acee915a Merge mysql.com:/home/kgeorge/mysql/5.0/clean
into  mysql.com:/home/kgeorge/mysql/5.0/B18681
2006-05-26 11:57:56 +03:00
gkodinov@mysql.com
7552d8d9ba Merge mysql.com:/home/kgeorge/mysql/5.0/clean
into  mysql.com:/home/kgeorge/mysql/5.0/B18681
2006-05-26 11:51:30 +03:00
gkodinov@mysql.com
f0f9c740ed Merge mysql.com:/home/kgeorge/mysql/5.0/clean
into  mysql.com:/home/kgeorge/mysql/5.0/B14875
2006-05-26 11:51:11 +03:00
gkodinov@mysql.com
59837f7a5b Bug #14875: Bad view DEFINER makes SHOW CREATE VIEW fail
When reading a view definition from a .frm file it was
throwing a SQL error if the DEFINER user is not defined.
Changed it to a warning to match the (documented) case
when a view with undefined DEFINER user is created.
2006-05-26 11:49:39 +03:00
gkodinov@mysql.com
a21a2b5bcd BUG#18681: View privileges are broken
The check for view security was lacking several points :
1. Check with the right set of permissions : for each table ref that
participates in a view there were the right credentials to use in it's
security_ctx member, but these weren't used for checking the credentials.
This makes hard enforcing the SQL SECURITY DEFINER|INVOKER property
consistently.
2. Because of the above the security checking for views was just ruled out
in explicit ways in several places.
3. The security was checked only for the columns of the tables that are
brought into the query from a view. So if there is no column reference
outside of the view definition it was not detecting the lack of access to
the tables in the view in SQL SECURITY INVOKER mode.

The fix below tries to fix the above 3 points.
2006-05-26 11:47:53 +03:00
pekka@mysql.com
6ff1648d99 ndb - compile fix for Solaris 10 AMD64 -max GCC [ ulonglong != Uint64 ] 2006-05-25 18:00:55 +02:00
pekka@mysql.com
61057f6112 Merge mysql.com:/space/pekka/ndb/version/my50
into  mysql.com:/space/pekka/ndb/version/my50-bug14509
2006-05-25 13:14:16 +02:00
pekka@mysql.com
da807a85b9 Merge mysql.com:/space/pekka/ndb/version/my50
into  mysql.com:/space/pekka/ndb/version/my50-bug14509
2006-05-25 13:08:50 +02:00
gkodinov@mysql.com
0336a34c7f Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/kgeorge/mysql/5.0/clean
2006-05-25 13:12:57 +03:00
gkodinov@mysql.com
486837b0fa Merge mysql.com:/home/kgeorge/mysql/5.0/clean
into  mysql.com:/home/kgeorge/mysql/5.0/B19700
2006-05-25 10:45:00 +03:00
gkodinov@mysql.com
d6b5a89044 Bug #19700: subselect returning BIGINT always returned it as SIGNED
The unsigned flag in Item was not propagated through the single value subqueries.
This caused the result to be treated as signed.
2006-05-25 10:39:18 +03:00
monty@mysql.com
4064f11acf Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2006-05-24 17:33:12 +03:00
monty@mysql.com
7cb3df0114 Merge monty@192.168.0.9:/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2006-05-24 17:32:17 +03:00
monty@mysql.com
9e9ca8b6eb More DBUG statements
Replaced COND_refresh with COND_global_read_lock becasue of a bug in NTPL threads when using different mutexes as arguments to pthread_cond_wait()
The original code caused a hang in FLUSH TABLES WITH READ LOCK in some circumstances because pthread_cond_broadcast() was not delivered to other threads.
This fixes:
Bug#16986: Deadlock condition with MyISAM tables
Bug#20048: FLUSH TABLES WITH READ LOCK causes a deadlock
2006-05-24 17:21:35 +03:00
svoj@april.(none)
551043b3df Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.0
into  april.(none):/home/svoj/devel/mysql/BUG17001/mysql-5.0
2006-05-24 16:59:27 +05:00
svoj@april.(none)
0674c702b0 Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.0
into  april.(none):/home/svoj/devel/mysql/BUG17001/mysql-5.0
2006-05-24 15:13:49 +05:00
monty@mysql.com
2a2da2f09b Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2006-05-24 12:09:16 +03:00
monty@mysql.com
97b941d924 Remove dflt_field from field structure as this was only needed when createing temporary table and I found another soultion that doesn't increase the size of the field structure for all table instances. (Better fix for bug #19089)
Fixed compiler warnings
Fixed valgrind warning in Item_date_add_intervall::eq. (Recoding of bugfix #19490)
2006-05-24 11:56:59 +03:00
cmiller@zippy.(none)
971dc90e3a Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  zippy.(none):/home/cmiller/work/mysql/mysql-5.0--bug11151
2006-05-23 15:01:05 -04:00
msvensson@neptunus.(none)
f25fcf79a5 Bug#19938 Valgrind error (race) in handle_slave_sql() 2006-05-23 20:16:57 +02:00
msvensson@neptunus.(none)
0f1ae1305d Merge bk-internal:/home/bk/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0
2006-05-23 17:05:37 +02:00
cmiller@zippy.(none)
e700e84567 Guilhelm suggested that the "load data infile" command should be flagged as
not transaction-safe for stored procedures.  Related to Bug#11151.
2006-05-23 10:29:58 -04:00
msvensson@neptunus.(none)
6fb8f4f878 Bug #19938 Valgrind error (race) in handle_slave_sql() 2006-05-23 16:20:03 +02:00
msvensson@neptunus.(none)
ebedae2cb3 Cset exclude: msvensson@neptunus.(none)|ChangeSet|20060523082057|49143 2006-05-23 16:14:48 +02:00
msvensson@neptunus.(none)
5e19424c00 Merge neptunus.(none):/home/msvensson/mysql/my41-bug13711
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0
2006-05-23 10:36:06 +02:00
msvensson@neptunus.(none)
0144b51445 Add comment for 'kill_server' function 2006-05-23 10:33:53 +02:00
gluh@eagle.intranet.mysql.r18.ru
474ef8ed43 Fix for bug#17626 CREATE TABLE ... SELECT failure with TRADITIONAL SQL mode
transfer NO_DEFAULT_VALUE_FLAG flag to new field
2006-05-23 13:27:45 +05:00
msvensson@neptunus.(none)
26face9f8b Bug#19938 Valgrind error (race) in handle_slave_sql()
- Unlock the mutex after looking at rli->events_till_abort
 - Already fixed in 5.1 so it will be null merged.
2006-05-23 10:20:57 +02:00
gluh@eagle.intranet.mysql.r18.ru
457aea43fc Bug#16681 information_schema shows forbidden VIEW details
show view definition to users that have the needed privilleges
2006-05-23 12:45:25 +05:00
igor@rurik.mysql.com
a6aaca7d6a Post-review fixes for bug #19089 2006-05-22 07:57:46 -07:00
igor@rurik.mysql.com
4a27cbfd02 Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2006-05-20 19:10:43 -07:00
igor@rurik.mysql.com
12e53358f0 Fixed bug #19089.
When a CREATE TABLE command created a table from a materialized
view id does not inherit default values from the underlying table.
Moreover the temporary table used for the view materialization
does not inherit those default values.
In the case when the underlying table contained ENUM fields it caused
misleading error messages. In other cases the created table contained
wrong default values.
The code was modified to ensure inheritance of default values for
materialized views.
2006-05-20 18:54:43 -07:00
jimw@mysql.com
2b13192c2e Merge mysql.com:/home/jimw/my/mysql-5.0-1039
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2006-05-19 16:17:24 -07:00
iggy@mysql.com
2cae56794c BUG#19322 Added help defintion for --skip-external locking to mysqld --help --verbose 2006-05-19 13:17:07 -04:00
msvensson@devsrv-b.mysql.com
49eeb1bb57 Merge msvensson@bk-internal.mysql.com:/home/bk/mysql-5.0
into  devsrv-b.mysql.com:/users/msvensson/mysql-5.0
2006-05-19 13:16:06 +02:00
msvensson@neptunus.(none)
f186a3f24e Merge neptunus.(none):/home/msvensson/mysql/my41-bug13711
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0
2006-05-19 13:09:15 +02:00
msvensson@neptunus.(none)
b9a59fa014 Bug#15869 Cannot shutdown the server - it restarts
- A segfault occured when the function 'kill_server' called 
   'my_sigset' with signal number 0. 'my_sigset' is a macro which
   uses 'sigaction' to install the signal handler with an invalid
   signal number will on most platforms return EINVAL but yields
   a segfauilt on IRIX 6.5
 - The server crash was detected by mysqld_safe and it was restarted although
   a shutdown was requested. 
 - Semantics of kill_server(0) is not known, leaving it intact
2006-05-19 13:07:24 +02:00
igor@rurik.mysql.com
710d422404 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0
into  rurik.mysql.com:/home/igor/mysql-5.0
2006-05-18 13:17:59 -07:00
igor@rurik.mysql.com
3b3e6ecb95 Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2
2006-05-18 11:30:42 -07:00
jimw@mysql.com
7d54b004a2 Bug #13975: "same string" + 0 has 2 different results
The 'decimals' member of Item_func was being improperly initialized,
  which resulted in improper results when handling large numeric values.
2006-05-18 10:34:01 -07:00
evgen@moonbone.local
894092becf Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into moonbone.local:/work/19077-bug-5.0-mysql
2006-05-18 16:01:13 +04:00
igor@rurik.mysql.com
1802e6895a Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2
2006-05-17 20:56:52 -07:00
igor@rurik.mysql.com
9ec8101813 Fixed bug #19816.
This bug was introduced when the patch resolving the
performance problem 17164 was applied. As a result
of that modification the not_null_tables attributes
were calculated incorrectly for constant OR conditions.
This triggered invalid conversion of outer joins into
inner joins.
2006-05-17 20:48:48 -07:00
evgen@moonbone.local
1d820585ae Fixed bug#19077: A nested materialized derived table is used before being populated.
The convert_constant_item() function converts constant items to ints on
prepare phase to optimize execution speed. In this case it tries to evaluate
subselect which contains a derived table and is contained in a derived table. 
All derived tables are filled only after all derived tables are prepared.
So evaluation of subselect with derived table at the prepare phase will
return a wrong result.

A new flag with_subselect is added to the Item class. It indicates that
expression which this item represents is a subselect or contains a subselect.
It is set to 0 by default. It is set to 1 in the Item_subselect constructor
for subselects.
For Item_func and Item_cond derived classes it is set after fixing any argument
in Item_func::fix_fields() and Item_cond::fix_fields accordingly.
The convert_constant_item() function now doesn't convert a constant item
if the with_subselect flag set in it.
2006-05-18 00:55:28 +04:00
pekka@mysql.com
54963c2e52 ndb - bug#14509 [related] re-do auto-incr error handling 2006-05-17 12:40:10 +02:00
igor@rurik.mysql.com
767d25dabd Fixed bug #19573.
The select statement that specified a view could be
slightly changed when the view was saved in a frm file.
In particular references to an alias name in the HAVING
clause could be substituted for the expression named by
this alias.
This could result in an error message for a query of
the form SELECT * FROM <view>. Yet no such message
appeared when executing the query specifying the view.
2006-05-16 22:19:44 -07:00
tulin@production.mysql.com
b3d8b9bbd8 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  production.mysql.com:/usersnfs/tulin/mysql-5.0
2006-05-16 21:46:00 +02:00