Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB_ERROR_SYNTAX with MariaDB 10.4 #10460

Closed
michel-thomas opened this issue Jan 30, 2019 · 3 comments · Fixed by #11844
Closed

DB_ERROR_SYNTAX with MariaDB 10.4 #10460

michel-thomas opened this issue Jan 30, 2019 · 3 comments · Fixed by #11844

Comments

@michel-thomas
Copy link

Bug

With Dolibarr 8.0.4, I have an SQL error on main page (/index.php?mainmenu=home&leftmenu=home)

Dolibarr a détecté une erreur technique.
Voici les informations qui pourront aider au diagnostic (Vous pouvez fixer l'option $dolibarr_main_prod sur '1' pour supprimer quelques notifications):
Date: 20190130115512
Dolibarr: 8.0.4
Niveau de fonctionnalités: 0
PHP: 7.1.25
Server: Apache/2.4.25 (Debian)
OS: Linux 9dccaabd669d 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64
UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0

Url sollicitée: /index.php?mainmenu=home&leftmenu=home
Referer: http://localhost/index.php?mainmenu=home&leftmenu=home
Gestionnaire de menu: eldy_menu.php

Type gestionnaire de base de données: mysqli
Requête dernier accès en base en erreur: SELECT a.id, a.datep as dp FROM (llx_actioncomm as a) LEFT JOIN llx_societe as s ON a.fk_soc = s.rowid WHERE 1 = 1 AND a.percent >= 0 AND a.percent < 100 AND a.entity IN (1)
Code retour dernier accès en base en erreur: DB_ERROR_SYNTAX
Information sur le dernier accès en base en erreur: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') LEFT JOIN llx_societe as s ON a.fk_soc = s.rowid WHERE 1 = 1 AND a.percent >= ' at line 1

Environment

  • Version: 8.0.4
  • OS: Debian Stretch
  • Web server: Apache
  • PHP: 7.0
  • Database: MariaDB 5.5.5-10.4.1
  • URL(s): /index.php?mainmenu=home&leftmenu=home

Expected and actual behavior

This print an error message, and it should not do that.

Steps to reproduce the behavior

Migrating from 7.0.1 to 8.0.4 (ok in same env), then moving installation to tuxgasy Docker image with MariaDB 10.4.1 instead of 10.1.37.
Tried with MariaDB 10.3.12 with success.

@michel-thomas michel-thomas changed the title DB_ERROR_SYNTAX: llx_actioncomm DB_ERROR_SYNTAX with MariaDB 10.4 Jan 30, 2019
@eldy eldy closed this as completed in 72f78ec Feb 3, 2019
@michel-thomas
Copy link
Author

Great! Thanks.

@dgfmdrv
Copy link

dgfmdrv commented Sep 6, 2019

Hello, I have this problem testing dolibarr. I installed on Centos for testing.

When I try to create a new project (/projet/card.php?leftmenu=projects&action=create):
image

Working on calendar also happens, for example on list-view, month-view, week-view, daily-view and user-view or when I create a new event (or other calendar-subsections):

/comm/action/list.php?&search_filtert=1&search_showbirthday=1&&maxprint=3&year=2019&month=09&day=6
/comm/action/index.php?action=show_month&&search_filtert=1&begin_h=9&end_h=18&begin_d=1&end_d=5&maxprint=3&year=2019&month=09&day=6
/comm/action/index.php?action=show_week&&search_filtert=1&search_showbirthday=1&&maxprint=3&year=2019&month=09&day=6
/comm/action/index.php?action=show_day&&search_filtert=1&search_showbirthday=1&&maxprint=3&year=2019&month=09&day=6
/comm/action/peruser.php?&search_filtert=1&search_showbirthday=1&&maxprint=3&year=2019&month=09&day=6
/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create&idmenu=7

image

Currently I'm on MariaDB (Centos 7):

$ mysqld -V
mysqld  Ver 10.4.4-MariaDB for Linux on x86_64 (MariaDB Server)

If I connect to bbdd and run sql sentence:

MariaDB [dolibarr]> SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.fournisseur, s.code_client, s.code_fournisseur FROM (dbe_societe as s ) WHERE s.entity IN (1) ORDER BY nom ASC;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') WHERE s.entity IN (1) ORDER BY nom ASC' at line 1
MariaDB [msas_interno_dolibarr]> SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.fournisseur, s.code_client, s.code_fournisseur FROM dbe_societe as s WHERE s.entity IN (1) ORDER BY nom ASC;
+-------+-------------------------------------------+------------+--------+-------------+--------------+------------------+
| rowid | name                                      | name_alias | client | fournisseur | code_client  | code_fournisseur |
+-------+-------------------------------------------+------------+--------+-------------+--------------+------------------+
|     1 | ----------- | ...... |      1 |           0 | CU1909-00001 | NULL             |
+-------+-------------------------------------------+------------+--------+-------------+--------------+------------------+
```

@dgfmdrv
Copy link

dgfmdrv commented Sep 6, 2019

I delete ( and ) on line 1155 from file/function:

	./html/core/class/html.form.class.php
		select_thirdparty_list

dgfmdrv pushed a commit to dgfmdrv/dolibarr that referenced this issue Sep 8, 2019
eldy added a commit that referenced this issue Sep 9, 2019
FIX #10460 compatibility with MariaDB 10.4
eldy pushed a commit that referenced this issue Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants