hdbc-mysql icon indicating copy to clipboard operation
hdbc-mysql copied to clipboard

Query of column with JSON type fails

Open hillaryan opened this issue 8 years ago • 1 comments

Executing a query with this general structure:

SELECT column_with_JSON_type 
FROM table;

Results in: malloc: resource exhausted (out of memory)

hillaryan avatar Sep 30 '16 23:09 hillaryan

hdbc-mysql has not added support for this new MySQL feature.

Can you describe your environment better and give an simplified version of it? I tried reproducing this and I get some error, but not a malloc error.

Here's what I did:

create table t (j JSON);
INSERT INTO t1 VALUES('{"key1": "value1", "key2": "value2"}');

then I used this program:

module Main where

import Control.Monad
import Database.HDBC
import Database.HDBC.MySQL

main = do
  rows <- withRTSSignalsBlocked $ do
    conn <- connectMySQL defaultMySQLConnectInfo
    quickQuery' conn "SELECT j from test.t" []
  forM_ rows $ \row -> putStrLn $ show row
  putStrLn "end"

and the output I get is:

[SqlString "unknown type 245"]
end

ryantm avatar Oct 01 '16 04:10 ryantm