Skip to content

Commit

Permalink
test /w example from issue description
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Aug 25, 2022
1 parent cf382fd commit 5f207e6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ext/oci8/tests/bug-gh8928.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ if ($mem !== memory_get_usage()) {
}
var_dump($res === $expectedStr);

for ($i = 0; $i < 10; $i++) {
$sql = 'select CONCAT(CONCAT(TO_CLOB(\'atk__binary__u5f8mzx4vsm8g2c9__7eedd908a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc9516542fb97249b20d0ff6c58506443c8cc9f68543f6e5a4dd295d6f95e7249f18d1ada91166276f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0b3a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc9516542fb97249b20d0ff6c58506443c8cc9f68543f6e5a4dd295d6f95e7249f18d1ada9116627\'), TO_CLOB(\'6f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0b3a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc9516542fb97249b20d0ff6c58506443c8cc9f68543f6e5a4dd295d6f95e7249f18d1ada91166276f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0b3a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc9516542fb97249b20d0ff6c58506443c8cc9f68543f6e5a4dd295d\')), CONCAT(TO_CLOB(\'6f95e7249f18d1ada91166276f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0b3a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc9516542fb97249b20d0ff6c58506443c8cc9f68543f6e5a4dd295d6f95e7249f18d1ada91166276f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0b3a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc9516542fb97249b20d0ff6c5850644\'), CONCAT(TO_CLOB(\'3c8cc9f68543f6e5a4dd295d6f95e7249f18d1ada91166276f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0b3a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc9516542fb97249b20d0ff6c58506443c8cc9f68543f6e5a4dd295d6f95e7249f18d1ada91166276f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0b3a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc951654\'), TO_CLOB(\'2fb97249b20d0ff6c58506443c8cc9f68543f6e5a4dd295d6f95e7249f18d1ada91166276f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0\')))) AS "v" from "DUAL"';
$expectedStr = 'atk__binary__u5f8mzx4vsm8g2c9__7eedd908a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc9516542fb97249b20d0ff6c58506443c8cc9f68543f6e5a4dd295d6f95e7249f18d1ada91166276f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0b3a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc9516542fb97249b20d0ff6c58506443c8cc9f68543f6e5a4dd295d6f95e7249f18d1ada91166276f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0b3a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc9516542fb97249b20d0ff6c58506443c8cc9f68543f6e5a4dd295d6f95e7249f18d1ada91166276f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0b3a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc9516542fb97249b20d0ff6c58506443c8cc9f68543f6e5a4dd295d6f95e7249f18d1ada91166276f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0b3a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc9516542fb97249b20d0ff6c58506443c8cc9f68543f6e5a4dd295d6f95e7249f18d1ada91166276f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0b3a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc9516542fb97249b20d0ff6c58506443c8cc9f68543f6e5a4dd295d6f95e7249f18d1ada91166276f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0b3a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc9516542fb97249b20d0ff6c58506443c8cc9f68543f6e5a4dd295d6f95e7249f18d1ada91166276f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0b3a7b43ba3b8ec88338437e8bce2087e297a2dc612deb10abe043100adc20e566a3dce26ca6652419d1e992245fdf793148f18f34f746047d8d41c5c704b4ef28e199215f65d714a1dd5d9756146675340cb27cf576b3cfc4498239c1fdfc7137b2c097f28e3acc30f300105b00bbfa2b93aa6b5bde985368932ede5aec10d078103aa11c5b2e17d2a792eddeba887348338e7a4b7ef8ba0bb5f7348f8d794d36f5b4cf463779017db8c1bf06d59fed19a219625fa69553e9ecdc9516542fb97249b20d0ff6c58506443c8cc9f68543f6e5a4dd295d6f95e7249f18d1ada91166276f5e682398635a9eaa1ba8aeea5b6ab10c4020680afc00ce4dc782f7c2be0';

$stid = oci_parse($c, $sql);
oci_execute($stid);
$row = oci_fetch_array($stid, \OCI_ASSOC);
$res = $row['v']->load();
var_dump(strlen($res));

$prevMem = $i > 4 ? $mem : null;
gc_collect_cycles(); gc_collect_cycles();
$mem = memory_get_usage();
if ($prevMem !== null && $mem !== $prevMem) {
echo (string) (new \Exception('leak detected'));
}
}

?>
--EXPECTF--
array(1) {
Expand Down

0 comments on commit 5f207e6

Please sign in to comment.