Abnormality in Presto Reading TiDB

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: Presto读Tidb异常

| username: TiDBer_pFFcXLgY

Does Presto support reading TiDB (v5.1.3)?
When using Presto to simply select a single table from TiDB, the following error occurs:
function READ ONLY has only noop implementation in tidb now, use tidb_enable_noop_functions to enable these functions.

| username: forever | Original post link

Try enabling the tidb_enable_noop_functions parameter.

| username: hey-hoho | Original post link

tidb_enable_noop_functions Introduced from version v4.0

  • Scope: SESSION | GLOBAL
  • Default value: OFF
  • By default, TiDB will report an error when users attempt to use certain syntax for unimplemented features. If this variable is set to ON, TiDB will automatically ignore such unavailable features without reporting an error. If users cannot change the SQL code, they may consider setting this variable to ON.
  • Enabling noop functions can control the following behaviors:
    • get_lock and release_lock functions
    • LOCK IN SHARE MODE syntax
    • SQL_CALC_FOUND_ROWS syntax
    • CREATE TEMPORARY TABLE syntax
    • DROP TEMPORARY TABLE syntax
    • START TRANSACTION READ ONLY and SET TRANSACTION READ ONLY syntax
    • tx_read_only, transaction_read_only, offline_mode, super_read_only, and read_only system variables

Warning

This variable is only considered safe when the default value is OFF. Because setting tidb_enable_noop_functions=1 will cause TiDB to automatically ignore certain syntax without reporting an error, this may lead to abnormal behavior in applications. For example, when allowing the syntax START TRANSACTION READ ONLY, the transaction will still be in read-write mode.

| username: Running | Original post link

Support the original poster’s approach.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.