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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
461de0f3
Commit
461de0f3
authored
Feb 26, 2008
by
kostja@dipika.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use an API instead of looking into stmt internals to fetch fields
(Test for Bug#32265)
parent
a86ca245
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
tests/mysql_client_test.c
tests/mysql_client_test.c
+17
-5
No files found.
tests/mysql_client_test.c
View file @
461de0f3
...
...
@@ -16120,6 +16120,7 @@ static void test_bug32265()
int
rc
;
MYSQL_STMT
*
stmt
;
MYSQL_FIELD
*
field
;
MYSQL_RES
*
metadata
;
DBUG_ENTER
(
"test_bug32265"
);
myheader
(
"test_bug32265"
);
...
...
@@ -16137,50 +16138,61 @@ static void test_bug32265()
rc
=
mysql_stmt_execute
(
stmt
);
check_execute
(
stmt
,
rc
);
field
=
stmt
->
mysql
->
fields
;
metadata
=
mysql_stmt_result_metadata
(
stmt
);
field
=
mysql_fetch_field
(
metadata
);
DIE_UNLESS
(
field
);
DIE_UNLESS
(
strcmp
(
field
->
table
,
"t1"
)
==
0
);
DIE_UNLESS
(
strcmp
(
field
->
org_table
,
"t1"
)
==
0
);
DIE_UNLESS
(
strcmp
(
field
->
db
,
"client_test_db"
)
==
0
);
mysql_free_result
(
metadata
);
mysql_stmt_close
(
stmt
);
stmt
=
open_cursor
(
"SELECT a '' FROM t1 ``"
);
rc
=
mysql_stmt_execute
(
stmt
);
check_execute
(
stmt
,
rc
);
field
=
stmt
->
mysql
->
fields
;
metadata
=
mysql_stmt_result_metadata
(
stmt
);
field
=
mysql_fetch_field
(
metadata
);
DIE_UNLESS
(
strcmp
(
field
->
table
,
""
)
==
0
);
DIE_UNLESS
(
strcmp
(
field
->
org_table
,
"t1"
)
==
0
);
DIE_UNLESS
(
strcmp
(
field
->
db
,
"client_test_db"
)
==
0
);
mysql_free_result
(
metadata
);
mysql_stmt_close
(
stmt
);
stmt
=
open_cursor
(
"SELECT a '' FROM t1 ``"
);
rc
=
mysql_stmt_execute
(
stmt
);
check_execute
(
stmt
,
rc
);
field
=
stmt
->
mysql
->
fields
;
metadata
=
mysql_stmt_result_metadata
(
stmt
);
field
=
mysql_fetch_field
(
metadata
);
DIE_UNLESS
(
strcmp
(
field
->
table
,
""
)
==
0
);
DIE_UNLESS
(
strcmp
(
field
->
org_table
,
"t1"
)
==
0
);
DIE_UNLESS
(
strcmp
(
field
->
db
,
"client_test_db"
)
==
0
);
mysql_free_result
(
metadata
);
mysql_stmt_close
(
stmt
);
stmt
=
open_cursor
(
"SELECT * FROM v1"
);
rc
=
mysql_stmt_execute
(
stmt
);
check_execute
(
stmt
,
rc
);
field
=
stmt
->
mysql
->
fields
;
metadata
=
mysql_stmt_result_metadata
(
stmt
);
field
=
mysql_fetch_field
(
metadata
);
DIE_UNLESS
(
strcmp
(
field
->
table
,
"v1"
)
==
0
);
DIE_UNLESS
(
strcmp
(
field
->
org_table
,
"t1"
)
==
0
);
DIE_UNLESS
(
strcmp
(
field
->
db
,
"client_test_db"
)
==
0
);
mysql_free_result
(
metadata
);
mysql_stmt_close
(
stmt
);
stmt
=
open_cursor
(
"SELECT * FROM v1 /* SIC */ GROUP BY 1"
);
rc
=
mysql_stmt_execute
(
stmt
);
check_execute
(
stmt
,
rc
);
field
=
stmt
->
mysql
->
fields
;
metadata
=
mysql_stmt_result_metadata
(
stmt
);
field
=
mysql_fetch_field
(
metadata
);
DIE_UNLESS
(
strcmp
(
field
->
table
,
"v1"
)
==
0
);
DIE_UNLESS
(
strcmp
(
field
->
org_table
,
"t1"
)
==
0
);
DIE_UNLESS
(
strcmp
(
field
->
db
,
"client_test_db"
)
==
0
);
mysql_free_result
(
metadata
);
mysql_stmt_close
(
stmt
);
rc
=
mysql_query
(
mysql
,
"DROP VIEW v1"
);
...
...
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