gh-ost icon indicating copy to clipboard operation
gh-ost copied to clipboard

Add basic tests for applier

Open timvaillancourt opened this issue 3 years ago • 0 comments

Description

This PR adds basic tests to a few funcs from go/logic/applier.go, also two small fixes were made based on findings in testing

Details:

  • Added tests to func that don't use MySQL in go/logic/applier_test.go
  • Removed extra spaces in sql. BuildDMLUpdateQuery() from go/sql/builder.go
  • Modified applier.generateSqlModeQuery() to avoid duplicate commas:
    • Before example (double-comma):
      sql_mode = CONCAT(@@session.sql_mode, ',,NO_AUTO_VALUE_ON_ZERO')
      
    • After example:
      sql_mode = CONCAT(@@session.sql_mode, ',NO_AUTO_VALUE_ON_ZERO')
      

In case this PR introduced Go code changes:

  • [x] contributed code is using same conventions as original code
  • [x] script/cibuild returns with no formatting errors, build errors or unit test errors.

timvaillancourt avatar Aug 14 '22 20:08 timvaillancourt