DDL just for Percona

Hi,
is it possible to Comment a Part of a DDL to just get used on percona server?

I want to use the Percona exclusive compressed column in a Projekt which needs to be compatible to mysql / mariadb too.

When i try it like this

create table `test`
(
    `id`            bigint unsigned                                                               not null auto_increment 
    `file`          LONGBLOB /*!50633 COLUMN_FORMAT COMPRESSED */ null,
    `created_at`    timestamp                                                                     null,
    `updated_at`    timestamp                                                                     null
) default character set utf8mb4
  collate 'utf8mb4_unicode_ci'

the create table works on percona, but a mysql or a mariadb server creates a

Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED */ null,

Hello @Phillip85,
Unfortunately no. SQL comments, and more specifically, versioned comments, are not filterable by db flavor (ie: percona, community, maria).

This is confusing. If you want to use a Percona feature, why are you messing with community/maria? That doesn’t make sense to me. Pick 1 database flavor, and use it. Mariadb is not considered mysql anymore; treat it as a different database.

Hello @matthewb ,
the project is used by different users with different db flavors.
Till now, the requirement was just mysql or a drop in replacement.
So I have to think about changing the requirements.

Thanks for the answer
Phillip

Percona MySQL is a drop-in replacement for Community MySQL, offering enhanced performance, and better features (as you experienced). We maintain 100% compatibility with upstream. MariaDB is not mysql.

My analogy:
MySQL Community: Scoop of vanilla ice cream
Percona MySQL: same scoop, but add whip cream, hot fudge sauce, sprinkles (same base, just better)
MariaDB: Yogurt