# [faq] 查询报错 function READ ONLY has only noop implementation in tidb now, use tidb_enable_noop_functions to enable these functions

## Key Words

function READ ONLY, noop implementation, tidb_enable_noop_functions

## Issue

执行 SQL 查询报错  

```
Could not open JDBC Connection for transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: function READ ONLY has only noop implementation in tidb now, use tidb_enable_noop_functions to enable these functions
```

## Root Cause

一般 MySQL 中设置了 'read_only' 系统变量让系统变为只读模式。但在 TiDB 中，即便设置了这个变量，集群仍然是可写的。  
因此这个报错是为了显式提醒 'read_only' 变量在 TiDB 中并不真正生效。

## Diagnostic Steps

一般由 mysql 迁移过来的程序中设置了 READ ONLY 变量，或显式 `set global read_only=1;` 时，再执行 SQL 时会报错。

## Resolution

这个报错仅是一个提示。并不影响程序执行。
可以通过设置参数 `tidb_enable_noop_functions` 消除报错：  

```  
set global tidb_enable_noop_functions=1; 
```  

Tips：该变量只有在默认值 OFF 时，才算是安全的。因为设置 tidb_enable_noop_functions=1 后，TiDB 会自动忽略某些语法而不报错，这可能会导致应用程序出现异常行为。虽然允许使用语法 `START TRANSACTION READ ONLY`，但是事务仍会处于读写模式。
