Skip to content

Fix missing AND keyword in JDBCEBPFProfilingTaskDAO.getTaskRecord() SQL#13789

Merged
wu-sheng merged 4 commits intoapache:masterfrom
currenjin:fix/jdbc-ebpf-profiling-task-missing-and-keyword
Apr 4, 2026
Merged

Fix missing AND keyword in JDBCEBPFProfilingTaskDAO.getTaskRecord() SQL#13789
wu-sheng merged 4 commits intoapache:masterfrom
currenjin:fix/jdbc-ebpf-profiling-task-missing-and-keyword

Conversation

@currenjin
Copy link
Copy Markdown
Contributor

Fix missing and keyword in JDBCEBPFProfilingTaskDAO.getTaskRecord()

  • Add a unit test to verify the fix.
  • Update the CHANGES log.

JDBCEBPFProfilingTaskDAO.getTaskRecord() builds a SQL query with two WHERE conditions (table_column and logical_id), but the and keyword between them was missing.

The generated SQL looked like:

select * from ebpf_profiling_task where table_column = ?logical_id = ?

This is a SQL syntax error. Every call to getTaskRecord() fails at the database level.

Fix

Added the missing and between the two conditions:

// Before
" where " + JDBCTableInstaller.TABLE_COLUMN + " = ?" +
    EBPFProfilingTaskRecord.LOGICAL_ID + " = ?";

// After
" where " + JDBCTableInstaller.TABLE_COLUMN + " = ? and " +
    EBPFProfilingTaskRecord.LOGICAL_ID + " = ?";
  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.

@currenjin currenjin force-pushed the fix/jdbc-ebpf-profiling-task-missing-and-keyword branch from e7f0a48 to a203816 Compare April 3, 2026 23:48
The SQL query in getTaskRecord() was missing the 'and' keyword between
the table_column and logical_id conditions, producing invalid SQL like:
  WHERE table_column = ?logical_id = ?
which causes a syntax error on every invocation.
Verify that the generated SQL contains a valid WHERE clause with the AND
keyword between the table_column and logical_id conditions, and that the
id parameter is correctly bound.
@currenjin currenjin force-pushed the fix/jdbc-ebpf-profiling-task-missing-and-keyword branch from a203816 to bf8eea0 Compare April 3, 2026 23:49
@wu-sheng wu-sheng requested review from Copilot and mrproliu and removed request for Copilot April 3, 2026 23:50
@wu-sheng wu-sheng added this to the 10.5.0 milestone Apr 3, 2026
@wu-sheng wu-sheng added bug Something isn't working and you are sure it's a bug! backend OAP backend related. labels Apr 3, 2026
mrproliu
mrproliu previously approved these changes Apr 4, 2026
@wu-sheng
Copy link
Copy Markdown
Member

wu-sheng commented Apr 4, 2026

@currenjin Thanks for finding these bugs. Curiously, are you going to deploy skywalking in some product env by using SQL DB? As I noticed, you are focusing on SQL-kind things.

@wu-sheng wu-sheng merged commit 1b66915 into apache:master Apr 4, 2026
418 of 421 checks passed
@currenjin currenjin deleted the fix/jdbc-ebpf-profiling-task-missing-and-keyword branch April 4, 2026 09:06
@currenjin
Copy link
Copy Markdown
Contributor Author

@wu-sheng Thanks for asking.
Yes, I’m considering SQL-based storage for real deployment scenarios, so I started from JDBC paths first.
I focused on small fixes that are easy to reproduce and verify with tests, and I’ll keep expanding to other areas as I get deeper into the codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend OAP backend related. bug Something isn't working and you are sure it's a bug!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants