Commit graph

32790 commits

Author SHA1 Message Date
Vicențiu Ciorbaru
4a58599930 Implemented SHOW GRANTS functionality 2013-10-18 06:40:25 -07:00
Vicențiu Ciorbaru
d24ead2c6f Various bug fixes.
Also updated tests to reflect new show grants functionality.
2013-10-18 06:34:27 -07:00
Vicențiu Ciorbaru
1bfc610dc7 Added show role grants functionality to the mysql_show_grants function. 2013-10-18 06:17:47 -07:00
Vicențiu Ciorbaru
2826399e64 Fixed failing test due to wrong display order 2013-10-18 06:01:01 -07:00
Vicențiu Ciorbaru
daf0345a7b Added recursive database roles privilege propagation.
The privileges are not correctly updated via grant commands yet.
2013-10-18 06:00:48 -07:00
Vicențiu Ciorbaru
3fa2cb2126 Updated error message in case the user table's format is not up to date and can
not support roles
2013-10-18 05:41:34 -07:00
Vicențiu Ciorbaru
ce4851c3d0 Reworked the implementation of create role and drop role.
Also fixed issue with drop role not clearing internal memory entry
for that role. The issue was due to a condition introduced in handle_grant_data

Updated testsuite to also check the possible error conditions.
2013-10-18 05:41:25 -07:00
Vicențiu Ciorbaru
db850c525f Added CREATE ROLE support as well as DROP ROLE support. 2013-10-18 05:41:13 -07:00
Vicențiu Ciorbaru
3566f317c0 Added simple database privilege test for roles. 2013-10-18 05:13:33 -07:00
Vicențiu Ciorbaru
dcf76e6514 Added a more complicated test for recursive role grants. 2013-10-17 20:52:29 -07:00
Vicențiu Ciorbaru
9272e34a90 Minor test update to eliminate random row order. 2013-10-17 20:52:21 -07:00
Vicențiu Ciorbaru
a0a8f50895 Added a test for acl_roles to test renaming of roles/ usernames 2013-10-17 20:52:04 -07:00
Vicențiu Ciorbaru
00f4f408ea Minor update on tests.
Fixed possible failing condition due to different order of table rows
2013-10-17 20:51:19 -07:00
Vicențiu Ciorbaru
68214d21a0 Fixed failing tests due to wrong delete in the testsuite. 2013-10-17 20:51:10 -07:00
Vicențiu Ciorbaru
b4f3ba2643 Added testcase to check that granting a role to a role works. 2013-10-17 20:50:24 -07:00
Vicențiu Ciorbaru
df16e75983 Updated acl_roles_set_role-simple test to use default sql syntax.
Also called show grants before and after set role. Unfortunately the role
privileges printing are not implemented yet.
2013-10-17 20:45:39 -07:00
Vicențiu Ciorbaru
5470c200d5 Added testcase for the command SET ROLE.
The testcase checks to see if the privileges are set accordingly to a newly
created user. This is the most general usecase.
2013-10-17 20:45:25 -07:00
Vicențiu Ciorbaru
d96e7fa765 Added testcase for acl_roles.
The testcase checks to see if the create user command sets the is_role column
to 'N' by default
2013-10-17 20:45:11 -07:00
Vicențiu Ciorbaru
8bb04a90c2 Modified test result to accound for the roles_mapping table. 2013-10-17 14:57:15 -07:00
timour@askmonty.org
afed809297 MDEV-5123 Remove duplicated conditions pushed both to join_tab->select_cond and join_tab->cache_select->cond for blocked joins.
BNL and BNLH joins pre-filter the records from a joined table via JOIN_TAB::cache_select->cond.
There is no need to re-evaluate the same conditions via JOIN_TAB::select_cond. This patch removes
the duplicated conditions from the top-level conjuncts of each pushed condition.

The added "Using where" in few EXPLAINs is due to taking into account tab->cache_select->cond
in addition to tab->select_cond in JOIN::save_explain_data_intern.
2013-10-18 11:45:25 +03:00
Alexander Barkov
b88bf50ec1 Merge 5.5 -> 10.0-base 2013-10-16 20:41:50 +04:00
Alexander Barkov
1039182354 Merge 5.5 -> 10.0-base 2013-10-16 20:26:16 +04:00
Alexander Barkov
70f066eba4 Merge 5.5 -> 10.0-base 2013-10-16 20:24:02 +04:00
Alexander Barkov
11005f3413 Merge 5.3->5.5 2013-10-16 18:17:51 +04:00
Alexander Barkov
5064d03b80 Merge 5.3 -> 5.5. 2013-10-16 17:58:54 +04:00
Alexander Barkov
049000101a Merge 5.1 -> 5.3 2013-10-16 17:48:31 +04:00
Alexander Barkov
de4ca539b8 MDEV-4890 Valgrind warnings on shutdown on a build with openSSL 2013-10-16 17:37:11 +04:00
unknown
73f8b4dac2 MDEV-4981: Account for queries handled by query-cache in USER_STATISTICS (and in HOST_STATISTICS)
fix for SP & PS
2013-10-16 16:07:25 +03:00
Sergey Petrunya
c0a741f005 Fix buildbot failures:
- MYSQL_MULTI_DELETE_DONE probe compile failure
- show_explain_non_select.test
2013-10-15 16:39:54 +04:00
Sergey Petrunya
1e36cbfa39 MDEV-3798: [SHOW] EXPLAIN UPDATE/DELETE
- Merge with 10.0-base
2013-10-15 11:51:41 +04:00
Sergey Petrunya
25d0175fde MDEV-3798: EXPLAIN UPDATE/DELETE:
- Port grant_explain_non_select.{test,result} from mysql-5.6
- Per Sanja's hint, fix mysql_make_view() to take into 
  account that EXPLAIN now is not necessarily EXPLAIN SELECT.
2013-10-15 11:43:34 +04:00
Sergey Petrunya
e522ebc221 Update test results for the last cset. 2013-10-15 10:36:39 +04:00
Sergey Petrunya
a06170c8d8 MDEV-3798: EXPLAIN UPDATE/DELETE
- Fix a problem with EXPLAIN multi_table UPDATE: 
  = Do use multi_update object, because multi_update::prepare() does
    various setup, e.g. it disables index-only for the tables to be updated.
  = Protect multi_update::prepare() from being invoked multiple times. 
    If the query has subqueries, they may try to invoke it, for some reason.
2013-10-15 10:34:46 +04:00
Igor Babaev
eb2c6f4513 Merge 5.5->10.0-base 2013-10-14 13:39:18 -07:00
Igor Babaev
1381585244 Merge 5.3->5.5 2013-10-14 12:08:55 -07:00
Igor Babaev
81623bdc35 Fixed bug mdev-5135.
The patch for bug mdev-5105 incorrectly counted conditions in nested joins.
2013-10-14 10:29:24 -07:00
Sergey Petrunya
105e3ae6c9 MDEV-3798: EXPLAIN UPDATE/DELETE
Update the SHOW EXPLAIN code to work with the 
new architecture (part#1):
Before, SHOW EXPLAIN operated on real query plan structures, 
which meant it had to check when SELECTs are created/deleted.
SELECTs would call apc_target->enable() when they got a query 
plan and disable() when their query plan was deleted.

Now, Explain data structure becomes available at once (and we
call apc_target->enable()) and then it stays until it is deleted
(when that happens, we call apc_target->disable()).
2013-10-14 20:09:33 +04:00
Igor Babaev
ddc46740a5 Merge 5.5->10.0-base 2013-10-13 18:10:19 -07:00
Igor Babaev
c7db46a242 Merge 5.3-5.5 2013-10-13 13:43:29 -07:00
Igor Babaev
78b580b779 Fixed bug mdev-5132.
Objects of the classes Item_func_isnull and Item_func_isnotnull
must have the flag sargable set to TRUE.
Set the value of the flag sargable only in constructors of the 
classes inherited from Item_int_func.
2013-10-11 23:24:57 -07:00
Sergey Petrunya
3e8f7c8516 MDEV-5122: "Commands out of sync", "Malformed packet" or client hang up...
- When INSERT catches an error, it should not attempt to send parts of 
  EXPLAIN output.
2013-10-11 19:27:53 +04:00
unknown
3cc3bcfcc5 MDEV-5107:Left Join Yields All Nulls Instead of Appropriate Matches
MDEV-5034:Wrong result on LEFT JOIN with a SELECT SQ or a merge view, UNION in IN subquery

Make reset null_row same as it was set in evaluate_null_complemented_join_record().

The problem was that view firlds detect null_row by not-yet-reset table.
2013-10-11 15:57:19 +03:00
Sergey Petrunya
a1705b762e Update tests: log_slow_verbosity now supports query_plan=explan. 2013-10-11 12:40:25 +04:00
Igor Babaev
7c87385e30 Fixed bug mdev-5105.
The bug caused a memory overwrite in the function update_ref_and_keys()
It happened due to a wrong value of SELECT_LEX::cond_count. This value
historically was calculated by the fix_fields method. Now the logic of
calling this method became too complicated and, as a result, this value
is calculated not always correctly.
The patch changes the way how and when  the values of SELECT_LEX::cond_count
and of SELECT_LEX::between_count are calculated. The new code does it just at
the beginning of update_ref_and_keys().
2013-10-10 10:08:26 -07:00
Sergey Petrunya
094f70fd19 MDEV-5106: Server crashes in Explain_union::print_explain on ER_TOO_BIG_SELECT
- Don't save UNION's EXPLAIN data if optimization failed with 
  an error. We could end up saving incomplete plan, which will 
  cause a crash when we attempt to print it.
2013-10-10 20:30:32 +04:00
Sergey Petrunya
582ecb2a25 MDEV-3798: EXPLAIN UPDATE/DELETE:
Backport mysql-test/t/myisam_explain_non_select_all.test from mysql-5.6
- the .result file was modified because MariaDB choses different 
  query plans in a number cases. Also, we don't have some of the 
  "incorrect EXPLAIN output" bugs that they still have.

The .test file and includes were taken verbatim with one 
exception: two tests were disabled with --disable parsing:

1. @@sql_safe_updates is not enforced EXPLAINs of multitable 
   updates. In MariaDB, the execution itself will produce 
   ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE, but EXPLAIN won't.
2. Their case #71 hits some old bug in MyISAM (See their comments
   in explain_non_select.inc for details).
2013-10-09 17:20:42 +04:00
Sergey Petrunya
7e919c52a5 MDEV-3798: EXPLAIN UPDATE/DELETE
- Produce correct `key_len` when type=index.
2013-10-09 17:15:34 +04:00
Sergey Petrunya
3c6ac6694d MDEV-3798: EXPLAIN UPDATE/DELETE
- Produce correct #rows for ORDER BY ... LIMIT N queries that take advantage of 
  ordered index read to read only N rows.
2013-10-09 13:07:46 +04:00
Alexander Barkov
1bcd2bebc6 MDEV-4425 Regexp enhancements
Do not pass PCRE_UCP flag for binary data.
This makes bytes 0x80..FF not to belong to 
generic character classes \d (digit) and \w (word character).

SELECT 0xFF RLIKE '\\w';
 -> 0

Note, this change does not affect non-binary data,
which is still examined with the PCRE_UCP flag by default.
2013-10-08 18:25:17 +04:00
Sergey Petrunya
69e6a2bb22 MDEV-3798: EXPLAIN UPDATE/DELETE
- Update test results after last few csets
- Generate correct value for `possible_keys` column for single table UPDATE/DELETE.
2013-10-08 16:13:49 +04:00