From 277fd6979e648f526c9c7391faba6bc8cd37e7ff Mon Sep 17 00:00:00 2001 From: Ambroise Maupate Date: Fri, 25 Oct 2024 11:44:12 +0200 Subject: [PATCH 1/2] fix: Updated MySQL reserved words list --- .../Form/Constraint/NonSqlReservedWord.php | 897 +++++++++++++++++- 1 file changed, 849 insertions(+), 48 deletions(-) diff --git a/lib/RoadizCoreBundle/src/Form/Constraint/NonSqlReservedWord.php b/lib/RoadizCoreBundle/src/Form/Constraint/NonSqlReservedWord.php index 07fd1af0..5190f76c 100644 --- a/lib/RoadizCoreBundle/src/Form/Constraint/NonSqlReservedWord.php +++ b/lib/RoadizCoreBundle/src/Form/Constraint/NonSqlReservedWord.php @@ -14,58 +14,859 @@ class NonSqlReservedWord extends Constraint { /** - * List of forbidden field names. - * - * These are SQL reserved words. + * List of forbidden field names. These are SQL reserved words. * + * @see https://dev.mysql.com/doc/refman/8.0/en/keywords.html * @var array */ public static array $forbiddenNames = [ - 'title', 'id', 'translation', 'node', 'urlAliases', 'url_aliases', 'documentsByFields', - 'publishedAt', 'published_at', 'published at', 'documents_by_fields', - 'metaTitle', 'metaKeywords', 'metaDescription', 'order', 'integer', 'int', 'float', 'join', - 'inner', 'select', 'from', 'where', 'by', 'varchar', - 'text', 'enum', 'left', 'outer', 'blob', 'accessible', - 'add', 'all', 'alter', 'analyze', 'and', 'as', 'asc', - 'asensitive', 'before', 'between', 'bigint', 'binary', - 'blob', 'both', 'by', 'call', 'cascade', 'case', 'change', - 'char', 'character', 'check', 'collate', 'column', 'condition', - 'constraint', 'continue', 'convert', 'create', 'cross', - 'current_date', 'current_time', 'current_timestamp', - 'current_user', 'cursor', 'database', 'databases', - 'day_hour', 'day_microsecond', 'day_minute', 'day_second', - 'dec', 'decimal', 'declare', 'default', 'delayed', 'delete', - 'desc', 'describe', 'deterministic', 'distinct', 'distinctrow', - 'div', 'double', 'drop', 'dual', 'each', 'else', 'elseif', - 'enclosed', 'escaped', 'exists', 'exit', 'explain', 'false', - 'fetch', 'float', 'float4', 'float8', 'for', 'force', 'foreign', - 'from', 'fulltext', 'get', 'grant', 'group', 'having', - 'high_priority', 'hour_microsecond', 'hour_minute', - 'hour_second', 'if', 'ignore', 'in', 'index', 'infile', 'inner', - 'inout', 'insensitive', 'insert', 'int', 'int1', 'int2', 'int3', - 'int4', 'int8', 'integer', 'interval', 'into', 'io_after_gtids', - 'io_before_gtids', 'is', 'iterate', 'join', 'key', 'keys', 'kill', - 'leading', 'leave', 'left', 'like', 'limit', 'linear', 'lines', - 'load', 'localtime', 'localtimestamp', 'lock', 'long', 'longblob', - 'longtext', 'loop', 'low_priority', 'master_bind', 'master_ssl_verify_server_cert', - 'match', 'maxvalue', 'mediumblob', 'mediumint', 'mediumtext', - 'middleint', 'minute_microsecond', 'minute_second', 'mod', 'modifies', - 'natural', 'not', 'no_write_to_binlog', 'null', 'numeric', 'on', - 'optimize', 'option', 'optionally', 'or', 'order', 'out', 'outer', - 'outfile', 'partition', 'precision', 'primary', 'procedure', 'purge', - 'range', 'read', 'reads', 'read_write', 'real', 'references', 'regexp', - 'release', 'rename', 'repeat', 'replace', 'require', 'resignal', - 'restrict', 'return', 'revoke', 'right', 'rlike', 'schema', 'schemas', - 'second_microsecond', 'select', 'sensitive', 'separator', 'set', - 'show', 'signal', 'smallint', 'spatial', 'specific', 'sql', - 'sqlexception', 'sqlstate', 'sqlwarning', 'sql_big_result', - 'sql_calc_found_rows', 'sql_small_result', 'ssl', 'starting', - 'straight_join', 'table', 'terminated', 'then', 'tinyblob', - 'tinyint', 'tinytext', 'to', 'trailing', 'trigger', 'true', - 'undo', 'union', 'unique', 'unlock', 'unsigned', 'update', 'usage', - 'use', 'using', 'utc_date', 'utc_time', 'utc_timestamp', 'values', - 'varbinary', 'varchar', 'varcharacter', 'varying', 'when', 'where', - 'while', 'with', 'write', 'xor', 'year_month', 'zerofill', + 'accessible', + 'account', + 'action', + 'active', + 'add', + 'admin', + 'admin', + 'after', + 'against', + 'aggregate', + 'algorithm', + 'all', + 'alter', + 'always', + 'analyze', + 'and', + 'any', + 'array', + 'array', + 'as', + 'asc', + 'ascii', + 'asensitive', + 'at', + 'attribute', + 'authentication', + 'auto_increment', + 'autoextend_size', + 'avg', + 'avg_row_length', + 'backup', + 'before', + 'begin', + 'between', + 'bigint', + 'binary', + 'binlog', + 'bit', + 'blob', + 'block', + 'bool', + 'boolean', + 'both', + 'btree', + 'buckets', + 'bulk', + 'bulk', + 'by', + 'byte', + 'cache', + 'call', + 'cascade', + 'cascaded', + 'case', + 'catalog_name', + 'chain', + 'challenge_response', + 'challenge_response', + 'change', + 'changed', + 'channel', + 'char', + 'character', + 'charset', + 'check', + 'checksum', + 'cipher', + 'class_origin', + 'client', + 'clone', + 'clone', + 'close', + 'coalesce', + 'code', + 'collate', + 'collation', + 'column', + 'column_format', + 'column_name', + 'columns', + 'comment', + 'commit', + 'committed', + 'compact', + 'completion', + 'component', + 'component', + 'compressed', + 'compression', + 'concurrent', + 'condition', + 'connection', + 'consistent', + 'constraint', + 'constraint_catalog', + 'constraint_name', + 'constraint_schema', + 'contains', + 'context', + 'continue', + 'convert', + 'cpu', + 'create', + 'cross', + 'cube', + 'cume_dist', + 'current', + 'current_date', + 'current_time', + 'current_timestamp', + 'current_user', + 'cursor', + 'cursor_name', + 'data', + 'database', + 'databases', + 'datafile', + 'date', + 'datetime', + 'day', + 'day_hour', + 'day_microsecond', + 'day_minute', + 'day_second', + 'deallocate', + 'dec', + 'decimal', + 'declare', + 'default', + 'default_auth', + 'definer', + 'definition', + 'delay_key_write', + 'delayed', + 'delete', + 'dense_rank', + 'dense_rank', + 'des_key_file', + 'desc', + 'describe', + 'description', + 'deterministic', + 'diagnostics', + 'directory', + 'disable', + 'discard', + 'disk', + 'distinct', + 'distinctrow', + 'div', + 'do', + 'double', + 'drop', + 'dual', + 'dumpfile', + 'duplicate', + 'dynamic', + 'each', + 'else', + 'elseif', + 'empty', + 'enable', + 'enclosed', + 'encryption', + 'end', + 'ends', + 'enforced', + 'engine', + 'engine_attribute', + 'engines', + 'enum', + 'error', + 'errors', + 'escape', + 'escaped', + 'event', + 'events', + 'every', + 'except', + 'except', + 'exchange', + 'exclude', + 'execute', + 'exists', + 'exit', + 'expansion', + 'expire', + 'explain', + 'export', + 'extended', + 'extent_size', + 'factor', + 'factor', + 'failed_login_attempts', + 'false', + 'fast', + 'faults', + 'fetch', + 'fields', + 'file', + 'file_block_size', + 'filter', + 'finish', + 'first', + 'first_value', + 'fixed', + 'float', + 'float4', + 'float8', + 'flush', + 'following', + 'follows', + 'for', + 'force', + 'foreign', + 'format', + 'found', + 'from', + 'full', + 'fulltext', + 'function', + 'general', + 'generate', + 'generated', + 'geomcollection', + 'geometry', + 'geometrycollection', + 'get', + 'get_format', + 'get_master_public_key', + 'get_source_public_key', + 'global', + 'grant', + 'grants', + 'group', + 'group_replication', + 'grouping', + 'groups', + 'gtid_only', + 'handler', + 'hash', + 'having', + 'help', + 'high_priority', + 'histogram', + 'history', + 'host', + 'hosts', + 'hour', + 'hour_microsecond', + 'hour_minute', + 'hour_second', + 'identified', + 'if', + 'ignore', + 'ignore_server_ids', + 'import', + 'in', + 'inactive', + 'inactive', + 'index', + 'indexes', + 'infile', + 'initial', + 'initial_size', + 'initiate', + 'inner', + 'inout', + 'insensitive', + 'insert', + 'insert_method', + 'install', + 'instance', + 'int', + 'int1', + 'int2', + 'int3', + 'int4', + 'int8', + 'integer', + 'intersect', + 'interval', + 'into', + 'invisible', + 'invoker', + 'io', + 'io_after_gtids', + 'io_before_gtids', + 'io_thread', + 'ipc', + 'is', + 'isolation', + 'issuer', + 'iterate', + 'join', + 'json', + 'json_table', + 'json_value', + 'key', + 'key_block_size', + 'keyring', + 'keys', + 'kill', + 'lag', + 'lag', + 'language', + 'last', + 'last_value', + 'lateral', + 'lateral', + 'lead', + 'leading', + 'leave', + 'leaves', + 'left', + 'less', + 'level', + 'like', + 'limit', + 'linear', + 'lines', + 'linestring', + 'list', + 'load', + 'local', + 'localtime', + 'localtimestamp', + 'lock', + 'locked', + 'locked', + 'locks', + 'logfile', + 'logs', + 'long', + 'longblob', + 'longtext', + 'loop', + 'low_priority', + 'master', + 'master_auto_position', + 'master_bind', + 'master_compression_algorithms', + 'master_compression_algorithms', + 'master_connect_retry', + 'master_delay', + 'master_heartbeat_period', + 'master_host', + 'master_log_file', + 'master_log_pos', + 'master_password', + 'master_port', + 'master_public_key_path', + 'master_public_key_path', + 'master_retry_count', + 'master_server_id', + 'master_ssl', + 'master_ssl_ca', + 'master_ssl_capath', + 'master_ssl_cert', + 'master_ssl_cipher', + 'master_ssl_crl', + 'master_ssl_crlpath', + 'master_ssl_key', + 'master_ssl_verify_server_cert', + 'master_tls_ciphersuites', + 'master_tls_ciphersuites', + 'master_tls_version', + 'master_user', + 'master_zstd_compression_level', + 'master_zstd_compression_level', + 'match', + 'max_connections_per_hour', + 'max_queries_per_hour', + 'max_rows', + 'max_size', + 'max_updates_per_hour', + 'max_user_connections', + 'maxvalue', + 'medium', + 'mediumblob', + 'mediumint', + 'mediumtext', + 'member', + 'member', + 'memory', + 'merge', + 'message_text', + 'microsecond', + 'middleint', + 'migrate', + 'min_rows', + 'minute', + 'minute_microsecond', + 'minute_second', + 'mod', + 'mode', + 'modifies', + 'modify', + 'month', + 'multilinestring', + 'multipoint', + 'multipolygon', + 'mutex', + 'mysql_errno', + 'name', + 'names', + 'national', + 'natural', + 'nchar', + 'ndb', + 'ndbcluster', + 'nested', + 'nested', + 'network_namespace', + 'network_namespace', + 'never', + 'new', + 'next', + 'no', + 'no_wait', + 'no_write_to_binlog', + 'nodegroup', + 'none', + 'not', + 'nowait', + 'nowait', + 'nth_value', + 'nth_value', + 'ntile', + 'ntile', + 'null', + 'nulls', + 'nulls', + 'number', + 'numeric', + 'nvarchar', + 'of', + 'of', + 'off', + 'off', + 'offset', + 'oj', + 'oj', + 'old', + 'old', + 'on', + 'one', + 'only', + 'open', + 'optimize', + 'optimizer_costs', + 'option', + 'optional', + 'optional', + 'optionally', + 'options', + 'or', + 'order', + 'ordinality', + 'ordinality', + 'organization', + 'organization', + 'others', + 'others', + 'out', + 'outer', + 'outfile', + 'over', + 'over', + 'owner', + 'pack_keys', + 'page', + 'parser', + 'partial', + 'partition', + 'partitioning', + 'partitions', + 'password', + 'password_lock_time', + 'password_lock_time', + 'path', + 'path', + 'percent_rank', + 'percent_rank', + 'persist', + 'persist', + 'persist_only', + 'persist_only', + 'phase', + 'plugin', + 'plugin_dir', + 'plugins', + 'point', + 'polygon', + 'port', + 'precedes', + 'preceding', + 'preceding', + 'precision', + 'prepare', + 'preserve', + 'prev', + 'primary', + 'privilege_checks_user', + 'privilege_checks_user', + 'privileges', + 'procedure', + 'process', + 'process', + 'processlist', + 'profile', + 'profiles', + 'proxy', + 'purge', + 'quarter', + 'query', + 'quick', + 'random', + 'random', + 'range', + 'rank', + 'rank', + 'read', + 'read_only', + 'read_write', + 'reads', + 'real', + 'rebuild', + 'recover', + 'recursive', + 'recursive', + 'redo_buffer_size', + 'redofile', + 'redundant', + 'reference', + 'reference', + 'references', + 'regexp', + 'registration', + 'registration', + 'relay', + 'relay_log_file', + 'relay_log_pos', + 'relay_thread', + 'relaylog', + 'release', + 'reload', + 'remote', + 'remove', + 'rename', + 'reorganize', + 'repair', + 'repeat', + 'repeatable', + 'replace', + 'replica', + 'replica', + 'replicas', + 'replicas', + 'replicate_do_db', + 'replicate_do_table', + 'replicate_ignore_db', + 'replicate_ignore_table', + 'replicate_rewrite_db', + 'replicate_wild_do_table', + 'replicate_wild_ignore_table', + 'replication', + 'require', + 'require_row_format', + 'require_row_format', + 'reset', + 'resignal', + 'resource', + 'resource', + 'respect', + 'respect', + 'restart', + 'restart', + 'restore', + 'restrict', + 'resume', + 'retain', + 'retain', + 'return', + 'returned_sqlstate', + 'returning', + 'returning', + 'returns', + 'reuse', + 'reuse', + 'reverse', + 'revoke', + 'right', + 'rlike', + 'role', + 'role', + 'rollback', + 'rollup', + 'rotate', + 'routine', + 'row', + 'row_count', + 'row_format', + 'row_number', + 'row_number', + 'rows', + 'rtree', + 'savepoint', + 'schedule', + 'schema', + 'schema_name', + 'schemas', + 'second', + 'second_microsecond', + 'secondary', + 'secondary', + 'secondary_engine', + 'secondary_engine', + 'secondary_engine_attribute', + 'secondary_engine_attribute', + 'secondary_load', + 'secondary_load', + 'secondary_unload', + 'secondary_unload', + 'security', + 'select', + 'sensitive', + 'separator', + 'serial', + 'serializable', + 'server', + 'session', + 'set', + 'share', + 'show', + 'shutdown', + 'signal', + 'signed', + 'simple', + 'skip', + 'skip', + 'slave', + 'slow', + 'smallint', + 'snapshot', + 'socket', + 'some', + 'soname', + 'sounds', + 'source', + 'source_auto_position', + 'source_auto_position', + 'source_bind', + 'source_bind', + 'source_compression_algorithms', + 'source_compression_algorithms', + 'source_connect_retry', + 'source_connect_retry', + 'source_delay', + 'source_delay', + 'source_heartbeat_period', + 'source_heartbeat_period', + 'source_host', + 'source_host', + 'source_log_file', + 'source_log_file', + 'source_log_pos', + 'source_log_pos', + 'source_password', + 'source_password', + 'source_port', + 'source_port', + 'source_public_key_path', + 'source_public_key_path', + 'source_retry_count', + 'source_retry_count', + 'source_ssl', + 'source_ssl', + 'source_ssl_ca', + 'source_ssl_ca', + 'source_ssl_capath', + 'source_ssl_capath', + 'source_ssl_cert', + 'source_ssl_cert', + 'source_ssl_cipher', + 'source_ssl_cipher', + 'source_ssl_crl', + 'source_ssl_crl', + 'source_ssl_crlpath', + 'source_ssl_crlpath', + 'source_ssl_key', + 'source_ssl_key', + 'source_ssl_verify_server_cert', + 'source_ssl_verify_server_cert', + 'source_tls_ciphersuites', + 'source_tls_ciphersuites', + 'source_tls_version', + 'source_tls_version', + 'source_user', + 'source_user', + 'source_zstd_compression_level', + 'source_zstd_compression_level', + 'spatial', + 'specific', + 'sql', + 'sql_after_gtids', + 'sql_after_mts_gaps', + 'sql_before_gtids', + 'sql_big_result', + 'sql_buffer_result', + 'sql_cache', + 'sql_calc_found_rows', + 'sql_no_cache', + 'sql_small_result', + 'sql_thread', + 'sql_tsi_day', + 'sql_tsi_hour', + 'sql_tsi_minute', + 'sql_tsi_month', + 'sql_tsi_quarter', + 'sql_tsi_second', + 'sql_tsi_week', + 'sql_tsi_year', + 'sqlexception', + 'sqlstate', + 'sqlwarning', + 'srid', + 'ssl', + 'stacked', + 'start', + 'starting', + 'starts', + 'stats_auto_recalc', + 'stats_persistent', + 'stats_sample_pages', + 'status', + 'stop', + 'storage', + 'stored', + 'straight_join', + 'stream', + 'stream', + 'string', + 'subclass_origin', + 'subject', + 'subpartition', + 'subpartitions', + 'super', + 'suspend', + 'swaps', + 'switches', + 'system', + 'system', + 'table', + 'table_checksum', + 'table_name', + 'tables', + 'tablespace', + 'temporary', + 'temptable', + 'terminated', + 'text', + 'than', + 'then', + 'thread_priority', + 'thread_priority', + 'ties', + 'ties', + 'time', + 'timestamp', + 'timestampadd', + 'timestampdiff', + 'tinyblob', + 'tinyint', + 'tinytext', + 'tls', + 'to', + 'trailing', + 'transaction', + 'trigger', + 'triggers', + 'true', + 'truncate', + 'type', + 'types', + 'unbounded', + 'uncommitted', + 'undefined', + 'undo', + 'undo_buffer_size', + 'undofile', + 'unicode', + 'uninstall', + 'union', + 'unique', + 'unknown', + 'unlock', + 'unregister', + 'unsigned', + 'until', + 'update', + 'upgrade', + 'url', + 'url', + 'usage', + 'use', + 'use_frm', + 'user', + 'user_resources', + 'using', + 'utc_date', + 'utc_time', + 'utc_timestamp', + 'validation', + 'value', + 'values', + 'varbinary', + 'varchar', + 'varcharacter', + 'variables', + 'varying', + 'vcpu', + 'view', + 'virtual', + 'visible', + 'wait', + 'warnings', + 'week', + 'weight_string', + 'when', + 'where', + 'while', + 'window', + 'with', + 'without', + 'work', + 'wrapper', + 'write', + 'x509', + 'xa', + 'xid', + 'xml', + 'xor', + 'year', + 'year_month', + 'zerofill', + 'zone', ]; public string $message = 'string.should.not.be.a.sql.reserved.word'; From e40d49375d5d4b9a16c72946b4e53eb53fcbdf44 Mon Sep 17 00:00:00 2001 From: Ambroise Maupate Date: Fri, 25 Oct 2024 11:45:16 +0200 Subject: [PATCH 2/2] chore: Bumped --- CHANGELOG.md | 6 ++++++ lib/RoadizCoreBundle/config/services.yaml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9672fbde..c7404d05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to Roadiz will be documented in this file. +## [2.3.30](https://github.com/roadiz/core-bundle-dev-app/compare/v2.3.29...v2.3.30) - 2024-10-25 + +### Bug Fixes + +- Updated MySQL reserved words list - ([277fd69](https://github.com/roadiz/core-bundle-dev-app/commit/277fd6979e648f526c9c7391faba6bc8cd37e7ff)) + ## [2.3.29](https://github.com/roadiz/core-bundle-dev-app/compare/v2.3.28...v2.3.29) - 2024-10-10 ### Bug Fixes diff --git a/lib/RoadizCoreBundle/config/services.yaml b/lib/RoadizCoreBundle/config/services.yaml index ee7c4147..09fb99bf 100644 --- a/lib/RoadizCoreBundle/config/services.yaml +++ b/lib/RoadizCoreBundle/config/services.yaml @@ -1,6 +1,6 @@ --- parameters: - roadiz_core.cms_version: '2.3.29' + roadiz_core.cms_version: '2.3.30' roadiz_core.cms_version_prefix: 'main' env(APP_NAMESPACE): "roadiz" env(APP_VERSION): "0.1.0"