php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77138 Errors creating db schema for web/master
Submitted: 2018-11-11 07:31 UTC Modified: 2018-11-25 19:31 UTC
From: zach at zrhoffman dot net Assigned:
Status: Assigned Package: Website problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: zach at zrhoffman dot net
New email:
PHP Version: OS:

 

 [2018-11-11 07:31 UTC] zach at zrhoffman dot net
Description:
------------
In web/master, there are 4 SQL files to create the db schema for the
"phpmasterdb" database. The import works successfully in MySQL 4 but not MySQL
5.

Test script:
---------------
for sql in *.sql; do echo "$sql"; mysql -udocker -pdocker -hdb docker <"$sql"; done;

Expected result:
----------------
Expect successful database import

Actual result:
--------------
In MySQL 5.5 and up, you get the following errors when trying to import the SQL:

zrhoffman: [0]$ for sql in *.sql; do echo "$sql"; mysql -udocker -pdocker -hdb docker <"$sql"; done;
event.sql
ERROR 1064 (42000) at line 5: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 21
mirrors.sql
ERROR 1064 (42000) at line 5: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 29
note.sql
ERROR 1064 (42000) at line 16: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM PACK_KEYS=1' at line 14
users.sql
ERROR 1064 (42000) at line 25: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 27

Patches

update_schema_for_5.7.patch (last revision 2018-11-11 07:45 UTC by zach at zrhoffman dot net)
update_schema_for_5.5.patch (last revision 2018-11-11 07:45 UTC by zach at zrhoffman dot net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-11-11 07:50 UTC] zach at zrhoffman dot net
-Status: Open +Status: Assigned
 [2018-11-11 07:50 UTC] zach at zrhoffman dot net
I did not see a php/web-master repo on GitHub, so I will submit patches here.

These 2 patches fix issues importing the db schema for MySQL versions up through
5.7.

• Fixed in 95f045c1ff: `ERROR 1064 (42000) at line 5: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 21`

• Fixed in 95f045c1ff: `ERROR 1426 (42000) at line 31: Too big precision 14 specified for 'updated'. Maximum is 6`

• Fixed in b07abd2dcb: `ERROR 1067 (42000) at line 5: Invalid default value for 'created'`
 [2018-11-25 07:25 UTC] petk@php.net
Thank you for the patches. I've opened a request for the mirror here https://bugs.php.net/bug.php?id=77196 since it would be really useful to have it one day.
 [2018-11-25 19:31 UTC] zach at zrhoffman dot net
Thanks Peter!
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Thu Dec 13 08:01:25 2018 UTC