View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000356 | bareos-core | installer / packages | public | 2014-11-03 11:18 | 2015-03-25 19:18 |
Reporter | Assigned To | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x64 | OS | Linux | OS Version | Debian 7.6 |
Product Version | 13.2.3 | ||||
Summary | 0000356: BLOB/TEXT column 'EnvName' keylengt is missing mysql | ||||
Description | root@barteldan:/usr/lib/bareos/scripts# ./make_bareos_tables Making mysql tables ERROR 1170 (42000) at line 400: BLOB/TEXT column 'EnvName' used in key specification without a key length Creation of Bareos MySQL tables succeeded. root@barteldan:/usr/lib/bareos/scripts/ddl# grep -inrH "EnvName" * creates/mysql.sql:403: EnvName TINYBLOB NOT NULL, creates/mysql.sql:405: CONSTRAINT NDMPJobEnvironment_pkey PRIMARY KEY (JobId, FileIndex, EnvName) Here is the snippet from the create File CREATE TABLE NDMPJobEnvironment ( JobId INTEGER UNSIGNED NOT NULL REFERENCES Job, FileIndex INTEGER UNSIGNED NOT NULL, EnvName TINYBLOB NOT NULL, EnvValue TINYBLOB NOT NULL, CONSTRAINT NDMPJobEnvironment_pkey PRIMARY KEY (JobId, FileIndex, EnvName) ); | ||||
Steps To Reproduce | Make the bareos table for mysql on debian 7.6. | ||||
Additional Information | Maybe the type should also be changed. The error happens because MySQL can index only the first N chars of a BLOB or TEXT column. So The error mainly happen when there is a field/column type of TEXT or BLOB or those belongs to TEXT or BLOB types such as TINYBLOB, MEDIUMBLOB, LONGBLOB, TINYTEXT, MEDIUMTEXT, and LONGTEXT that you try to make as primary key or index. With full BLOB or TEXT without the length value, MySQL is unable to guarantee the uniqueness of the column as it’s of variable and dynamic size. So, when using BLOB or TEXT types as index, the value of N must be supplied so that MySQL can determine the key length. However, MySQL doesn’t support a key length limit on TEXT or BLOB. TEXT(88) simply won’t work. The error will also pop up when you try to convert a table column from non-TEXT and non-BLOB type such as VARCHAR and ENUM into TEXT or BLOB type, with the column already been defined as unique constraints or index. The Alter Table SQL command will fail. The solution to the problem is to remove the TEXT or BLOB column from the index or unique constraint, or set another field as primary key. If you can’t do that, and wanting to place a limit on the TEXT or BLOB column, try to use VARCHAR type and place a limit of length on it. By default, VARCHAR is limited to a maximum of 255 characters and its limit must be specified implicitly within a bracket right after its declaration, i.e VARCHAR(200) will limit it to 200 characters long only. Sometimes, even though you don’t use TEXT or BLOB related type in your table, the Error 1170 may also appear. It happens in situation such as when you specify VARCHAR column as primary key, but wrongly set its length or characters size. VARCHAR can only accepts up to 256 characters, so anything such as VARCHAR(512) will force MySQL to auto-convert the VARCHAR(512) to a SMALLTEXT datatype, which subsequently fail with error 1170 on key length if the column is used as primary key or unique or non-unique index. To solve this problem, specify a figure less than 256 as the size for VARCHAR field. | ||||
Tags | No tags attached. | ||||
i will write a patch. | |
A keylength is needed. Only the 13.2.3 branch is affected. CREATE TABLE NDMPJobEnvironment ( JobId INTEGER UNSIGNED NOT NULL REFERENCES Job, FileIndex INTEGER UNSIGNED NOT NULL, EnvName TINYBLOB NOT NULL, EnvValue TINYBLOB NOT NULL, CONSTRAINT NDMPJobEnvironment_pkey PRIMARY KEY (JobId, FileIndex, EnvName(256)) ); |
|
Fix committed to bareos bareos-13.2 branch with changesetid 2293. | |
Fix committed to bareos2015 bareos-13.2 branch with changesetid 3985. | |
Due to the reimport of the Github repository to bugs.bareos.org, the status of some tickets have been changed. These tickets will be closed again. Sorry for the noise. |
|
bareos: bareos-13.2 226c41f9 2014-11-03 11:52
Ported: N/A Details Diff |
set missing keylength for field 'EnvName' Fixes 0000356: BLOB/TEXT column 'EnvName' keylengt is missing mysql Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com> |
Affected Issues 0000356 |
|
mod - src/cats/ddl/creates/mysql.sql | Diff File | ||
bareos2015: bareos-13.2 868b832c 2014-11-03 12:52
Committer: mvwieringen Ported: N/A Details Diff |
set missing keylength for field 'EnvName' Fixes 0000356: BLOB/TEXT column 'EnvName' keylengt is missing mysql Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com> |
Affected Issues 0000356 |
|
mod - src/cats/ddl/creates/mysql.sql | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-11-03 11:18 |
|
New Issue | |
2014-11-03 11:19 |
|
Note Added: 0001029 | |
2014-11-03 11:44 |
|
Note Added: 0001030 | |
2014-11-03 12:50 |
|
Note Edited: 0001030 | |
2014-11-05 14:55 |
|
Changeset attached | => bareos bareos-13.2 226c41f9 |
2014-11-05 14:55 |
|
Note Added: 0001035 | |
2014-11-05 14:55 |
|
Assigned To | => daniel |
2014-11-05 14:55 |
|
Status | new => resolved |
2014-11-05 14:55 |
|
Resolution | open => fixed |
2014-12-01 12:22 | mvwieringen | Status | resolved => closed |
2014-12-01 12:22 | mvwieringen | Assigned To | daniel => |
2015-03-25 16:51 | mvwieringen | Changeset attached | => bareos2015 bareos-13.2 868b832c |
2015-03-25 16:51 | mvwieringen | Note Added: 0001406 | |
2015-03-25 16:51 | mvwieringen | Status | closed => resolved |
2015-03-25 19:18 | joergs | Note Added: 0001557 | |
2015-03-25 19:18 | joergs | Status | resolved => closed |