newrelic-php-agent: Mysqli_commit fails on PHP agent v9.17.0.300

When we call mysqli->commit() to commit a transaction, it returns NULL instead of a boolean. Sometimes the transaction works, sometimes it does not. This issue has been mentioned on New Relic’s forums so we aren’t the only people encountering this.

Steps to Reproduce

Here’s a short test script that shows the problem.

<?php

$mysqli = new mysqli('[database location]', '[db user]', '[db password]', '[database]');
$com = $mysqli->autocommit(false);
$result = $mysqli->query("INSERT into mytestdatabase.test_table (name) VALUES ('John Doe')");
$success = $mysqli->commit();

var_dump($success); // Outputs NULL

Expected Behavior

I’d expect $mysqli->commit to return true if the transaction was committed, or false if it failed.

Relevant Logs / Console output

There are no errors that we’ve seen in PHP logs or New Relic logs. No exception is thrown.

Your Environment

  • New Relic daemon version 9.17.0.300-adbdca64f20e
  • PHP 7.4.7
  • MySQL 5.7.33
  • Amazon Linux release 2

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 17 (8 by maintainers)

Most upvoted comments

We had this problem with 9.17.0.300, and it’s now fixed for us too with 9.17.1.301 on Ubuntu 20.04, tested both with Ubuntu’s PHP 7.4.3, and with Ondrej’s PHP 7.4.16.

Thanks @kneitinger - the issue seems to be fixed for us, though we’ll leave it on our testing server for a day or so before we start using it in production again.

Installed Packages
Name        : newrelic-php5
Arch        : x86_64
Version     : 9.17.1.301
Release     : 1
Size        : 33 M
Repo        : installed
From repo   : newrelic

We’re running Amazon Linux 2, but using the following RPM: http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm

Sure thing. I will just wait overnight and see what happens

On Wed, Apr 28, 2021 at 5:53 PM Kyle Kneitinger @.***> wrote:

Perhaps it may, particularly if you’re in a hosted environment where some caching is happening. If that is the case, then there isn’t anything we can do on our side.

Since this conversation is deviating a bit from this issue’s purpose, if you have more questions would you mind opening a new issue so that other mysqli folks don’t have to hear us compare our yums? 😄

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/newrelic/newrelic-php-agent/issues/144#issuecomment-828805417, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVDDLVZ2YQJEPNBWROCKIDTLB7XDANCNFSM43MV53RQ .

Chris Muench Owner PHP Point Of Sale, LLC https://www.phppointofsale.com Direct +1 585-880-6599

Want cheaper and better Credit Card Processing? Checkout CardConnect! https://cardconnect.com/signup/php-pos

Love PHP POS? Signup for our reseller program https://phppointofsale.com/resellers.php and get paid to recommend us!

Want to improve PHP POS? Leave Feedback and vote on other requests! https://feedback.phppointofsale.com/

Hi all,

We just put out a patch release (9.17.1) that addresses this issue! We’ll leave this issue open for a few days to verify that this solution is working well for folks, so please feel free to leave any feedback about your experience! Thanks!