Jump to content
  • Update 21_1_25 broken...


    Xenithar
    • Status: Completed
      Main Category: Database
      Sub-Category: sqlupdate
      Version: 2.0.11 Milestone: 20 Priority: New
      Implemented Version: 21.5

    Update 21_1_25 broken...

    Alright, I've been trying to fix this on my own and I cannot figure it out. SOmething with the world update 21 1 25 is broken. It fails every single time, telling me it is on version 'dbdocs update'. The problem is, 21 1 24 and 21 1 25 are both called 'dbdocs update'. In my database I see 21 1 24 has been applied, but I am unable to proceed due to this. There is no additional information logged so I have tried many things to make this work and it just does not work. Since I did a fetch/merge I now can no longer test my work because the server won't start due to my DB being out of date, due to this bug.

    Also, there is nothing logged in error in my server logs, so this has me stumped.


    User Feedback

    Recommended Comments

    I have uploaded a screenshot of the issue. I modified the results to show the structure and content variables also. The issue is that "bRollback" is TRUE and it always rolls back, but no errors are logged. Is something missing which sets bRollback to FALSE? Again, the other updates worked, although 24 and 25 both have a space or some other character as the first character in the file. I have to delete this invisible character or the update will not run at all. I am guessing these were written in something in Windows which is not unicode aware?

    Link to comment
    Share on other sites

    I found the issues. You can't do safe updates without specifying an index. I removed all commenting, coding, everything except SQL from the update and ran it. It ran until it hit the following lines.
    [code]
    update dbdocsfields SET FieldComment = replace(FieldComment, 'table', 'table');
    update dbdocsfields SET fieldNotes = replace(fieldNotes, 'table', 'table');
    [/code]
    There is no index given so it was failing due to not being a safe operation. This was not being shown in the errors log, but it was causing the rollback flag to trip. All updates MUST specify an index! I now have to delete everything up to this line and figure out how to correct it so I can complete the update.

    Link to comment
    Share on other sites

    I disabled all the safe update features on the server and was able to execute the two lines of code and the other remaining 126 lines. All is good now, but there has to be a WHERE clause in these updates. I turned my safe updates settings back on after updating to 21_2_1. I am good and can continue work on the server, but something should be done about this. I will leave this open since the issue has not been fixed.

    Link to comment
    Share on other sites

    [quote=Xenithar]I found the issues. You can't do safe updates without specifying an index. I removed all commenting, coding, everything except SQL from the update and ran it. It ran until it hit the following lines.
    [code]
    update dbdocsfields SET FieldComment = replace(FieldComment, 'table', 'table');
    update dbdocsfields SET fieldNotes = replace(fieldNotes, 'table', 'table');
    [/code]
    There is no index given so it was failing due to not being a safe operation. This was not being shown in the errors log, but it was causing the rollback flag to trip. All updates MUST specify an index! I now have to delete everything up to this line and figure out how to correct it so I can complete the update.[/quote]

    To make these lines safe add an "always true where clause", involving an index, like you did in a previous PR (21_1_16, if I remeber right). Like:

    update dbdocsfields SET FieldComment = replace(FieldComment, 'table', 'table') where `fieldId`> 0;
    update dbdocsfields SET fieldNotes = replace(fieldNotes, 'table', 'table') where `fieldId`> 0;


    This is a standard procedure to calm down the angry MySQL.

    PS: What is the meaning of those 2 updates? Maybe I`m blind, but I don't get it. It replaces all occurences of "table" with.. "table"? In the comments I see something about "fixing a typo"...

    Link to comment
    Share on other sites

    Yeah, I did not understand what it fixed, but left it alone. I thought about doing a PR for >0, but wanted somebody familiar with why these lines were even in there to comment first. They appear to do nothing.

    Link to comment
    Share on other sites

    [url]https://github.com/mangoszero/database/pull/31[/url]

    Lines removed.

    They were supposed to replace 'tabel' with 'table', but that spelling error no longer exists. I have no idea how both fields in that script ended up as the same.

    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use