Execute code ONLY if we have the ability to do full text search on database (mysql >= 5.6.4) I found this answer for how to have conditional logic for execution of mysql statements (https://stackoverflow.com/a/7537348/627473). Seems to work great. 

But I need to find a way to execute code for a very specific condition. The code can only execute if the database supports FULL TEXT indexing for innodb. This happens in mysql 5.6.4 or greater. BUT I also need this to work for maria db other forks of mysql.

I am sure I could find a way for mysql version; but I don't really like relying on a version and would rather relying on feature detection.

Is there a way to do this?

EDIT: Here is code. I just have on more error that I am not sure can be fixed.

In phpMyAdmin the error "#2014 - Commands out of sync; you can't run this command now" is displayed. This does NOT happen from CLI. Is there a way around this?

delimiter //

create procedure update_phppos() 

begin
set @supports_ft := (SELECT COUNT(*) FROM information_schema.GLOBAL_VARIABLES WHERE Variable_name = 'innodb_ft_cache_size');

if  @supports_ft &gt; 0 then 

    REPLACE INTO `phppos_app_config` (`key`, `value`) VALUES ('version', '15.0');

    else
        SELECT 'An error has occured. You MUST have mysql 5.6.4 or higher to update php point of sale' as 'ERROR';
    end if;
end;

//

delimiter ;

-- Execute the procedure
call update_phppos();

-- Drop the procedure
drop procedure update_phppos;
Plan A:
Notice how you can comment out things if the version is older than something:  (I am running 5.6.12.)

mysql&gt; SELECT /*!50604 '5.6.4 is running', */ 'new or old';
+------------------+------------+
| 5.6.4 is running | new or old |
+------------------+------------+
| 5.6.4 is running | new or old |
+------------------+------------+

mysql&gt; SELECT /*!50700 '5.7 is running', */ 'new or old';
+------------+
| new or old |
+------------+
| new or old |
+------------+


You can see lots of examples in the output of mysqldump.

Plan B:
You could also parse @@version inside a Stored Procedure (or client code).

Plan C:
Or, maybe this 

mysql&gt; SELECT COUNT(*) FROM information_schema.GLOBAL_VARIABLES
        WHERE Variable_name = 'Junk';
+----------+
| COUNT(*) |
+----------+
|        0 |
+----------+

mysql&gt; SELECT COUNT(*) FROM information_schema.GLOBAL_VARIABLES
      WHERE Variable_name = 'innodb_ft_cache_size';
+----------+
| COUNT(*) |
+----------+
|        1 |
+----------+