~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/t/change_user.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Bug#20023 mysql_change_user() resets the value of SQL_BIG_SELECTS
 
3
#
 
4
 
 
5
--echo Bug#20023
 
6
SELECT @@session.sql_big_selects;
 
7
# The exact value depends on the server build flags
 
8
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
 
9
SELECT @@global.max_join_size;
 
10
--echo change_user
 
11
--change_user
 
12
SELECT @@session.sql_big_selects;
 
13
# The exact value depends on the server build flags
 
14
--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
 
15
SELECT @@global.max_join_size;
 
16
SET @@global.max_join_size = 10000;
 
17
SET @@session.max_join_size = default;
 
18
--echo change_user
 
19
--change_user
 
20
SELECT @@session.sql_big_selects;
 
21
# On some machines the following will result into a warning
 
22
--disable_warnings
 
23
SET @@global.max_join_size = -1;
 
24
--enable_warnings
 
25
SET @@session.max_join_size = default;
 
26
--echo change_user
 
27
--change_user
 
28
SELECT @@session.sql_big_selects;
 
29
 
 
30
#
 
31
# Bug#31418 User locks misfunctioning after mysql_change_user()
 
32
#
 
33
 
 
34
--echo Bug#31418
 
35
SELECT IS_FREE_LOCK('bug31418');
 
36
SELECT IS_USED_LOCK('bug31418');
 
37
SELECT GET_LOCK('bug31418', 1);
 
38
SELECT IS_USED_LOCK('bug31418') = CONNECTION_ID();
 
39
--echo change_user
 
40
--change_user
 
41
SELECT IS_FREE_LOCK('bug31418');
 
42
SELECT IS_USED_LOCK('bug31418');
 
43
 
 
44
#
 
45
# Bug#31222: com_% global status counters behave randomly with
 
46
# mysql_change_user.
 
47
#
 
48
 
 
49
FLUSH STATUS;
 
50
 
 
51
--disable_result_log
 
52
--disable_query_log
 
53
 
 
54
let $i = 100;
 
55
 
 
56
while ($i)
 
57
{
 
58
  dec $i;
 
59
 
 
60
  SELECT 1;
 
61
}
 
62
 
 
63
--enable_query_log
 
64
--enable_result_log
 
65
 
 
66
let $before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_select',Value,1);
 
67
 
 
68
--change_user
 
69
 
 
70
let $after= query_get_value(SHOW GLOBAL STATUS LIKE 'com_select',Value,1);
 
71
 
 
72
if (`select $after != $before`){
 
73
  SHOW GLOBAL STATUS LIKE 'com_select';
 
74
  die The value of com_select changed during change_user;
 
75
}
 
76
echo Value of com_select did not change;