Skip to content

[Bug] Doris 2.1.11版本,jdbc客户端设置useCursorFetch=true时,stmt.getMetaData()返回null #59037

@Lif0820

Description

@Lif0820

Search before asking

  • I had searched in the issues and found no similar issues.

Version

2.1.11

What's Wrong?

我们一直使用embulk-input-mysql组件抽取doris数据到hdfs,近期将doris从2.0.7升级到2.1.11后,此功能全部出错。报错显示PreparedStatement.getMetaData()返回null。

经过调试源码,发现可能与数据库useCursorFetch、useServerPrepStmts行为有关,以下Java代码可以复现该问题:

public class Aaa {
	public static void main(String[] args) throws Exception {
		Properties props = new Properties();
		props.put("characterEncoding", "UTF-8");
		props.put("useServerPrepStmts", "false");
		props.put("useCursorFetch", "true");  // 关键点
		props.put("useSSL", "false");
		props.put("useUnicode", "true");
		props.put("serverTimezone", "Asia/Shanghai");

		props.put("user", "bdp");
		props.put("password", "bdp");
		Connection con1 = DriverManager.getConnection("jdbc:mysql://10.66.224.223:9030/clw", props);
		Connection con2 = DriverManager.getConnection("jdbc:mysql://10.66.110.166:19030/clw", props);
		Connection con3 = DriverManager.getConnection("jdbc:mysql://10.66.110.16:9030/db_es", props);
		System.out.println(con1.prepareStatement("select 1").getMetaData() == null); // doris-2.1.11  true
		System.out.println(con2.prepareStatement("select 1").getMetaData() == null); // doris-2.0.7   false
		System.out.println(con3.prepareStatement("select 1").getMetaData() == null); // doris-4.0.1   false
	}
}

What You Expected?

定位错误并解决

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions