Skip to content
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

Only returning first character on macOS. #120

Open
joshuapinter opened this issue Jun 30, 2018 · 2 comments
Open

Only returning first character on macOS. #120

joshuapinter opened this issue Jun 30, 2018 · 2 comments

Comments

@joshuapinter
Copy link

I have a strange issue here that seems to only be affecting macOS, not Windows.

I connect to an ODBC via a MySQL driver just fine but when I run a query like:

const query = "SELECT * FROM tasks LIMIT 10";

const tasks = odbc.querySync( query );

console.log( "tasks", tasks );

The resulting fields from the tasks table only have the first character returned.

For example, here's what the column and value looks like in the MySQL table:

screenshot 2018-06-30 16 56 52

And here is what is returned to the console for that same record:

screenshot 2018-06-30 16 57 47

When I use iODBC Demo Ansi to connect and run the same query, I get the correct, full value:

screenshot 2018-06-30 16 58 25

So that makes me think that the ODBC connection is fine and it might be something to do with how the node-odbc is handling the data.

Even stranger, when I run this on Windows, it returns the correct, full value through node-odbc just fine.

screenshot 2018-06-30 16 59 49

In the event that others have run into this or anybody knows what I could investigate, I've added it here.

Thanks for any help!

@wankdanker
Copy link
Collaborator

@joshuapinter What is the datatype of that field?

@joshuapinter
Copy link
Author

VARCHAR(50)

screenshot 2018-07-02 09 30 34

I tried changing it to TEXT and VARBINARY and a couple others to see if it helped. No change. It seems only the numeric values, like INT come through with more than the first character.

But, everything works fine on iODBC Demo application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants