cancel
Showing results for 
Search instead for 
Did you mean: 

FOR JSON AUTO crashes SA17 and PHP 5.5.9-1ubuntu4.14

1,884

I'm running SA 17.0.0.1358, PHP 5.5.9 under Ubuntu 14.04.

The following script crashes the PHP extension and I get a "502 Bad Gateway" error.

    $conn = sasql_connect( "SERVER=demo17;DBN=demo;UID=DBA;PWD=sql" );
    if( $conn ) {
        $rows = array();
        $rs = sasql_query( $conn, "SELECT * FROM Departments FOR JSON AUTO;" );
        print "QUERY WORKED";
        sasql_disconnect( $conn );
    }

If I leave out the 'FOR JSON AUTO' clause, it works fine.

Anyone else seen this?

MarkCulp
Participant
0 Kudos

There has been a few fixes to the JSON AUTO code. What build are you using? If not the latest and I'd suggest that you try a more recent version. If the problem persists then please send me (using my first.lastname at sap.com) a repro and we can look at issue.

0 Kudos

I'm running SA 17.0.0.1358, PHP 5.5.9 under Ubuntu 14.04.

AFAIK, it is the latest Developer Edition release.

VolkerBarth
Contributor

Nothing according to JSON in the freshest Windows 17.0.0.1359 EBF, see SQL Anywhere Readmes compared toyour version - but hey, that's only one build number later...

So the Developer Edition certainly is quite fresh:)

0 Kudos

Yes, it's nice to see the Developer Edition being kept fresh. Not complaining there 🙂

Unless I've screwed it up, the Linux version is still 17.0.0.1358.

MarkCulp
Participant

FYI: I've reproduced a problem when doing a "SELECT * from <> FOR JSON AUTO" - there appears to be an issue in the dbcapi library. I will continue to investigate...

MarkCulp
Participant

We're working on a fix... in the meantime a workaround is to wrap your query as an inner block and name the result column. Example:

SELECT ( SELECT * FROM Departments FOR JSON AUTO ) as jsondata
0 Kudos

Thanks, that worked!

Accepted Solutions (0)

Answers (0)