Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

fetchmany fails when the result includes values of the type REAL #26

Closed
krichly opened this issue Apr 30, 2015 · 9 comments
Closed

fetchmany fails when the result includes values of the type REAL #26

krichly opened this issue Apr 30, 2015 · 9 comments

Comments

@krichly
Copy link

krichly commented Apr 30, 2015

Hi, the following error is thrown every time the result of a query includes REAL values.

/pyhdb/protocol/types.py", line 187, in from_resultset
return cls._struct.unpack(payload)[0]
struct.error: unpack requires a string argument of length 4

@bsrdjan
Copy link
Contributor

bsrdjan commented May 1, 2015

Unfortunately could not reproduce on a test system here. Are you using the latest PyHDB version ? You could also send me an example of a table structure and data values ?

@timogasda
Copy link
Contributor

Since this seems to be an unpacking issue, it would also be interesting to know which OS you are using, as well as your Python version and bitness

@ralhei
Copy link
Contributor

ralhei commented May 1, 2015

To me this sounds like pyhdb is not reading enough bytes from the payload which is why struct.unpack() is failing. Since those numbers of bytes is not dependent on the client's hw but rather on the HANA network protocol specs I would rather assume that this is a coding problem. But still we need to be able to reproduce this. So I follow up the Srdjan that we need to know you table structure and which SQL statement you have been trying to execute.
Also it might be helpful to include the full traceback, this helps us to understand the problem much better.

@krichly
Copy link
Author

krichly commented May 20, 2015

OS: Yosemite 10.10.3
Python: 2.7.8

The data and data schema we use in this project is open source an can be found under the following url: http://publish.illinois.edu/dbwork/open-data/

@timogasda
Copy link
Contributor

I tried to reproduce this with a simple test case with Python 2.7.6 on OSX Yosemite but it seems to work fine for me.
@krichly could you maybe show this to me in person some time? maybe I can find the problem at hand

timogasda added a commit to timogasda/PyHDB that referenced this issue May 21, 2015
@timogasda
Copy link
Contributor

Real.from_resultset is reading the wrong numbers of bytes. See my pull request #31

@bsrdjan
Copy link
Contributor

bsrdjan commented May 21, 2015

Thanks, just pushed as 1 commit as was not sure of 10 commits in PR could corrupt something else.
@krichly would you please please check if the fix helps on your system ?

@krichly
Copy link
Author

krichly commented May 21, 2015

Yes, it works! @bsrdjan

@bsrdjan
Copy link
Contributor

bsrdjan commented May 21, 2015

great, thaks @TwoLaid !

@bsrdjan bsrdjan closed this as completed May 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants