You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: json_extract trigger connection Lost while query non-exist elem. #14909
- Hardware parameters: macbook pro M1
- OS type: macOS
- Others:
Actual Behavior
exist query select json_extract('[1,2,3]', '$[3]') got Error: ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> select json_extract('[1,2,3]', '$[3]');
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> select json_extract('[1,2,3]', '$[3]');
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
Connection id: 14226
Current database: system
ERROR 2013 (HY000): Lost connection to MySQL server during query
Expected Behavior
return NULL if query the non-exists elem.
the connection should keep going.
mysql> select json_extract('[1,2,3]', '$[3]');
+---------------------------------+
| json_extract('[1,2,3]', '$[3]') |
+---------------------------------+
| NULL |
+---------------------------------+
1 row in set (0.01 sec)
Activity
YANGGMM commentedon Mar 15, 2024
{"level":"ERROR","time":"2024/03/15 16:08:02.347812 +0800","caller":"vm/vm.go:121","msg":"error: internal error: panic runtime error: slice bounds out of range [:8201] with capacity 47: \nruntime.goPanicSliceAcap\n\t/opt/homebrew/Cellar/go/1.21.6/libexec/src/runtime/panic.go:140\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.getObjectKey\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:256\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.toObject\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:197\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.to\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:156\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.MarshalJSON\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:77\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.String\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:31\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*MysqlResultSet).GetString\n\t/Users/yangzhao/matrixone/pkg/frontend/resultset.go:514\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*MysqlProtocolImpl).makeResultSetTextRow\n\t/Users/yangzhao/matrixone/pkg/frontend/mysql_protocol.go:2178\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*MysqlProtocolImpl).SendResultSetTextBatchRowSpeedup\n\t/Users/yangzhao/matrixone/pkg/frontend/mysql_protocol.go:2350\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*outputQueue).flush\n\t/Users/yangzhao/matrixone/pkg/frontend/output.go:123\ngithub.com/matrixorigin/matrixone/pkg/frontend.getDataFromPipeline\n\t/Users/yangzhao/matrixone/pkg/frontend/mysql_cmd_executor.go:565\ngithub.com/matrixorigin/matrixone/pkg/sql/colexec/output.(*Argument).Call\n\t/Users/yangzhao/matrixone/pkg/sql/colexec/output/output.go:60\ngithub.com/matrixorigin/matrixone/pkg/vm.Run\n\t/Users/yangzhao/matrixone/pkg/vm/vm.go:135\ngithub.com/matrixorigin/matrixone/pkg/vm/pipeline.(*Pipeline).MergeRun\n\t/Users/yangzhao/matrixone/pkg/vm/pipeline/pipeline.go:156\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun\n\t/Users/yangzhao/matrixone/pkg/sql/compile/scope.go:209\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Compile).run\n\t/Users/yangzhao/matrixone/pkg/sql/compile/compile.go:344\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Compile).runOnce.func1\n\t/Users/yangzhao/matrixone/pkg/sql/compile/compile.go:616\ngithub.com/panjf2000/ants/v2.(*goWorker).run.func1\n\t/Users/yangzhao/matrixone/vendor/github.com/panjf2000/ants/v2/worker.go:67\nruntime.goexit\n\t/opt/homebrew/Cellar/go/1.21.6/libexec/src/runtime/asm_arm64.s:1197","span":{"trace_id":"a923baff-c62d-f9b4-095a-3e693c9ce27f","span_id":"d96551d2dd373b4f"}} {"level":"ERROR","time":"2024/03/15 16:08:02.347996 +0800","caller":"vm/vm.go:122","msg":"panic in vm.Run: internal error: panic runtime error: slice bounds out of range [:8201] with capacity 47: \nruntime.goPanicSliceAcap\n\t/opt/homebrew/Cellar/go/1.21.6/libexec/src/runtime/panic.go:140\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.getObjectKey\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:256\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.toObject\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:197\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.to\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:156\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.MarshalJSON\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:77\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.String\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:31\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*MysqlResultSet).GetString\n\t/Users/yangzhao/matrixone/pkg/frontend/resultset.go:514\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*MysqlProtocolImpl).makeResultSetTextRow\n\t/Users/yangzhao/matrixone/pkg/frontend/mysql_protocol.go:2178\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*MysqlProtocolImpl).SendResultSetTextBatchRowSpeedup\n\t/Users/yangzhao/matrixone/pkg/frontend/mysql_protocol.go:2350\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*outputQueue).flush\n\t/Users/yangzhao/matrixone/pkg/frontend/output.go:123\ngithub.com/matrixorigin/matrixone/pkg/frontend.getDataFromPipeline\n\t/Users/yangzhao/matrixone/pkg/frontend/mysql_cmd_executor.go:565\ngithub.com/matrixorigin/matrixone/pkg/sql/colexec/output.(*Argument).Call\n\t/Users/yangzhao/matrixone/pkg/sql/colexec/output/output.go:60\ngithub.com/matrixorigin/matrixone/pkg/vm.Run\n\t/Users/yangzhao/matrixone/pkg/vm/vm.go:135\ngithub.com/matrixorigin/matrixone/pkg/vm/pipeline.(*Pipeline).MergeRun\n\t/Users/yangzhao/matrixone/pkg/vm/pipeline/pipeline.go:156\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun\n\t/Users/yangzhao/matrixone/pkg/sql/compile/scope.go:209\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Compile).run\n\t/Users/yangzhao/matrixone/pkg/sql/compile/compile.go:344\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Compile).runOnce.func1\n\t/Users/yangzhao/matrixone/pkg/sql/compile/compile.go:616\ngithub.com/panjf2000/ants/v2.(*goWorker).run.func1\n\t/Users/yangzhao/matrixone/vendor/github.com/panjf2000/ants/v2/worker.go:67\nruntime.goexit\n\t/opt/homebrew/Cellar/go/1.21.6/libexec/src/runtime/asm_arm64.s:1197"} {"level":"ERROR","time":"2024/03/15 16:08:02.348186 +0800","name":"log-service.frontend","caller":"frontend/mysql_cmd_executor.go:3224","msg":"internal error: panic runtime error: slice bounds out of range [:8201] with capacity 47: \nruntime.goPanicSliceAcap\n\t/opt/homebrew/Cellar/go/1.21.6/libexec/src/runtime/panic.go:140\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.getObjectKey\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:256\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.toObject\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:197\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.to\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:156\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.MarshalJSON\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:77\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.String\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:31\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*MysqlResultSet).GetString\n\t/Users/yangzhao/matrixone/pkg/frontend/resultset.go:514\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*MysqlProtocolImpl).makeResultSetTextRow\n\t/Users/yangzhao/matrixone/pkg/frontend/mysql_protocol.go:2178\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*MysqlProtocolImpl).SendResultSetTextBatchRowSpeedup\n\t/Users/yangzhao/matrixone/pkg/frontend/mysql_protocol.go:2350\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*outputQueue).flush\n\t/Users/yangzhao/matrixone/pkg/frontend/output.go:123\ngithub.com/matrixorigin/matrixone/pkg/frontend.getDataFromPipeline\n\t/Users/yangzhao/matrixone/pkg/frontend/mysql_cmd_executor.go:565\ngithub.com/matrixorigin/matrixone/pkg/sql/colexec/output.(*Argument).Call\n\t/Users/yangzhao/matrixone/pkg/sql/colexec/output/output.go:60\ngithub.com/matrixorigin/matrixone/pkg/vm.Run\n\t/Users/yangzhao/matrixone/pkg/vm/vm.go:135\ngithub.com/matrixorigin/matrixone/pkg/vm/pipeline.(*Pipeline).MergeRun\n\t/Users/yangzhao/matrixone/pkg/vm/pipeline/pipeline.go:156\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun\n\t/Users/yangzhao/matrixone/pkg/sql/compile/scope.go:209\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Compile).run\n\t/Users/yangzhao/matrixone/pkg/sql/compile/compile.go:344\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Compile).runOnce.func1\n\t/Users/yangzhao/matrixone/pkg/sql/compile/compile.go:616\ngithub.com/panjf2000/ants/v2.(*goWorker).run.func1\n\t/Users/yangzhao/matrixone/vendor/github.com/panjf2000/ants/v2/worker.go:67\nruntime.goexit\n\t/opt/homebrew/Cellar/go/1.21.6/libexec/src/runtime/asm_arm64.s:1197","uuid":"7c4dccb4-4d3c-41f8-b482-5251dc7a41bf","session_info":"connectionId 1515|127.0.0.1:53439|{account sys:dump:moadmin -- 0:1:0}|goRoutineId 2166|018e4127-5271-72df-bf47-36901d502c48","session_id":"018e4127-5271-72df-bf47-36901d502c48","statement_id":"018e4127-5c29-7f78-9d14-529546dd2354","txn_id":"018e41275c2a7f96a079ac1e2350d0b9/Active/S:1710490082343982000-1"} {"level":"ERROR","time":"2024/03/15 16:08:02.348375 +0800","name":"log-service.frontend","caller":"frontend/util.go:514","msg":"query trace status","uuid":"7c4dccb4-4d3c-41f8-b482-5251dc7a41bf","connection_id":1515,"statement":"select json_extract('[1,2,3]', '$[3]')","status":"fail","error":"internal error: panic runtime error: slice bounds out of range [:8201] with capacity 47: \nruntime.goPanicSliceAcap\n\t/opt/homebrew/Cellar/go/1.21.6/libexec/src/runtime/panic.go:140\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.getObjectKey\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:256\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.toObject\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:197\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.to\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:156\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.MarshalJSON\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:77\ngithub.com/matrixorigin/matrixone/pkg/container/bytejson.ByteJson.String\n\t/Users/yangzhao/matrixone/pkg/container/bytejson/bytejson.go:31\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*MysqlResultSet).GetString\n\t/Users/yangzhao/matrixone/pkg/frontend/resultset.go:514\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*MysqlProtocolImpl).makeResultSetTextRow\n\t/Users/yangzhao/matrixone/pkg/frontend/mysql_protocol.go:2178\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*MysqlProtocolImpl).SendResultSetTextBatchRowSpeedup\n\t/Users/yangzhao/matrixone/pkg/frontend/mysql_protocol.go:2350\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*outputQueue).flush\n\t/Users/yangzhao/matrixone/pkg/frontend/output.go:123\ngithub.com/matrixorigin/matrixone/pkg/frontend.getDataFromPipeline\n\t/Users/yangzhao/matrixone/pkg/frontend/mysql_cmd_executor.go:565\ngithub.com/matrixorigin/matrixone/pkg/sql/colexec/output.(*Argument).Call\n\t/Users/yangzhao/matrixone/pkg/sql/colexec/output/output.go:60\ngithub.com/matrixorigin/matrixone/pkg/vm.Run\n\t/Users/yangzhao/matrixone/pkg/vm/vm.go:135\ngithub.com/matrixorigin/matrixone/pkg/vm/pipeline.(*Pipeline).MergeRun\n\t/Users/yangzhao/matrixone/pkg/vm/pipeline/pipeline.go:156\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun\n\t/Users/yangzhao/matrixone/pkg/sql/compile/scope.go:209\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Compile).run\n\t/Users/yangzhao/matrixone/pkg/sql/compile/compile.go:344\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*Compile).runOnce.func1\n\t/Users/yangzhao/matrixone/pkg/sql/compile/compile.go:616\ngithub.com/panjf2000/ants/v2.(*goWorker).run.func1\n\t/Users/yangzhao/matrixone/vendor/github.com/panjf2000/ants/v2/worker.go:67\nruntime.goexit\n\t/opt/homebrew/Cellar/go/1.21.6/libexec/src/runtime/asm_arm64.s:1197","span":{"trace_id":"a923baff-c62d-f9b4-095a-3e693c9ce27f","span_id":"d96551d2dd373b4f"},"session_info":"connectionId 1515|127.0.0.1:53439|{account sys:dump:moadmin -- 0:1:0}|goRoutineId 2166|018e4127-5271-72df-bf47-36901d502c48","session_id":"018e4127-5271-72df-bf47-36901d502c48","statement_id":"018e4127-5c29-7f78-9d14-529546dd2354"}YANGGMM commentedon Mar 19, 2024
fixed,plz test
2 remaining items
xzxiong commentedon Apr 2, 2024
@YANGGMM 解决了
select json_extract('[1,2,3]', '$[3]');, 但是没解决YANGGMM commentedon Apr 8, 2024
fixed,plz test
Ariznawlll commentedon Apr 9, 2024
qa环境

commit v1.1.3-4cfce1a18-2024-04-09