test_class.declarator: SCHEMA_PATTERN = "schema_%s"
test_class.modifier: private static final
test_class.original_string: private static final String SCHEMA_PATTERN = "schema_%s";
test_class.type: String
test_class.var_name: SCHEMA_PATTERN
test_class.declarator: backendConnection = new BackendConnection(TransactionType.LOCAL)
test_class.modifier: private final
test_class.original_string: private final BackendConnection backendConnection = new BackendConnection(TransactionType.LOCAL);
test_class.type: BackendConnection
test_class.var_name: backendConnection
test_class.file: shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/sctl/set/ShardingCTLSetBackendHandlerTest.java
test_class.identifier: ShardingCTLSetBackendHandlerTest
test_case.body: @Test
      public void assertSwitchTransactionTypeXA() {
          backendConnection.setCurrentSchema(String.format(SCHEMA_PATTERN, 0));
          ShardingCTLSetBackendHandler shardingCTLBackendHandler = new ShardingCTLSetBackendHandler("sctl:set transaction_type=XA", backendConnection);
          BackendResponse actual = shardingCTLBackendHandler.execute();
          assertThat(actual, instanceOf(UpdateResponse.class));
          assertThat(backendConnection.getTransactionStatus().getTransactionType(), is(TransactionType.XA));
      }
test_case.class_method_signature: ShardingCTLSetBackendHandlerTest.assertSwitchTransactionTypeXA()
test_case.full_signature: @Test public void assertSwitchTransactionTypeXA()
test_case.identifier: assertSwitchTransactionTypeXA
test_case.invocations: setCurrentSchema format execute assertThat instanceOf assertThat getTransactionType getTransactionStatus is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertSwitchTransactionTypeXA()
focal_class.declarator: sql
focal_class.modifier: private final
focal_class.original_string: private final String sql;
focal_class.type: String
focal_class.var_name: sql
focal_class.declarator: backendConnection
focal_class.modifier: private final
focal_class.original_string: private final BackendConnection backendConnection;
focal_class.type: BackendConnection
focal_class.var_name: backendConnection
focal_class.file: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/sctl/set/ShardingCTLSetBackendHandler.java
focal_class.identifier: ShardingCTLSetBackendHandler
focal_class.interfaces: implements TextProtocolBackendHandler
focal_class.class_method_signature: ShardingCTLSetBackendHandler.ShardingCTLSetBackendHandler(final String sql, final BackendConnection backendConnection)
focal_class.full_signature: public  ShardingCTLSetBackendHandler(final String sql, final BackendConnection backendConnection)
focal_class.identifier: ShardingCTLSetBackendHandler
focal_class.modifiers: public
focal_class.parameters: (final String sql, final BackendConnection backendConnection)
focal_class.signature:  ShardingCTLSetBackendHandler(final String sql, final BackendConnection backendConnection)
focal_class.class_method_signature: ShardingCTLSetBackendHandler.execute()
focal_class.full_signature: @Override public BackendResponse execute()
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: BackendResponse
focal_class.signature: BackendResponse execute()
focal_class.class_method_signature: ShardingCTLSetBackendHandler.next()
focal_class.full_signature: @Override public boolean next()
focal_class.identifier: next
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean next()
focal_class.class_method_signature: ShardingCTLSetBackendHandler.getQueryData()
focal_class.full_signature: @Override public QueryData getQueryData()
focal_class.identifier: getQueryData
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: QueryData
focal_class.signature: QueryData getQueryData()
focal_method.body: @Override
      public BackendResponse execute() {
          Optional<ShardingCTLSetStatement> shardingTCLStatement = new ShardingCTLSetParser(sql).doParse();
          if (!shardingTCLStatement.isPresent()) {
              throw new InvalidShardingCTLFormatException(sql);
          }
          if ("TRANSACTION_TYPE".equals(shardingTCLStatement.get().getKey())) {
              if (null == backendConnection.getSchemaName()) {
                  throw new ShardingSphereException("Please select database, then switch transaction type.");
              }
              try {
                  backendConnection.getTransactionStatus().setTransactionType(TransactionType.valueOf(shardingTCLStatement.get().getValue()));
              } catch (final IllegalArgumentException ex) {
                  throw new UnsupportedShardingCTLTypeException(sql);
              }
          } else {
              throw new UnsupportedShardingCTLTypeException(sql);
          }
          return new UpdateResponse();
      }
focal_method.class_method_signature: ShardingCTLSetBackendHandler.execute()
focal_method.full_signature: @Override public BackendResponse execute()
focal_method.identifier: execute
focal_method.invocations: doParse isPresent equals getKey get getSchemaName setTransactionType getTransactionStatus valueOf getValue get
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: BackendResponse
focal_method.signature: BackendResponse execute()