What is the max length of JSON input parameter in the Stored Procedure

I see in the documentation, it is mentioned JSON size can go up to 100MB that is the default value of max_allowed_packet.
However, I see Long Data not supported error when I pass a JSON of size more than 3MB to the SP.

Can you please help me out with the exact variable that drives the JSON size in the Stored Procedure Input Parameter?

Can you send me the full error message?

I am not sure what driver are you using to connect to SingleStore, but since SingleStores uses the same protocol as MySQL, there is a STMT_SEND_LONG_DATA command in MySQL (https://dev.mysql.com/doc/internals/en/com-stmt-send-long-data.html), which we don’t support.

I am not sure but if the error message that you are seeing is due to the statement shown above, then the error has nothing to do with Stored Procedure but it means that your driver is trying to issue a command over MySQL wire protocol that MySQL will support but SingleStore doesn’t.

Error 1706: Feature ‘Long Data’ is not supported by MemSQL.

We are connecting to MemSQL from GoLang App using GitHub - go-sql-driver/mysql: Go MySQL Driver is a MySQL driver for Go's (golang) database/sql package

Hi Saksham, Do we have any update on what is causing this issue?

I haven’t looked into Go’s MySQL library, but as I said earlier, it’s issuing a Long Data command to memsql over mysql wire protocol, and we don’t support this command. I am not sure if there is flag in the library somewhere to force the library not to issue this Long Data command, which I suspect is some sort of optimization that the library is trying to do.

If you want to cross-check this, try using mysql client directly to run your query. Hopefully that will run query successfully without any issue.

@hanson can you connect OP to someone from connector team who can look into this issue more in detail?

Will update that I managed to fix the issue and avoid the use of the long data command by increasing maxAllowedPacket to 1GB.
I did so by adding the parameter maxAllowedPacket=1000000000 to the connection dsn-

hostDml := os.Getenv(hostDataEnvVar)
// maxAllowedPacket is set to ~1GB
connectionWithDbDml := userName + “:” + password + “@tcp(” + hostDml + “:” + PORT + “)/” + DATABASE + “?parseTime=true&maxAllowedPacket=1000000000”
gormDB, err = gorm.Open(mysql.Open(connectionWithDbDml),
&gorm.Config{
PrepareStmt: false,
Logger: logger.Default.LogMode(logger.Info), // Optional: Add GORM logger for detailed logs
})

The variable that dictates the JSON size in Stored Procedure Input Parameters is likely the max_allowed_packet setting. However, the issue might be related to other factors such as server configuration or data type limitations within the stored procedure.