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

SQL error in report #1084

Open
tim-pearce opened this issue Sep 30, 2024 · 5 comments
Open

SQL error in report #1084

tim-pearce opened this issue Sep 30, 2024 · 5 comments

Comments

@tim-pearce
Copy link
Contributor

I am testing an upgrade from 2.34.0 to 2.35.1
I have a report which includes 'Names of their adult family members'.
I get error 'Fatal Error (Exception)
SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xCC\x83' for column jethro2351._family_adults23.names at row 1146
Line 1294 of File /usr/local/www/apache24/data/JethroRCOC/db_objects/person_query.class.php
When I look at the code, there is no mention of a datetime field!
I am therefor perplexed.

The error does not occur if is select 'Names of all their family members'.

My PHP version on this PC is 8.2.23
SQL Server version: 10.6.19-MariaDB

@tim-pearce
Copy link
Contributor Author

I did a test with PHPMyAdmin
Recreated the person view to remove all the security (this is just a test database)
Created a table like the one in the code.
Ran the query like in the code.
Got the same error - so it seems it's not my version of PHP
Ran just the SELECT part and there is no problem.

@tim-pearce
Copy link
Contributor Author

In PHPMyAdmin the message is
#1366 - Incorrect string value: '\xCC\x83' for column jethro2351._family_adults555.names at row 1146
There are less than 1146 rows returned by the query!

@tim-pearce
Copy link
Contributor Author

I ran this on my database
ALTER DATABASE jethro2351 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
Now when I create a new table it gets the right encoding.

@tim-pearce
Copy link
Contributor Author

I have also run
ALTER TABLE xxxxx CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
on all tables that did not have utf8mb4_unicode_ci

@jefft
Copy link
Contributor

jefft commented Sep 30, 2024

That does look like a character encoding problem, e.g. the same error is in the description of #754. Did changing the database encoding help at all?

There is some diagnotic SQL which shows the encodings tables at:

#754 (comment)

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

No branches or pull requests

2 participants