-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from newrelic/dev
Merge 9.17.1 changes from dev to main
- Loading branch information
Showing
7 changed files
with
155 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
9.17.0 | ||
9.17.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?php | ||
/* | ||
* Copyright 2020 New Relic Corporation. All rights reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/*DESCRIPTION | ||
The agent should record a slow sql trace when a prepared | ||
statment with a parameter is executed via PDOStatement::execute() | ||
exceeds the explain threshold. | ||
*/ | ||
|
||
/*SKIPIF | ||
<?php require('skipif_mysql.inc'); | ||
*/ | ||
|
||
/*INI | ||
newrelic.datastore_tracer.database_name_reporting.enabled = 0 | ||
newrelic.datastore_tracer.instance_reporting.enabled = 0 | ||
newrelic.transaction_tracer.explain_enabled = true | ||
newrelic.transaction_tracer.explain_threshold = 0 | ||
newrelic.transaction_tracer.record_sql = "obfuscated" | ||
*/ | ||
|
||
/*EXPECT | ||
ok - execute prepared statement with a param | ||
*/ | ||
|
||
/*EXPECT_SLOW_SQLS | ||
[ | ||
[ | ||
[ | ||
"OtherTransaction/php__FILE__", | ||
"<unknown>", | ||
"?? SQL id", | ||
"select * from tables where table_name = ? limit ?;", | ||
"Datastore/statement/MySQL/tables/select", | ||
1, | ||
"?? total time", | ||
"?? min time", | ||
"?? max time", | ||
{ | ||
"backtrace": [ | ||
" in PDOStatement::execute called at __FILE__ (??)", | ||
" in test_prepared_statement called at __FILE__ (??)" | ||
], | ||
"explain_plan": [ | ||
[ | ||
"id", | ||
"select_type", | ||
"table", | ||
"type", | ||
"possible_keys", | ||
"key", | ||
"key_len", | ||
"ref", | ||
"rows", | ||
"Extra" | ||
], | ||
[ | ||
[ | ||
"1", | ||
"SIMPLE", | ||
"tables", | ||
"ALL", | ||
null, | ||
"TABLE_NAME", | ||
null, | ||
null, | ||
"??", | ||
"??" | ||
] | ||
] | ||
] | ||
} | ||
] | ||
] | ||
] | ||
*/ | ||
|
||
require_once(realpath (dirname ( __FILE__ )) . '/../../include/tap.php'); | ||
require_once(realpath (dirname ( __FILE__ )) . '/pdo.inc'); | ||
|
||
function test_prepared_statement() { | ||
global $PDO_MYSQL_DSN, $MYSQL_USER, $MYSQL_PASSWD; | ||
|
||
$conn = new PDO($PDO_MYSQL_DSN, $MYSQL_USER, $MYSQL_PASSWD); | ||
$stmt = $conn->prepare('select * from tables where table_name = ? limit 1;'); | ||
$stmt->bindValue(1, "missing"); | ||
tap_assert($stmt->execute(), 'execute prepared statement with a param'); | ||
} | ||
|
||
test_prepared_statement(); |