-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade failed SQL 7 ERROR: invalid input syntax for integer: "5,179" #5758
Comments
After some poking around, the problem is caused by There the in statement doesn't work with an array that has more than one item: This is propably postgres related. |
https://github.com/owncloud/core/blob/master/apps/files_sharing/appinfo/update.php#L76 binding an array to one single query parameter will most probably work nowhere |
I had a similar error on two of three sites: One site didn't say anything, just turned maintainance mode on and stopped. The fix was to run the SQL statement manually: Afterwards the ugprade ran smooth. We use PostgreSQL. |
@zmi1 this is how the query should have looked like instead of that crazy code we have today. |
Thank you @zmi1, it works! |
Hi Thomas, heres the very much simplified and WORKING (yes, tested) solution. I have no idea how youd like the pull request to look like. So I attach it as a file and inline. Have fun. PULL REQUEST: |
Here's the simple diff that's working.
I've tested it, it's working. |
@zmi1 Thanks a lot! Feel free to get back to me in case of questions - THX |
Looked into it, too much effort for me. You can take the code above and create your own pull request. Whatever license you need I transfer it to you. |
That's sad - but understandable.
It will require MIT license - thanks a lot for your contribution! |
Hm, looking at the code I wonder why it's working: < $result = $removeShares->execute(array(implode(',', $delArray))); shouldn't that be < $result = $removeShares->execute(); ?? Not sure what the parameter to execute is. It was working four our site, but I guess a cleanup would be good. I guess it worked because delArray is empty as it's not used anymore. |
Without patch, breaks with: Failed to upgrade "files_sharing". Exception="SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "5,179"" See: owncloud#5758
I had the same problem upgrading from 5.0.15 to 5.0.25 (via Debian jessie packages). I've prepared a pull request (that is tested against 5.25/Debian Jessie package): |
I think you are right about the parameter being cruft. I just removed it in my pull request (but sadly I've already upgraded my installation so it's not tested). |
Without patch, breaks with: Failed to upgrade "files_sharing". Exception="SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "5,179"" See: #5758 removing unnecessary cruft - no parameter is set, none to pass. #5758 removing subquery, making more readable See: #6016 (comment) parameters to sql calls should be arrays #6016 boosting version to ensure fix gets executed properly escaping the sql select statement removing extraneous closing paren.
Without patch, breaks with: Failed to upgrade "files_sharing". Exception="SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "5,179"" See: #5758 removing unnecessary cruft - no parameter is set, none to pass. #5758 removing subquery, making more readable See: #6016 (comment) parameters to sql calls should be arrays #6016 boosting version to ensure fix gets executed properly escaping the sql select statement removing extraneous closing paren.
Not fixed, the same error upgrading 4.5.x to 5.0.17 here. Probably related to these lines:
As @DeepDiver1975 pointed out, "binding an array to one single query parameter will most probably work nowhere". Running the query by hand:
solves the problem for me - so the issue is placing an array of integers (imploded with ',') as a text param. |
@rysiekpl Fix above has |
Hi,
I just tried to upgrade to current version 5.0.13.
After applying the maintenance mode isn't turned off.
If I turn it off manually and refresh the main page I get the message:
Failed to upgrade "files_sharing". Exception="SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "5,179""
Does anyone know how to solve the issue?
Thanks
wolkenschieber
The text was updated successfully, but these errors were encountered: