1

Since I upgraded to LEAP 15.1 I can not run "old" C applications executing mysql_query() function.

I got:

MySQL client version: 10.4.3
Tentative de connexion...       [ok]
(01064)Erreur lors de l'exécution d'une requête SQL:

With no message concerning the mysql_error() function.

None of the applications done previously are still working :{

I use libmariadb-devel 3.1.2-lp151.3.3.1 (it worked with 3.0.3) it started to stop working with 3.0.7.

Try to downgrade to 3.0.3 but this version in no longer "reachable" from the repository of LEAP 15.1.

if ( mysql_query( 

connexion, 
"SELECT Nom,CodePostal 
FROM CodesPostaux,Localités 
WHERE idCodePostal=Ref_CodesPostaux ORDER BY CodePostal")) 
{
      wprintf(L"(%05d) ...: %s !!\n",
      mysql_errno(connexion),
      mysql_error(connexion));
      exit(1);
}

I may have the result set displayed as usual before upgrading to 15.1 (to libmariadb-3.3.1).

This is the default charset for the server:

default-character-set = utf8

This statement (code) worked perfectly BEFORE the update. I tried to have more details concerning the 01064 error with mysql_sqlstate() function... it gives 42000...

MariaDB [CSSMPoste]> select Nom, CodePostal FROM CodesPostaux, Localités WHERE idCodePostal = Ref_CodesPostaux ORDER BY CodePostal ;
+-------------------+------------+
| Nom               | CodePostal |
+-------------------+------------+
| Liège             | 4000       |
| Rocourt           | 4000       |
| Cointe            | 4000       |
| Wandre            | 4020       |
| Vottem            | 4041       |
| Milmort           | 4041       |
| Boncelles         | 4100       |
| Seraing           | 4100       |
| Jemeppe-sur-Meuse | 4101       |
| Flémalle          | 4400       |
| Ans               | 4430       |
| Alleur            | 4432       |
| Grâce-Hollogne    | 4460       |
| Amel              | 4770       |
+-------------------+------------+
14 rows in set (0.01 sec)
  • 1
    MySQL Error 1064 seems to indicate a syntax error - although your SQL looks ok to me. Have you made sure both your MariaDB/MySQL server, and your database driver used in your program are configured to handle Unicode characters, such as your accented e's? Perhaps the new `libmariadb` lib defaults to not understanding those... – SnakeDoc Oct 28 '19 at 22:11
  • Also might be helpful: https://stackoverflow.com/questions/23515347/how-can-i-fix-mysql-error-1064 – SnakeDoc Oct 28 '19 at 22:11
  • Yes SnakeDoc: I changed the query to a simple "SELECT COUNT() FROM " and it worked... I will try to dig further in order to find an explanation about the fact the previous query no longer worl... – Hurukan Imperial Stepper Nov 03 '19 at 23:35
  • Once again when using "utf8" from "Localités" the error is raised... how could I fix this as those requests worked before... do I modify the environnement to match with the locale set in `code setlocale(LC_ALL,"fr_BE.UTF8");` – Hurukan Imperial Stepper Nov 03 '19 at 23:39
  • This is what I got when I renamed "Localités" to "Localites" in mariadb. That sucks because it was working before :{ But now I'm on a clue around utf8 that is not handled correctly by the C connector. `https://paste.opensuse.org/76766664` – Hurukan Imperial Stepper Nov 04 '19 at 00:40
  • In the logs I got this warning: `Aborted connection 11 to db: 'CSSMPoste' user: 'testeur' host: 'localhost' (Got an error reading communication packets)` – Hurukan Imperial Stepper Nov 04 '19 at 01:38
  • Unfortunately I don't have much experience handling localities in MySQL/MariaDB. Although it looks good that you're onto the right path now. Perhaps open a new question specifically about handling localities in UTF8 in MariaDB using whatever version and libraries you're using. That might get you more specific help from someone here that's experienced with that problem. :) Link to this question so they can get the background, and then make suggestions for fixing it. – SnakeDoc Nov 04 '19 at 17:31
  • 1
    Please provide `SHOW VARIABLES LIKE 'char%';` – Rick James Nov 04 '19 at 18:57
  • `| character_set_client | utf8 |` `| character_set_connection | utf8 |` `| character_set_database | utf8 |` `| character_set_filesystem | binary |` `| character_set_results | utf8 |` `| character_set_server | utf8 |` `| character_set_system | utf8 |` `| character_sets_dir | /usr/share/mariadb/charsets/ |` – Hurukan Imperial Stepper Nov 14 '19 at 17:07

0 Answers0