bytedance / bytedance/videx

Supporting Multiple MySQL/Percona Versions in C++ Plugin

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
149
Forks
27
PR merge metrics
No merged PRs in 30d

Description

## Background
Our C++ plugin needs to support different versions of MySQL and Percona Server.
Given the minor differences between MySQL/Percona across various versions, is there an elegant way to adapt the same code to different system versions without extensive code duplication?

Related: #9

## Proposed Solutions

### 1. Compile-time Version Control
```cpp
// Compile with: g++ -DMYSQL_VERSION="5.6" plugin.cpp
#if MYSQL_VERSION == "5.6"
// MySQL 5.6 specific code
#elif MYSQL_VERSION == "5.7"
// MySQL 5.7 specific code
#endif
```

### 2. Version-specific Headers
```cpp
// mysql_56/mysql_defs.h
// mysql_57/mysql_defs.h
// percona_56/mysql_defs.h
```

### 3. Directory Structure
```
src/
├── mysql/ # MySQL implementation
├── percona/ # Percona-specific changes
└── mariadb/ # Future MariaDB support (separate implementation)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the existing C++ plugin implementation, the version-related assumptions in plugin.cpp, and related issue #9. Compare the proposed compile-time, header, and directory approaches against the MySQL and Percona versions that must be supported. Done means a documented compatibility design with a clear path to supporting those versions without extensive duplication.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, mysql
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.