Issue Bug Closed

#14125"HASH" is a reserved SQL keyword

old_davide 04/29/04, 14:14 updated 08/12/06, 14:27

Description

I cannot create tables who contain a field called “HASH” because in MySQL 4.1.0-alpha it is a SQL reserved keyword.

From file tables.sql

CREATE TABLE cache_hash (
hash varchar(32) DEFAULT ‘’ NOT NULL,
content mediumblob NOT NULL,
tstamp int(11) unsigned DEFAULT ‘0’ NOT NULL,
ident varchar(20) DEFAULT ‘’ NOT NULL,
PRIMARY KEY (hash)
);

try:
mysql test < error-test.sql
ERROR 1064 at line 1: You have an error in your SQL syntax. Check the manual that correspondes to your MySQL server version for the right syntax to use near ‘hash varchar(32) DEFAULT ‘’ NOT NULL,
content mediumblob NOT

(issue imported from #M34)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.