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
8285b957
Commit
8285b957
authored
Nov 04, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Test of prepared+execute/once prepared many execute selects
parent
9b7e5a7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
sql-bench/test-insert.sh
sql-bench/test-insert.sh
+51
-0
No files found.
sql-bench/test-insert.sh
View file @
8285b957
...
...
@@ -281,6 +281,57 @@ if ($limits->{'unique_index'})
select_test:
# ----------------- prepared+executed/prepared*executed tests
print
"Test of prepared+execute/once prepared many execute selects
\n
"
;
$loop_time
=
new Benchmark
;
for
(
$i
=
1
;
$i
<
=
$opt_loop_count
;
$i
++
)
{
my
(
$key_value
)=
$random
[
$i
]
;
my
(
$query
)=
"select * from bench1 where id=
$key_value
"
;
print
"
$query
\n
"
if
(
$opt_debug
)
;
$sth
=
$dbh
->prepare
(
$query
)
;
if
(!
$sth
)
{
die
"error in prepare select with id =
$key_value
:
$DBI
::errstr"
;
}
;
if
(!
$sth
->execute
)
{
die
"cannot execute prepare select with id =
$key_value
:
$DBI
::errstr"
;
}
while
(
$sth
->fetchrow_arrayref
)
{
}
;
$sth
->finish
;
}
;
$end_time
=
new Benchmark
;
print
"Time for prepared_select (
$opt_loop_count
): "
.
timestr
(
timediff
(
$end_time
,
$loop_time
)
,
"all"
)
.
"
\n
"
;
$loop_time
=
new Benchmark
;
$query
=
"select * from bench1 where id=?"
;
$sth
=
$dbh
->prepare
(
$query
)
;
if
(!
$sth
)
{
die
"cannot prepare select:
$DBI
::errstr"
;
}
;
for
(
$i
=
1
;
$i
<
=
$opt_loop_count
;
$i
++
)
{
my
(
$key_value
)=
$random
[
$i
]
;
$sth
->bind_param
(
1,
$key_value
)
;
print
"
$query
, id =
$key_value
\n
"
if
(
$opt_debug
)
;
if
(!
$sth
->execute
)
{
die
"cannot execute prepare select with id =
$key_value
:
$DBI
::errstr"
;
}
while
(
$sth
->fetchrow_arrayref
)
{
}
;
}
;
$sth
->finish
;
$end_time
=
new Benchmark
;
print
"Time for once_prepared_select (
$opt_loop_count
): "
.
timestr
(
timediff
(
$end_time
,
$loop_time
)
,
"all"
)
.
"
\n
"
;
print
"Retrieving data from the table
\n
"
;
$loop_time
=
new Benchmark
;
$error
=
0
;
...
...
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