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

Detecting FULLTEXT support #3

Closed
ottok opened this issue Feb 11, 2020 · 3 comments
Closed

Detecting FULLTEXT support #3

ottok opened this issue Feb 11, 2020 · 3 comments

Comments

@ottok
Copy link

ottok commented Feb 11, 2020

You asked me how to detect if there is FULLTEXT support.

From https://mariadb.com/kb/en/full-text-index-overview/

Full-text indexes can be used only with MyISAM and Aria tables, from MariaDB 10.0.5 with InnoDB tables and from MariaDB 10.0.15 with Mroonga tables, and can be created only for CHAR, VARCHAR, or TEXT columns.

I am not aware of any query that can check if there is FULLTEXT support. I guess you could simply issue the ALTER TABLE query and see if it fails or not, or you could check maybe what InnoDB or MariaDB version is available and make assumptions on that.

@msaari
Copy link
Owner

msaari commented Feb 11, 2020

Yeah, checking if the index has been created is one way.

Another check I'm adding is for the database version: if it's less than 5.6, FULLTEXT is not available. Looks like that will actually cover MariaDB as well – I suppose MariaDB versions lower than 10.0.5 and higher than 5.5 are rare enough.

@msaari
Copy link
Owner

msaari commented Mar 9, 2020

Not-so-funny curiosity: MariaDB version 10 appears as 5.5.5 for $wpdb->db_version(). Not very helpful when we're checking for MySQL version 5.6 or above... Fortunately $wpdb->get_var("SELECT VERSION()") gives a better result, so that can be used to check for MariaDB versions.

@msaari
Copy link
Owner

msaari commented Mar 9, 2020

58db597

@msaari msaari closed this as completed Mar 9, 2020
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