forum.webdiplomacy.net
http://forum.webdiplomacy.net/

Database Error When running DATC tests
http://forum.webdiplomacy.net/viewtopic.php?f=11&t=848
Page 1 of 2

Author:  epios [ Wed Jan 25, 2012 10:01 pm ]
Post subject:  Database Error When running DATC tests

Hello,
I checked the code out of GIT and am working on installing it on a clean Apache instance. Everything seems to work ok until I run the DATC tests. I fixed this error by modifying the table but there seemed to be other database issues besides this one. Do I just have the wrong DB version somehow? I ran the update.sqls in the subfolders from version 1.0 to version 1.4. Thanks in advance!

I get the following error:

Error triggered: Data truncated for column 'pressType' at row 1

Error: "Data truncated for column 'pressType' at row 1"
Raised: "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\objects\database.php"
Line: "376"
userID = 5Variable dump: sql => INSERT INTO wD_Games
SET variantID=1,
name = 'DATC-Adjudicator-Test',
potType = 'Winner-takes-all',
pot = 0, /* This will receive the first player's bet soon */
minimumBet = 5,
anon = 'No',
pressType = 'Normal',
processTime = 1327010700,
phaseMinutes = 30
User => Array: (
silenceID =>
id => 5
username => epios
password => dd2081cba61efcde0bf861caf7d49fe6
email => kevingscott@yahoo.com
type => Array: (
System =>
Banned =>
User => 1
Moderator => 1
Guest =>
Admin => 1
Donator =>
DonatorBronze =>
DonatorSilver =>
DonatorGold =>
DonatorPlatinum =>
ForumModerator =>
)
notifications => Array: (
updated =>
)
comment =>
homepage =>
hideEmail => Yes
timeJoined => 1327008714
locale => English
timeLastSessionEnded => 1327008714
online => 1
points => 100
lastMessageIDViewed => 0
muteReports => No
)
timeStart => 1327008782.3012


Trace:
0 => Array: (
function => error_handler
args => Array: (
0 => 1024
1 => Data truncated for column 'pressType' at row 1
2 => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\objects\database.php
3 => 376
4 => Array: (
sql => INSERT INTO wD_Games
SET variantID=1,
name = 'DATC-Adjudicator-Test',
potType = 'Winner-takes-all',
pot = 0, /* This will receive the first player's bet soon */
minimumBet = 5,
anon = 'No',
pressType = 'Normal',
processTime = 1327010700,
phaseMinutes = 30
User => Array: (
silenceID =>
id => 5
username => epios
password => dd2081cba61efcde0bf861caf7d49fe6
email => kevingscott@yahoo.com
type => Array: (
System =>
Banned =>
User => 1
Moderator => 1
Guest =>
Admin => 1
Donator =>
DonatorBronze =>
DonatorSilver =>
DonatorGold =>
DonatorPlatinum =>
ForumModerator =>
)
notifications => Array: (
updated =>
)
comment =>
homepage =>
hideEmail => Yes
timeJoined => 1327008714
locale => English
timeLastSessionEnded => 1327008714
online => 1
points => 100
lastMessageIDViewed => 0
muteReports => No
)
timeStart => 1327008782.3012
)
)
)
1 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\objects\database.php
line => 376
function => trigger_error
args => Array: (
0 => Data truncated for column 'pressType' at row 1
)
)
2 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\gamemaster\game.php
line => 328
function => sql_put
class => Database
object => Array: (
putqueries => 4
getqueries => 7
)
type => ->
args => Array: (
0 => INSERT INTO wD_Games
SET variantID=1,
name = 'DATC-Adjudicator-Test',
potType = 'Winner-takes-all',
pot = 0, /* This will receive the first player's bet soon */
minimumBet = 5,
anon = 'No',
pressType = 'Normal',
processTime = 1327010700,
phaseMinutes = 30
)
)
3 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc\datcGame.php
line => 60
function => create
class => processGame
type => ::
args => Array: (
0 => 1
1 => DATC-Adjudicator-Test
2 =>
3 => 5
4 => Winner-takes-all
5 => 30
6 => 30
7 => No
8 => Normal
)
)
4 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc\interactive.php
line => 161
function => __construct
class => datcGame
object => Array: (
id =>
variantID =>
Variant =>
password =>
turn =>
phase =>
attempts =>
processTime =>
private =>
name =>
gameOver =>
pot =>
phaseMinutes =>
Members =>
potType =>
processStatus =>
pauseTimeRemaining =>
minimumBet =>
anon =>
pressType =>
lockMode =>
missingPlayerPolicy =>
)
type => ->
args => Array: (
0 => 101
)
)
5 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc.php
line => 33
args => Array: (
0 => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc\interactive.php
)
function => require_once
)

Author:  kestasjk [ Fri Jan 27, 2012 1:34 pm ]
Post subject:  Re: Database Error When running DATC tests

Hmm, it does look like you're using a somehow different database version, which is odd. You might have skipped an update script, unless I've made some odd mistake

Where did you get the initial install.sql from, and can you take a screenshot in phpMyAdmin of your wD_Games table?

Here is mine:

Attachments:
Untitled picture.png
Untitled picture.png [ 158.88 KiB | Viewed 2965 times ]

Author:  epios [ Fri Jan 27, 2012 3:56 pm ]
Post subject:  Re: Database Error When running DATC tests

Somewhat surprisingly (to me at least) it looks like my DB is the same, but the DATC is trying to insert the wrong value for the enum.

Here is my WD_Games

Thanks!

Attachments:
Screen shot 2012-01-27 at 10.53.43 AM.png
Screen shot 2012-01-27 at 10.53.43 AM.png [ 63.06 KiB | Viewed 2960 times ]

Author:  kestasjk [ Sat Jan 28, 2012 1:26 am ]
Post subject:  Re: Database Error When running DATC tests

You're right, there's a bug in datc/datcGame.php :
Code:
         $Game = processGame::create(1, 'DATC-Adjudicator-Test', '', 5,'Winner-takes-all', 30,30,'No','Normal');

That 'Normal' should be 'Regular'.. what's bizarre is that it still works fine for me :|

Anyway make that change yourself and I'll fix it in the official code

Author:  epios [ Sat Jan 28, 2012 2:11 am ]
Post subject:  Re: Database Error When running DATC tests

I get another error now. Do you think this is a problem just with the datcGame script? Can I just go through and adjust all the SQL to match my database? If you are sure the issues are in the script, I can get it to run again my database and submit the patch.

Author:  kestasjk [ Sat Jan 28, 2012 10:32 am ]
Post subject:  Re: Database Error When running DATC tests

What other error do you now get?

Author:  epios [ Sat Jan 28, 2012 3:27 pm ]
Post subject:  Re: Database Error When running DATC tests

Sorry now I get the below. Also I checked and the newMessagesFrom field doesn't currently have a default on my side, although I'm guessing it should be zero

Error: "Field 'newMessagesFrom' doesn't have a default value"
Raised: "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\objects\database.php"
Line: "376"
userID = 5, gameID = 1Variable dump: sql => INSERT INTO wD_Members (gameID, userID, countryID, bet, timeLoggedIn)
VALUES (1, 2, 1, 5, 1327716302),(1, 2, 2, 5, 1327716302),(1, 2, 3, 5, 1327716302),(1, 2, 4, 5, 1327716302),(1, 2, 5, 5, 1327716302),(1, 2, 6, 5, 1327716302),(1, 2, 7, 5, 1327716302)
User => Array: (
silenceID =>
id => 5
username => epios
password => dd2081cba61efcde0bf861caf7d49fe6
email => kevingscott@yahoo.com
type => Array: (
System =>
Banned =>
User => 1
Moderator => 1
Guest =>
Admin => 1
Donator =>
DonatorBronze =>
DonatorSilver =>
DonatorGold =>
DonatorPlatinum =>
ForumModerator =>
)
notifications => Array: (
updated =>
)
comment =>
homepage =>
hideEmail => Yes
timeJoined => 1327008714
locale => English
timeLastSessionEnded => 1327008714
online => 1
points => 100
lastMessageIDViewed => 0
muteReports => No
)
timeStart => 1327716302.7694


Trace:
0 => Array: (
function => error_handler
args => Array: (
0 => 1024
1 => Field 'newMessagesFrom' doesn't have a default value
2 => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\objects\database.php
3 => 376
4 => Array: (
sql => INSERT INTO wD_Members (gameID, userID, countryID, bet, timeLoggedIn)
VALUES (1, 2, 1, 5, 1327716302),(1, 2, 2, 5, 1327716302),(1, 2, 3, 5, 1327716302),(1, 2, 4, 5, 1327716302),(1, 2, 5, 5, 1327716302),(1, 2, 6, 5, 1327716302),(1, 2, 7, 5, 1327716302)
User => Array: (
silenceID =>
id => 5
username => epios
password => dd2081cba61efcde0bf861caf7d49fe6
email => kevingscott@yahoo.com
type => Array: (
System =>
Banned =>
User => 1
Moderator => 1
Guest =>
Admin => 1
Donator =>
DonatorBronze =>
DonatorSilver =>
DonatorGold =>
DonatorPlatinum =>
ForumModerator =>
)
notifications => Array: (
updated =>
)
comment =>
homepage =>
hideEmail => Yes
timeJoined => 1327008714
locale => English
timeLastSessionEnded => 1327008714
online => 1
points => 100
lastMessageIDViewed => 0
muteReports => No
)
timeStart => 1327716302.7694
)
)
)
1 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\objects\database.php
line => 376
function => trigger_error
args => Array: (
0 => Field 'newMessagesFrom' doesn't have a default value
)
)
2 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc\datcGame.php
line => 73
function => sql_put
class => Database
object => Array: (
putqueries => 13
getqueries => 9
)
type => ->
args => Array: (
0 => INSERT INTO wD_Members (gameID, userID, countryID, bet, timeLoggedIn)
VALUES (1, 2, 1, 5, 1327716302),(1, 2, 2, 5, 1327716302),(1, 2, 3, 5, 1327716302),(1, 2, 4, 5, 1327716302),(1, 2, 5, 5, 1327716302),(1, 2, 6, 5, 1327716302),(1, 2, 7, 5, 1327716302)
)
)
3 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc\interactive.php
line => 161
function => __construct
class => datcGame
object => Array: (
id =>
variantID =>
Variant =>
password =>
turn =>
phase =>
attempts =>
processTime =>
private =>
name =>
gameOver =>
pot =>
phaseMinutes =>
Members =>
potType =>
processStatus =>
pauseTimeRemaining =>
minimumBet =>
anon =>
pressType =>
lockMode =>
missingPlayerPolicy =>
)
type => ->
args => Array: (
0 => 101
)
)
4 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc.php
line => 33
args => Array: (
0 => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc\interactive.php
)
function => require_once
)

Author:  kestasjk [ Sun Jan 29, 2012 6:16 am ]
Post subject:  Re: Database Error When running DATC tests

Weird, I wonder if your MySQL install has warnings turned up or something? What OS, PHP and MySQL versions are you running?

Author:  epios [ Sun Jan 29, 2012 3:26 pm ]
Post subject:  Re: Database Error When running DATC tests

This is a completely clean install on a little test server. It's MySql 5.5.20 running on XP Sp3. The Web Server is Apache/2.2.21 (Win32) PHP/5.3.9

Author:  kestasjk [ Mon Jan 30, 2012 4:52 am ]
Post subject:  Re: Database Error When running DATC tests

Very odd, not so much that you're getting that error but that I don't.. try running this:
Code:
ALTER TABLE `wD_Members` CHANGE `newMessagesFrom` `newMessagesFrom` SET( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
CHANGE `votes` `votes` SET( 'Draw', 'Pause', 'Cancel' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''

Page 1 of 2 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/