Hi,
Apologies if this has already been covered elsewhere. I had trouble with Build 2 and the latest Beta 12 versions when trying to set an alias.
Here is how it went....
1. Used PT3 DB export function to back up all DB hands.(Build2)
2. Installed Beta 12.
3. Created new DB.
4. Used PT3 import function to import previously exported hands.
5. Attempted to set the aliases up again but PT3 returned a fatal error regarding the SQL statement it was trying to execute.
Some investigation showed that the DB table that this query was trying to update (tourney_holdem_results) contained a number of invalid primary keys and this was preventing the alias creation query from running. Specifically, as you know, the primary key is a combination of the id_tourney and id_player fields.
I have a number of nicknames for the same poker network (iPoker) and I like to 'tie' them together using the alias function (let's call them NICK1 and NICK2). As these nick's are at the same poker network I have never played the same tournament using more than one nickname (I know its possible but I wouldn't stoop to this ;) ).
However, when I looked through the tournament results in PT3, I noticed a number of instances where both NICK1 and NICK2 are recorded as having played in the same tournament! A closer look revealed that actual hands were only stored for the tournament played by NICK1, the tourney entry for NICK2, that appears to have been created in error during the export or import process, has no hands listed (no surprise really).
This all leads to the SQL error when trying to create an alias.
What happens is this:
Assume the following values....
NICK1 id_player = 500
NICK2 id_player = 650
id_tourney = 23
Current DB entries are (touney_holdem_results table):
id_tourney playername id_player id_player_real
23 NICK1 500 500
23 NICK2 650 650
NICK1 is my default PT3 nickname (entered in settings)
NICK2 is the alias I wish to link to NICK1
When PT3 attempts to create this alias it finds all instances of the NICK2 id_player and replaces them with the NICK1 id_player value, for example, it will find all id_player fields with the value 650 and replace them with the value 500.
In my case this would result in the following:
id_tourney playername id_player id_player_real
23 NICK1 500 500
23 NICK2 500 650
As you can see, this results in entries in the tourney_holdem_results table that violate the primary key constraint, there are now multiple records that have the same values for id_player and id_tourney.
Of course the SQL query fails, if won't let you violate the primary key constraint. The downside is no aliases :(
My thoughts...
1. The duplicate tournament entries must have crept into the database either during the export of the build 2 DB or during the import into Beta12. It is specifically these duplicate entries that prevent an alias being created.
2. It may be possible to make the tourney_holdem_results primary key a combination of id_tourney and id_player_real (instead of usig id_player) as I guess id_player_real never changes and therefore this specific problem would not appear, though I guess this would cause problems elsewhere an is therefore not possible.
3. When I exported the hands from Build 2 I had already created aliases. I did not remove them before the export as I never believed it necessary (I have seen no references to such in this forum at least). Perhaps this caused some problems during the export resulting in the duplicate tourney results.
Workaround...
The only way to solve this problem was to create a new DB and re-import all hands (yet again) from the original poker site hand histories. Aliases could then be created with no problems.
Sorry for the long post but hope that the detail helps you to resolve this bug.
Best regards,
Steve
**Interested to hear from anyone else that has experienced the same problem. :shock:
