Page MenuHomePhabricator

Sonarqube recommands "varchar2" data type, well it doesn't exist
Closed, ResolvedPublic

Description

I get this comment by sonarqube in all of my abstract schema patches (https://gerrit.wikimedia.org/r/c/mediawiki/core/+/617828/1/maintenance/postgres/tables-generated.sql)

image.png (368×618 px, 119 KB)

Well, the problem is that this datatype only exists in Oracle and doesn't exist in mysql, sqlite, or postgres, making this completely useless.

MariaDB [repo]> CREATE TABLE /*_*/log_searchwow (
    ->   ls_field VARBINARY(32) NOT NULL,
    ->   ls_value VARCHAR2(255) NOT NULL,
    ->   ls_log_id INT UNSIGNED DEFAULT 0 NOT NULL,
    ->   INDEX ls_log_id (ls_log_id),
    ->   PRIMARY KEY(ls_field, ls_value, ls_log_id)
    -> ) /*$wgDBTableOptions*/;
ERROR 1064 (42000): 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 'VARCHAR2(255) NOT NULL,
  ls_log_id INT UNSIGNED DEFAULT 0 NOT NULL,
  INDEX ls_' at line 3

Related Objects