{"record":{"id":"9ccafde79cfe0b89","repo":"apache/shardingsphere","slug":"1-9ccafd","errorCode":"1","errorMessage":"Unsupported SQL operation: CREATE TEMPORARY TABLE.","messagePattern":"Unsupported SQL operation: CREATE TEMPORARY TABLE\\.","errorType":"exception","errorClass":"UnsupportedSQLOperationException","httpStatus":null,"severity":"error","filePath":"infra/context/src/main/java/org/apache/shardingsphere/infra/connection/kernel/KernelProcessor.java","lineNumber":74,"sourceCode":"        SQLRewriteResult rewriteResult = rewrite(queryContext, globalRuleMetaData, props, routeContext);\n        ExecutionContext result = createExecutionContext(queryContext, routeContext, rewriteResult);\n        logSQL(queryContext, props, result);\n        return result;\n    }\n    \n    private void check(final QueryContext queryContext) {\n        checkUnsupportedTemporaryTableDDL(queryContext);\n        if (queryContext.getHintValueContext().isSkipMetadataValidate()) {\n            return;\n        }\n        ShardingSphereDatabase database = queryContext.getUsedDatabase();\n        new SupportedSQLCheckEngine().checkSQL(database.getRuleMetaData().getRules(), queryContext.getSqlStatementContext(), database);\n    }\n    \n    private void checkUnsupportedTemporaryTableDDL(final QueryContext queryContext) {\n        SQLStatement sqlStatement = queryContext.getSqlStatementContext().getSqlStatement();\n        if (sqlStatement instanceof CreateTableStatement && ((CreateTableStatement) sqlStatement).isTemporary()) {\n            throw new UnsupportedSQLOperationException(\"CREATE TEMPORARY TABLE\");\n        }\n        if (sqlStatement instanceof DropTableStatement && ((DropTableStatement) sqlStatement).isTemporary()) {\n            throw new UnsupportedSQLOperationException(\"DROP TEMPORARY TABLE\");\n        }\n    }\n    \n    private RouteContext route(final QueryContext queryContext, final RuleMetaData globalRuleMetaData, final ConfigurationProperties props) {\n        ShardingSphereDatabase database = queryContext.getUsedDatabase();\n        return new SQLRouteEngine(database.getRuleMetaData().getRules(), props).route(queryContext, globalRuleMetaData, database);\n    }\n    \n    private SQLRewriteResult rewrite(final QueryContext queryContext, final RuleMetaData globalRuleMetaData, final ConfigurationProperties props, final RouteContext routeContext) {\n        SQLRewriteEntry sqlRewriteEntry = new SQLRewriteEntry(queryContext.getUsedDatabase(), globalRuleMetaData, props);\n        return sqlRewriteEntry.rewrite(queryContext, routeContext);\n    }\n    \n    private ExecutionContext createExecutionContext(final QueryContext queryContext, final RouteContext routeContext, final SQLRewriteResult rewriteResult) {\n        return new ExecutionContext(queryContext, ExecutionContextBuilder.build(queryContext.getUsedDatabase(), rewriteResult, queryContext.getSqlStatementContext()), routeContext);","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/infra/context/src/main/java/org/apache/shardingsphere/infra/connection/kernel/KernelProcessor.java#L56-L92","documentation":"Error \"Unsupported SQL operation: CREATE TEMPORARY TABLE.\" thrown in apache/shardingsphere.","triggerScenarios":"A CREATE TEMPORARY TABLE statement is submitted through the ShardingSphere kernel processor, which does not support temporary tables.","commonSituations":"Applications or ORM tools issuing CREATE TEMPORARY TABLE for intermediate results through ShardingSphere-Proxy or JDBC.","solutions":["Create a regular (non-temporary) table instead.","Remove the TEMPORARY keyword and let the table be routed as a normal sharding or single table.","Perform the temporary table operation directly on the target database outside ShardingSphere."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}