Loading...
 
Skip to main content

Missing table in mysql 5.7.17

Status
Closed
Subject
Missing table in mysql 5.7.17
Version
16.x
Category
  • Error
Feature
Database MySQL (MyISAM)
Resolution status
Fixed or Solved
Submitted by
bfitz
Volunteered to solve
Jonny Bradley
Lastmod by
bfitz
Rating
(0)
Description

The database table tiki_user_assigned_modules is not created on install. I am using mysql version 5.7.17, but the error may occur on other versions.

The query that creates the table:
DROP TABLE IF EXISTS `tiki_user_assigned_modules`;
CREATE TABLE `tiki_user_assigned_modules` (
`moduleId` int(8) NOT NULL,
`name` varchar(200) NOT NULL default '',
`position` varchar(20) default NULL,
`ord` int(4) default NULL,
`type` char(1) default NULL,
`user` varchar(200) NOT NULL default '',
PRIMARY KEY (`name`(30),`user`,`position`, `ord`),
KEY `id` (moduleId)
) ENGINE=MyISAM;

mysql throws an error of Primary Key cannot have NULL values, and the table fails to be created.

The missing table was first noticed when trying to modify the modules listed in the Assigned Modules area of the tiki-admin_modules.php page.

Suggested fix:
This table seems similar to the tiki_modules table. I would suggest modifying the position and ord columns to have the NOT NULL DEFAULT '' and '0' to match that table. I don't know what affect this will have on the tiki code overall, but it does let the database table be created.

The suggested sql code then becomes:
DROP TABLE IF EXISTS `tiki_user_assigned_modules`;
CREATE TABLE `tiki_user_assigned_modules` (
`moduleId` int(8) NOT NULL,
`name` varchar(200) NOT NULL default '',
`position` varchar(20) NOT NULL default '',
`ord` int(4) NOT NULL default '0',
`type` char(1) default NULL,
`user` varchar(200) NOT NULL default '',
PRIMARY KEY (`name`(30),`user`,`position`, `ord`),
KEY `id` (moduleId)
) ENGINE=MyISAM;

Solution
Hopefully r61917 in trunk will fix this
Importance
3
Easy to solve?
10 easy
Priority
30
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
6298
Created
Tuesday 14 March, 2017 22:34:21 UTC
by bfitz
LastModif
Monday 03 April, 2017 14:55:35 UTC


Show PHP error messages