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

[MySQL] ERROR 1064 - while running snomed_load_mysql in mysql-loader-with-optimized-views #52

Open
axelv opened this issue May 25, 2022 · 7 comments

Comments

@axelv
Copy link

axelv commented May 25, 2022

Hi,

First of all thanks for the scripts in this repo!

I have some problems running the scripts for the MySQL with optimized views.
After successfully running sudo ./bash/snomed_config_mysql the load command fails:
Running

sudo ./bash/snomed_load_mysql

Gives me the following error

mysql --defaults-extra-file="/Users/axelvanraes/dev/snomed-database-loader/mysql-loader-with-optimized-views/cnf/my_snomedimport_client.cnf"  --protocol=tcp --host=localhost --port=3306 --default-character-set=utf8mb4 --user root --password  < "/Users/axelvanraes/dev/snomed-database-loader/mysql-loader-with-optimized-views/mysql_load/sct_mysql_temp.sql"
Enter password:
CHECKING MySQL CONFIGURATION SETTINGS
CHECKING MySQL CONFIGURATION SETTINGS
ERROR 1064 (42000) at line 166: 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 '= (@`req_len`)),'MySQL Fulltext minimum word length OK',concat('WARNING! Fulltex' at line 1

I'm running mysql 8.0.29 on a Mac M1 with Big Sur 11.3.

@axelv
Copy link
Author

axelv commented May 25, 2022

After some research I was able to pin down the statement that triggers the error.

I think there is a problem with this statement:
https://github.com/IHTSDO/snomed-database-loader/blob/master/mysql-loader-with-optimized-views/mysql_load/sct_mysql_load_create_InternationalRF2.sql#L138

Running that line with the enclausing SELECT * FROM throws the exact same error:

mysql> SELECT * FROM (SELECT IF(@@GLOBAL.ft_min_word_len=@req_len,'MySQL Fulltext minimum word length OK',CONCAT('WARNING! Fulltext minimum word length (ft_min_word_len) must be ',@req_len,' but has value: ', @@GLOBAL.ft_min_word_len)) 'Message') data WHERE Message="";
ERROR 1064 (42000): 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 '= (@`req_len`)),'MySQL Fulltext minimum word length OK',concat('WARNING! Fulltex' at line 1

I was able to reduce this statement further down to the following line:

mysql> SELECT * FROM (SELECT IF(@@GLOBAL.ft_min_word_len=@req_len,'MySQL Fulltext minimum word length OK',CONCAT('WARNING! Fulltext minimum word length (ft_min_word_len) must be ',@req_len,' but has value: ', @@GLOBAL.ft_min_word_len)) 'Message') data WHERE Message="";
ERROR 1064 (42000): 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 '= 2),'IF clause is true','IF clause is false')' at line 1

I also checked that the global variable does exist.

mysql> SELECT @@GLOBAL.ft_min_word_len;
+--------------------------+
| @@GLOBAL.ft_min_word_len |
+--------------------------+
|                        4 |
+--------------------------+
1 row in set (0,00 sec)

@axelv axelv changed the title [MySQL] ERROR 1064 - Syntax error while running snomed_load_mysql [MySQL] ERROR 1064 - while running snomed_load_mysql in mysql-loader-with-optimized-views May 25, 2022
@JonZammit
Copy link
Contributor

Hi @axelv did you follow the instructions here - https://confluence.ihtsdotools.org/display/DOCSQLPG/Appendix+A%3A+Building+the+SNOMED+CT+Example+Database ?

There is a bit about MySQL configuration.

@axelv
Copy link
Author

axelv commented May 25, 2022

They are similar to the instructions in the readme. The only configuration required is running ./bash/snomed_config_mysqland subsequently restarting MySQL which is what I have done.

Do you think I missed something?

@axelv
Copy link
Author

axelv commented May 27, 2022

I think it has to do with how I installed the MySQL service.

I've installed the mysql service with homebrew: brew install mysql
As a result, I had to update the paths in the bash scripts.

A temporary workaround for me was commenting on the configuration check on this line.

And then doing the check of global variables manually:

SELECT @@GLOBAL.ft_stopword_file  /* should be empty */
SELECT @@GLOBAL.ft_min_word_len /* should be 2 */
SELECT  @@GLOBAL.local_infile /* should be 1*/

sudo ./bash/snomed_load_mysql did run without errors !

@JonZammit
Copy link
Contributor

@axelv thank you for the update. We have successfully tested several versions of MySQL server on macos without homebrew. The configuration file (/usr/local/mysql/support-files/my_snomedserver.cnf) is required. We will see if we can replicate your setup.

@JonZammit
Copy link
Contributor

@axelv It looks like this issue was introduced recently with the release of MySQL 8.0.29. I was able to reproduce your error today with 8.0.29, but confirmed that 8.0.28 works properly. We will let you know if/when we can release an improved version of the scripts but at least we now have a couple of workarounds. Thanks again.

@axelv
Copy link
Author

axelv commented Jun 1, 2022

Thx for the update!

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