![]() |
|
curious values in database options - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: curious values in database options (/thread-11134.html) |
curious values in database options - vincent3569 - 17-06-2013 after a setup, I have this message
I have a look on my database and I am unable to found multiple unique_options values. But I far I could see, there are curious options, like : Is it normal to have these values in the options table? curious values in database options - vincent3569 - 17-06-2013 other question : is it a way to found duplicate options, maybe with a specific sql request ? curious values in database options - vincent3569 - 17-06-2013 other question : when I have a look on a 1.4.5 database (options table) this unique_option key doesn't exist. is there an issue on the database modeling ? curious values in database options - vincent3569 - 17-06-2013 with a fresh install of 1.4.5, I have Is this key added during migration process ? In fact, on my old 1.4.5, I have a lot of multiple values, maybe not checked because there is no curious values in database options - acrylian - 17-06-2013 I don't have any of those entries in my db. ID is primary and name has unique_option set. curious values in database options - vincent3569 - 17-06-2013 in fact, there are 2 questions in my topic: 1- what are the values used by hitcounter plugin? 2- in my dev site, there is no unique index key set with ownerid, name and theme. curious values in database options - acrylian - 17-06-2013 1- Each item has a hitcount that is stored in their table, those for rss are in pluginstorage. Page-Hitcounter% is an option from the hitcounter plugin and correct. To 2. I have no idea and have to leave it to sbillard to answer. I don't think we have a tool for that as that actually should not happen.I did not see this on my test install which also was an upgraded one. curious values in database options - sbillard - 17-06-2013 The unique options is (would be) added by setup. This was added in 1.2.7. (For your information, if you look at the code towards the end of setup/index.php you will find the updates to the database structure. All are grouped and labeled by the release in which they were added.) But the SQL to add this index will fail if there are any duplicates already in the database. Unfortunately there are all sorts of valid causes for SQL errors during setup, so they are typically not noted. That is why the above warning was added. The only way I know of finding the duplicates is to sort the table by what would have been the index criteria and look. You will have to remove them manually before setup can make the proper index key. curious values in database options - vincent3569 - 18-06-2013 @acrylian: Quote:Page-Hitcounter% is an option from the hitcounter plugin and correct. if hitcounter have to store values for specific objects (different from album, images, news and pages), it should be store them in plugin_storage table rather than options table curious values in database options - vincent3569 - 18-06-2013 @sbillard
because I did not have multiple values, it is not normal that unique_option index key was not recreated during setup and the default options were inserted twice. curious values in database options - acrylian - 18-06-2013 Options are unique as well. but the % in "page_hitcounter-%" is actually a placeholder of a database query (hitcounter.php: 26). So there are meant to be several because this is the hitcount for static theme pages (non item pages). Probably plugin_storage would be better but I think the plugin handling is just older than the existence of that extra table. curious values in database options - vincent3569 - 19-06-2013 @sbillard curious values in database options - sbillard - 19-06-2013 Not an issue with the update, a problem with the database. SQL will not make a unique set if there are duplicates in the database. If the unique set is not present then it is possible to create duplicate entries. There is only one solution--remove the duplicates. I suggest you add one more step to your testing. Run the update with the setup ?debug parameter. This will log all the sql queries and you will be able to see the failure. The other way to find the duplicates is to try to create an index on curious values in database options - vincent3569 - 20-06-2013 hi I tried to do this (with debug mode) :
what I can see in my setup logs curious values in database options - sbillard - 20-06-2013 As said. If you have the unique index you cannot get duplicate options. If you do not have that index you can and probably will get duplicate options. If the index is not there setup will try to created it. If there are duplicate options the creation will fail. If you do not have the index you MUST remove the duplicates and without doing ANYTHING else run setup or re-create the index. If you run anything from the zenphoto core with no unique key you will likely get duplicates re-inserted into the database. curious values in database options - sbillard - 21-06-2013 I took a look at the backup-restore code. I believe that you can resolve this problem by backing up your database, dropping the database table, running setup to restore it, then running a restore. I have not verified this, though. The "last" entry of the duplicates will be the one that is saved if you use this process. curious values in database options - imagepet - 10-02-2025 A example SQL statement to delete all multiple entries except that one with the highest/lowest id is mentioned in my post Problem with the options table during update from 1.5.9 to 1.6.0. Acrylian recommends not to delete the highest id. |