Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c721cef5
Commit
c721cef5
authored
Jul 27, 2009
by
Davi Arnaut
Browse files
Options
Browse Files
Download
Plain Diff
Merge from mysql-5.0-bugteam.
parents
3912c217
d5e84db3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
23 deletions
+30
-23
tests/mysql_client_test.c
tests/mysql_client_test.c
+30
-23
No files found.
tests/mysql_client_test.c
View file @
c721cef5
...
@@ -16951,9 +16951,10 @@ static void bug20023_change_user(MYSQL *con)
...
@@ -16951,9 +16951,10 @@ static void bug20023_change_user(MYSQL *con)
opt_db
?
opt_db
:
"test"
));
opt_db
?
opt_db
:
"test"
));
}
}
static
my_bool
query_
int
_variable
(
MYSQL
*
con
,
static
my_bool
query_
str
_variable
(
MYSQL
*
con
,
const
char
*
var_name
,
const
char
*
var_name
,
int
*
var_value
)
char
*
str
,
size_t
len
)
{
{
MYSQL_RES
*
rs
;
MYSQL_RES
*
rs
;
MYSQL_ROW
row
;
MYSQL_ROW
row
;
...
@@ -16962,10 +16963,8 @@ static my_bool query_int_variable(MYSQL *con,
...
@@ -16962,10 +16963,8 @@ static my_bool query_int_variable(MYSQL *con,
my_bool
is_null
;
my_bool
is_null
;
my_snprintf
(
query_buffer
,
my_snprintf
(
query_buffer
,
sizeof
(
query_buffer
),
sizeof
(
query_buffer
),
"SELECT %s"
,
var_name
);
"SELECT %s"
,
(
const
char
*
)
var_name
);
DIE_IF
(
mysql_query
(
con
,
query_buffer
));
DIE_IF
(
mysql_query
(
con
,
query_buffer
));
DIE_UNLESS
(
rs
=
mysql_store_result
(
con
));
DIE_UNLESS
(
rs
=
mysql_store_result
(
con
));
...
@@ -16974,28 +16973,44 @@ static my_bool query_int_variable(MYSQL *con,
...
@@ -16974,28 +16973,44 @@ static my_bool query_int_variable(MYSQL *con,
is_null
=
row
[
0
]
==
NULL
;
is_null
=
row
[
0
]
==
NULL
;
if
(
!
is_null
)
if
(
!
is_null
)
*
var_value
=
atoi
(
row
[
0
]);
my_snprintf
(
str
,
len
,
"%s"
,
row
[
0
]);
mysql_free_result
(
rs
);
mysql_free_result
(
rs
);
return
is_null
;
return
is_null
;
}
}
static
my_bool
query_int_variable
(
MYSQL
*
con
,
const
char
*
var_name
,
int
*
var_value
)
{
char
str
[
32
];
my_bool
is_null
=
query_str_variable
(
con
,
var_name
,
str
,
sizeof
(
str
));
if
(
!
is_null
)
*
var_value
=
atoi
(
str
);
return
is_null
;
}
static
void
test_bug20023
()
static
void
test_bug20023
()
{
{
MYSQL
con
;
MYSQL
con
;
int
sql_big_selects_orig
;
int
sql_big_selects_orig
;
int
max_join_size_orig
;
/*
Type of max_join_size is ha_rows, which might be ulong or off_t
depending on the platform or configure options. Preserve the string
to avoid type overflow pitfalls.
*/
char
max_join_size_orig
[
32
];
int
sql_big_selects_2
;
int
sql_big_selects_2
;
int
sql_big_selects_3
;
int
sql_big_selects_3
;
int
sql_big_selects_4
;
int
sql_big_selects_4
;
int
sql_big_selects_5
;
int
sql_big_selects_5
;
#if NOT_USED
char
query_buffer
[
MAX_TEST_QUERY_LENGTH
];
char
query_buffer
[
MAX_TEST_QUERY_LENGTH
];
#endif
/* Create a new connection. */
/* Create a new connection. */
...
@@ -17018,9 +17033,10 @@ static void test_bug20023()
...
@@ -17018,9 +17033,10 @@ static void test_bug20023()
"@@session.sql_big_selects"
,
"@@session.sql_big_selects"
,
&
sql_big_selects_orig
);
&
sql_big_selects_orig
);
query_
int
_variable
(
&
con
,
query_
str
_variable
(
&
con
,
"@@global.max_join_size"
,
"@@global.max_join_size"
,
&
max_join_size_orig
);
max_join_size_orig
,
sizeof
(
max_join_size_orig
));
/***********************************************************************
/***********************************************************************
Test that COM_CHANGE_USER resets the SQL_BIG_SELECTS to the initial value.
Test that COM_CHANGE_USER resets the SQL_BIG_SELECTS to the initial value.
...
@@ -17093,25 +17109,16 @@ static void test_bug20023()
...
@@ -17093,25 +17109,16 @@ static void test_bug20023()
Check that SQL_BIG_SELECTS will be the original one.
Check that SQL_BIG_SELECTS will be the original one.
***********************************************************************/
***********************************************************************/
#if NOT_USED
/*
max_join_size is a ulong or better.
my_snprintf() only goes up to ul.
*/
/* Restore MAX_JOIN_SIZE. */
/* Restore MAX_JOIN_SIZE. */
my_snprintf
(
query_buffer
,
my_snprintf
(
query_buffer
,
sizeof
(
query_buffer
),
sizeof
(
query_buffer
),
"SET @@global.max_join_size = %
d
"
,
"SET @@global.max_join_size = %
s
"
,
(
int
)
max_join_size_orig
);
max_join_size_orig
);
DIE_IF
(
mysql_query
(
&
con
,
query_buffer
));
DIE_IF
(
mysql_query
(
&
con
,
query_buffer
));
#else
DIE_IF
(
mysql_query
(
&
con
,
"SET @@global.max_join_size = -1"
));
DIE_IF
(
mysql_query
(
&
con
,
"SET @@global.max_join_size = -1"
));
#endif
DIE_IF
(
mysql_query
(
&
con
,
"SET @@session.max_join_size = default"
));
DIE_IF
(
mysql_query
(
&
con
,
"SET @@session.max_join_size = default"
));
/* Issue COM_CHANGE_USER. */
/* Issue COM_CHANGE_USER. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment