Merge lp:~vlad-lesin/percona-server/5.5-bug-1322218 into lp:percona-server/5.5

Proposed by Vlad Lesin on 2014-09-11
Status: Work in progress
Proposed branch: lp:~vlad-lesin/percona-server/5.5-bug-1322218
Merge into: lp:percona-server/5.5
Diff against target: 86 lines (+52/-2) (has conflicts)
2 files modified
scripts/mysql_install_db.pl.in (+28/-2)
sql/sql_acl.cc (+24/-0)
Text conflict in sql/sql_acl.cc
To merge this branch: bzr merge lp:~vlad-lesin/percona-server/5.5-bug-1322218
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) 2014-09-11 Needs Information on 2014-09-25
Review via email: mp+234292@code.launchpad.net

Description of the change

To post a comment you must log in.
692. By Vlad Lesin on 2014-09-11

Bug #1322218 fix.

Merged from 5.1.

The difference between this and 5.1 fix is in preventing floating point error
in the case if "users" table is not created.

    - Same comments as for the 5.1 fix, and
    - Is it feasible to create a MTR testcase? I.e. create a new temp
    instance, truncate mysql.user, start and shutdown the server,
    destroy the instance?

review: Needs Information

Unmerged revisions

692. By Vlad Lesin on 2014-09-11

Bug #1322218 fix.

Merged from 5.1.

The difference between this and 5.1 fix is in preventing floating point error
in the case if "users" table is not created.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/mysql_install_db.pl.in'
2--- scripts/mysql_install_db.pl.in 2014-04-18 04:02:37 +0000
3+++ scripts/mysql_install_db.pl.in 2014-09-11 11:26:18 +0000
4@@ -466,7 +466,20 @@
5
6 print PIPE $_;
7 }
8- close PIPE;
9+ if (!close PIPE)
10+ {
11+ if ($!)
12+ {
13+ error($opt, "Error closing mysqld pipe: $!");
14+ }
15+ else
16+ {
17+ error($opt,
18+ "Installation of system tables failed!",
19+ "mysqld returned $? exit status",
20+ "Examine the logs in $opt->{ldata} for more information.");
21+ }
22+ };
23 close SQL;
24 close SQL2;
25
26@@ -487,7 +500,20 @@
27 {
28 print PIPE $_;
29 }
30- close PIPE;
31+ if (!close PIPE)
32+ {
33+ if ($!)
34+ {
35+ error($opt, "Error closing mysqld pipe: $!");
36+ }
37+ else
38+ {
39+ error($opt,
40+ "Installation of system tables failed!",
41+ "mysqld returned $? exit status",
42+ "Examine the logs in $opt->{ldata} for more information.");
43+ }
44+ };
45 close SQL;
46
47 report_verbose($opt,"OK");
48
49=== modified file 'sql/sql_acl.cc'
50--- sql/sql_acl.cc 2014-08-22 09:58:37 +0000
51+++ sql/sql_acl.cc 2014-09-11 11:26:18 +0000
52@@ -8688,10 +8688,34 @@
53 Pretend the user exists; let the plugin decide how to handle
54 bad credentials.
55 */
56+<<<<<<< TREE
57 LEX_STRING usr= { mpvio->auth_info.user_name,
58 mpvio->auth_info.user_name_length };
59 mpvio->acl_user= decoy_user(usr, mpvio->mem_root);
60 mpvio->acl_user_plugin= mpvio->acl_user->plugin;
61+=======
62+ ulong nr1=1, nr2=4;
63+ CHARSET_INFO *cs= &my_charset_latin1;
64+ cs->coll->hash_sort(cs, (uchar*) mpvio->auth_info.user_name,
65+ mpvio->auth_info.user_name_length, &nr1, &nr2);
66+
67+ mysql_mutex_lock(&acl_cache->lock);
68+ if (!acl_users.elements)
69+ {
70+ mysql_mutex_unlock(&acl_cache->lock);
71+ DBUG_RETURN(1);
72+ }
73+ uint i= nr1 % acl_users.elements;
74+ ACL_USER *acl_user_tmp= dynamic_element(&acl_users, i, ACL_USER*);
75+ mpvio->acl_user= acl_user_tmp->copy(mpvio->mem_root);
76+ make_lex_string_root(mpvio->mem_root,
77+ &mpvio->acl_user_plugin,
78+ acl_user_tmp->plugin.str,
79+ acl_user_tmp->plugin.length, 0);
80+ mysql_mutex_unlock(&acl_cache->lock);
81+
82+ mpvio->make_it_fail= true;
83+>>>>>>> MERGE-SOURCE
84 }
85
86 /* user account requires non-default plugin and the client is too old */

Subscribers

People subscribed via source and target branches