I'm completly lost :{
I did a demonstration for my students yeeeeaaaars ago and this one always worked untill I upgraded to LEAP 15.1 :{
The demonstration is about a C application (language that we learn at school) that connects to a mariadb database.
This is the part of the main() function
- Code: Select all
setlocale(LC_ALL,"fr_BE.UTF8");
wprintf(L"MySQL client version: %s\n",mysql_get_client_info());
wprintf(L"Tentative de connexion...");
MYSQL *connexion = mysql_init(NULL);
if (connexion == NULL)
{
fprintf(stderr, "%s\n", mysql_error(connexion));
exit(1);
}
if (mysql_real_connect(connexion, "localhost", "testeur", "toor","CSSMPoste", 0, NULL, 0) == NULL)
{
wprintf(L"\t\x1b[31m[ko]\x1b[0m\nErreur à l'ouverture de connexion: %s !!\n",mysql_error(connexion));
exit(1);
}
wprintf(L"\t\x1b[32m[ok]\x1b[0m\n");
if (mysql_query(connexion, "SELECT Nom,CodePostal FROM CodesPostaux,Localités WHERE idCodePostal=Ref_CodesPostaux ORDER BY CodePostal"))
{
wprintf(L"(%05d)Erreur lors de l'exécution d'une requête SQL: %s !!\n",mysql_error(connexion),mysql_error(connexion));
exit(1);
}
The error happened when I try to execute a query with mysql_query() that always worked before, I got some documents showing it was working, I got just to retreive them.
Looking at the output it seems the string is broken as the '\n' is never printed to the terminal :{
What is wrong with mysql_query() that is still documented in the official documentation (refered to refman-5.7-en.a4.pdf) and https://dev.mysql.com/doc/refman/8.0/en/mysql-query.html
The description of the tables involved in the query is:
I do not use binary datas but there is an error that never happened before.