Rate This Document
Findability
Accuracy
Completeness
Readability

Checking SQL Compatibility and Viewing the Function Points Corresponding to Incompatible SQL Statements

The RuoYi application used in this practice involves more than 100 SQL statements. As an example, only three types of incompatibility issues (four SQL statements in total) are selected for reconstruction.

Source File

Source

SQL Statement ID

Incompatible SQL Statements Extracted by the DevKit

Incompatibility Type

ruoyi-system/src/main/resources/mapper/system/SysUserOnlineMapper.xml

mapper xml

saveOnline

replace into sys_user_online(sessionId, login_name, dept_name, ipaddr, login_location, browser, os, status, start_timestamp, last_access_time, expire_time) values (A, A, A, A, A, A, A, A, A, A, A);

DM8 does not support the replace into method.

ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.xml

mapper xml

selectNoticeById

select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark from sys_notice where notice_id = 1;

The cast function in DM8 cannot convert the BLOB type to the String type.

mapper xml

selectNoticeList

select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark from sys_notice where notice_title like 'A'('%', 'A', '%') and notice_type = 'A' and create_by like 'A'('%', 'A', '%');

The cast function in DM8 cannot convert the BLOB type to the String type.

ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml

mapper xml

selectDbTableList

select table_name, table_comment, create_time, update_time from information_schema.tables where table_schema = (select database()) AND table_name NOT LIKE 'qrtz\_%' AND table_name NOT LIKE 'gen\_%' AND table_name NOT IN (select table_name from gen_table) AND lower(table_name) like lower(concat('%', 'A', '%')) AND lower(table_comment) like lower(concat('%', 'A', '%')) order by create_time desc;

DM8 does not have database tables provided by MySQL, such as information_schema.

The preceding incompatible SQL statements can be found in SQL Migration Report > View Details on the migration result page of the DevKit. For example, click View Details to check the last SQL statement:

In the details, find the SQL statement whose id is selectDbTableList, and move the cursor to the yellow wavy line to view the SQL statement extracted and combined by the tool. Click Copy SQL extraction statement to quickly copy the SQL statement.

Checking SQL Incompatibility Issues

  1. Open the DM management tool on the desktop, create a connection, enter the database connection information, and test the connection.

  2. Create a query and set Schema Name to ry.

  3. Copy the SQL statements in the preceding table to the query window, click the green arrow to execute the statements, and view the error information.

Viewing the RuoYi Function Point Errors Caused by Three Types of Incompatibility Issues

  • DM8 does not support the replace into method.

    How the error is triggered: After a user logs in to RuoYi, an error is reported in the background.

  • The cast function in DM8 cannot convert the BLOB type to the String type.

    How the error is triggered: A user starts the application, logs in to the RuoYi WebUI, and chooses System Management > Notice.

  • DM8 does not have database tables provided by MySQL, such as information_schema.

    How the error is triggered: A user logs in to RuoYi and chooses System Tools > Code Generation > Import.