Execute code ONLY if we have the ability to do full text search on database (mysql >= 5.6.4)
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 |
+----------+