node-odbc only returning first character of column value on macOS

126 views Asked by At

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

We have an Electron app that utilizes node-odbc to pull some records from a MySQL database.

I connect to an ODBC connection 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:

enter image description here

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

enter image description here

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

enter image description here

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.

enter image description here

I opened up an Issue with the node-odbc library in the hopes that someone has a clue as well: https://github.com/w1nk/node-odbc/issues/120

Thanks for any help!

0

There are 0 answers