View Issue Details

IDProjectCategoryView StatusLast Update
0031928mantisbtdb mysqlpublic2023-11-01 03:49
ReporterRosek93 Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version2.25.5 
Summary0031928: Error on installation MantisBT 2.25.5
Description

Stack:

  • PHP 8.2
  • MySQL 8.0

I try downgrade MySQL to 5.7

Error:

[Tue Jan 24 18:52:08.972733 2023] [php:error] [pid 22] [client 35.191.17.199:42306] PHP Fatal error:  Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'schema()schema()' at line 5 in /var/www/html/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php:808
Stack trace:
#0 /var/www/html/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php(808): mysqli_query()
0000001 /var/www/html/vendor/adodb/adodb-php/adodb.inc.php(1282): ADODB_mysqli->_query()
0000002 /var/www/html/vendor/adodb/adodb-php/adodb.inc.php(1260): ADOConnection->_Execute()
0000003 /var/www/html/vendor/adodb/adodb-php/adodb.inc.php(2599): ADOConnection->Execute()
0000004 /var/www/html/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php(569): ADOConnection->MetaTables()
0000005 /var/www/html/core/database_api.php(868): ADODB_mysqli->MetaTables()
#6 /var/www/html/core/database_api.php(506): db_get_table_list()
0000007 /var/www/html/core/config_api.php(82): db_table_exists()
#8 /var/www/html/core/lang_api.php(159): config_get()
0000009 /var/www/html/core/lang_api.php(124): lang_map_auto()
#10 /var/www/html/core/error_api.php(164): lang_get_default()
#11 [internal function]: error_handler()
0000012 /var/www/html/core/error_api.php(92): trigger_error()
#13 [internal function]: error_exception_handler()
#14 {main}
  thrown in /var/www/html/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php on line 808, referer: xxx

EDIT (dregad): reformatted error stack trace with line breaks

Tagspatch, PHP 8.2

Relationships

related to 0032028 closeddregad Update ADOdb to 5.22.6 
has duplicate 0032645 closedatrol Error on installation MantisBT 2.25.7 
has duplicate 0033072 closeddregad Installation Error! 
child of 0032027 closeddregad PHP 8.2 support 

Activities

Rosek93

Rosek93

2023-01-24 14:54

reporter   ~0067315

Start working on stack:
PHP 7.2
MySQL 5.6

dregad

dregad

2023-01-25 05:24

developer   ~0067317

For the record, MantisBT does not officially support PHP 8.1 or later yet. This is due to the cross-dependency between ADOdb library and our minimum supported PHP version.

MySQL 8 should be no problem though, I've been using it for many months.

We're aware that an update of our minimum requirements is long overdue, but unfortunately the team has not had time to finalize the required work. Please bear with us.

If you can reproduce the problem on PHP 8.0 / MySQL 8.0 or earlier, please let us know.

dregad

dregad

2023-02-12 04:38

developer   ~0067382

Rosek93,

You did not provide any feedback; I am therefore resolving this issue as "no change required". Please use a version of PHP supported by MantisBT.

marc.kraemer

marc.kraemer

2023-02-17 10:10

reporter   ~0067397

I can confirm this issue.

Please note that the problem comes from SQL, not PHP in general:
the query has "schema()schema()" in the query which is obviously an error

marc.kraemer

marc.kraemer

2023-02-17 10:26

reporter   ~0067400

this is "just" due to:
https://www.php.net/manual/en/mysqli-driver.report-mode.php

I assume this was an error which was caught through return value false of mysqli_query, which now raises an exception

marc.kraemer

marc.kraemer

2023-02-17 10:29

reporter   ~0067401

Last edited: 2023-02-17 10:33

This patch at least makes mantis run on php 8.2:

diff -Naur vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php /tmp/mantisbt-2.25.4/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php
--- vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php 2023-02-17 16:27:08.883074330 +0100
+++ /tmp/mantisbt-2.25.4/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php    2022-01-22 23:38:02.000000000 +0100
@@ -797,7 +797,7 @@

        return $mysql_res;
        */
-       mysqli_report(MYSQLI_REPORT_OFF);
+
        if ($this->multiQuery) {
            $rs = mysqli_multi_query($this->_connectionID, $sql.';');
            if ($rs) {
marc.kraemer

marc.kraemer

2023-02-17 10:30

reporter   ~0067402

patch.txt (399 bytes)   
--- vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php	2023-02-17 16:27:08.883074330 +0100
+++ /tmp/mantisbt-2.25.4/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php	2022-01-22 23:38:02.000000000 +0100
@@ -797,7 +797,7 @@
 
 		return $mysql_res;
 		*/
-		mysqli_report(MYSQLI_REPORT_OFF);
+
 		if ($this->multiQuery) {
 			$rs = mysqli_multi_query($this->_connectionID, $sql.';');
 			if ($rs) {
patch.txt (399 bytes)   
dregad

dregad

2023-02-17 10:35

developer   ~0067404

@marc.kraemer Thanks for the patch.
As mentioned in 0031928:0067317 this is a bug in upstream ADOdb library, it will be fixed as part of 0032028.

marc.kraemer

marc.kraemer

2023-02-17 10:52

reporter   ~0067406

sure. But everyone who does the upgrade to php 8.2 will just see error 500.
if you patch the library before hand by adding this simple line, it just works.