lunarmodules / luasql

LuaSQL is a simple interface from Lua to a DBMS.
http://lunarmodules.github.io/luasql
545 stars 191 forks source link

fix Oracle ORA-01406 in 10.0.2.4 #81

Closed DavidAlphaFox closed 5 years ago

DavidAlphaFox commented 6 years ago

Dear author. I use a very old version Oracle database. The version of Oracle is 10.2.0.4. When I use a courser to fetch data from the database in remote with different charset, the error occurs. I find that the server does not return the correct length of VARCHAR2, so I add some ugly codes to fix this problem. Thank you very much.

hishamhm commented 6 years ago

Does the code introduced by your patch also work in newer versions of Oracle?

DavidAlphaFox commented 6 years ago

@hishamhm Tanks for your reply. Sorry I don't have the newer versions of Oracle. So I'm not sure that the code introduced by myself can work fin with the newer versions of Oracle. I only test on Oracle 10 and below.

hishamhm commented 6 years ago

Ah, okay. Is it possible to use an #ifdef then, to introduce this code only to the versions you are able to test?

DavidAlphaFox commented 6 years ago

@hishamhm Thanks for you reply. I think you are right. I should use #ifdef. I will add #ifdef to prevent something wrong with newer version.