PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Authentication » LiveUser » Bug #1600

MySQL Schema creation bug

Details

Submitted2004-06-10 08:23 UTC
Frommhavilah at hotmail dot com
Assigneddufuz
StatusClosed
PackageLiveUser
PHP Version4.3.6
OSWinXPPro
Roadmaps(Not assigned)

Comments

[2004-06-10 08:23 UTC] mhavilah at hotmail dot com

Description:
------------
> I wanted to report a small bug in the permissions creation script,
> perm_db.sql in the current version of LiveUser [v0.11.1].

> I’m running MySQL Server v3.23.53.
-------------
> I’ve used the LiveUser scripts from
> $PHP_HOME/PEAR/data/LiveUser/misc/schema/:
>
> - Auth_DB.sql - worked fine
>
> - Perm_db.sql – gave an error creating: liveusers_translations

> mysql.exe complained that the all portions of a compound primary key must be either UNIQUE or NOT NULL.
>
> Your definition of the ‘language id’ column has:
> - a default of ‘NULL’ -- should this be default ‘0’
> - neither UNIQUE, nor NOT NULL.

> You can see my correction on the subsequent lines. The schema was created successfully after the changes.

Reproduce code:
---------------
> ////// Excerpt from perm_db.sql……………..
> DROP TABLE IF EXISTS `liveuser_translations`;
> CREATE TABLE `liveuser_translations` (
> `section_id` int(16) unsigned NOT NULL default '0',
> `section_type` tinyint(3) unsigned NOT NULL default '0',
> # Original line follows.
> # `language_id` smallint(5) unsigned default NULL,
> # MiH: Made NOT NULL/default:0
> `language_id` smallint(5) unsigned NOT NULL default '0',
> `name` varchar(50) NOT NULL default '',
> `description` varchar(255) default NULL,
> PRIMARY KEY (`section_id`,`section_type`, `language_id`)
> ) TYPE=MyISAM;
> //////////end of perm_db.sql excerpt

Expected result:
----------------
Schema table liveuser_translations is created

Actual result:
--------------
> mysql.exe complained that the all portions of a compound primary key must be either UNIQUE or NOT NULL.