Fix column length mismatch: wr_sqlstat_view.SOURCE_IP is varchar(65) vs OB golden varchar(46)
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 339
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 52
Description
Description
In the wr.wr_sqlstat_view, the SOURCE_IP column is defined as varchar(65), which does not match the OceanBase golden standard definition of varchar(46).
Actual Behavior:
The column is varchar(65).

Expected Behavior:
The column should be varchar(46) to align with the golden standard.

Steps to Reproduce
- Access the machine.
- Navigate to the directory:
/obdata/data/AndroidTest/ob_opensource_test/tools/deploy.

- Execute the following commands to set up the test environment and run the specific mysqltest:
export OCEANBASE_HOME=/obdata/data/AndroidTest/ob_opensource_test/
cd ${OCEANBASE_HOME}/tools/deploy
source activate_obd.sh
export OBD_SEEKDB_STATUS_FALLBACK_TCP=1
obd test mysqltest test_env --mysqltest-bin=${OCEANBASE_HOME}/deps/3rd/u01/obclient/bin/mysqltest --obclient-bin=${OCEANBASE_HOME}/deps/3rd/u01/obclient/bin/obclient --init-only --init-sql-dir=${OCEANBASE_HOME}/tools/deploy --init-sql-files='init.sql,init_user.sql|root@sys|test'
obd test mysqltest test_env --mysqltest-bin=${OCEANBASE_HOME}/deps/3rd/u01/obclient/bin/mysqltest --obclient-bin=${OCEANBASE_HOME}/deps/3rd/u01/obclient/bin/obclient --disable-reboot --test-set=wr.wr_sqlstat_view
- Connect to the database (using the same connection method and user as the test case:
root@sys, databaseOceanbase) and run the following SQL to inspect the column definitions:
-- Connection method and user same as test case: root@sys, database Oceanbase
USE Oceanbase;
SHOW TENANT;
DESC __all_virtual_sqlstat;
DESC v$ob_sqlstat;
DESC gv$ob_sqlstat;
DESC __wr_sqlstat;
DESC __wr_sqltext;
DESC DBA_WR_SQLSTAT;
DESC CDB_WR_SQLSTAT;
DESC DBA_WR_SQLTEXT;
DESC CDB_WR_SQLTEXT;
The discrepancy in the SOURCE_IP column length for wr.wr_sqlstat_view will be observed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the wr.wr_sqlstat_view definition and the wr.wr_sqlstat_view mysqltest named in the issue. Inspect the SOURCE_IP column alongside the OceanBase golden definition, then run the provided mysqltest setup and test commands. Done means SOURCE_IP is reported as varchar(46) and the test passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100