EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Bug Reports (https://www.eqemulator.org/forums/forumdisplay.php?f=591)
-   -   mailkey on STRICT mode MySQL (https://www.eqemulator.org/forums/showthread.php?t=27424)

John Adams 02-07-2009 04:47 PM

mailkey on STRICT mode MySQL
 
I discovered today that new characters being created on my server were being denied due to the new character_.mailkey column being set to NOT NULL, but not getting a value during character create (or maybe that's something I have configured wrong?). This is because my MySQL runs in STRICT_ALL_TABLES mode, so when a field is deemed NOT NULL, it really means, do not allow inserts if there is no value for this field. :)

For now, I took off the NOT NULL, but hoping someone can tell me if a) this is a bug in as much as the field is just too forgiving, or b) if this is a result of the fact I do not have the mail/chat systems working yet. I do not know if that key actually gets generated *IF* the system is running.

Thanks

cavedude 02-07-2009 05:26 PM

Hey John, nice to see you around. I see EQ2Emu is coming along well :)

The schema for mailkey that PEQ uses is:

`mailkey` CHAR(16) NOT NULL default '0',

The key should get auto-assigned sometime after character creation. I'm not sure when, Derision would have to tell you that. The default 0 should at least allow you in-game, and the key will probably be assigned when you get the mail server up and running.

John Adams 02-08-2009 04:03 AM

Ok, thanks Cavedude. I don't think the provided table create has the default '0', because mine was default ''. I'll change the default and let it go that way.

Thanks for the heads up.

cavedude 02-08-2009 02:11 PM

It's good practice to always have a default value in a NOT NULL column anyway. The only exception is in cases were it is imperative that a value is manually entered. This isn't one of them. On PEQ, when a character is created mailkey defaults to 0, and somewhere along the line it gets to changed to an actual key.

EDIT: I just changed the column on SVN to avoid any further confusion.


All times are GMT -4. The time now is 08:17 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.