Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix possible extra comma before where statement in MySQL backend #1924

Merged
merged 3 commits into from
Jul 19, 2022

Conversation

javeme
Copy link
Contributor

@javeme javeme commented Jul 7, 2022

fix #1923
Change-Id: I095311942c3633a5978930e35fecd9fd47b08796

javeme added 3 commits July 7, 2022 15:46
fix #1923
Change-Id: I095311942c3633a5978930e35fecd9fd47b08796
Change-Id: Ic36ee61dbeb420abbd7881196e323a3997c3385b
Change-Id: I6ece79c77dde6f1e514f9a3475f6d4b59c3e0de6
@codecov
Copy link

codecov bot commented Jul 7, 2022

Codecov Report

Merging #1924 (30c7618) into master (6861f12) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master    #1924      +/-   ##
============================================
+ Coverage     70.48%   70.49%   +0.01%     
+ Complexity      976      724     -252     
============================================
  Files           452      452              
  Lines         38982    38980       -2     
  Branches       5554     5554              
============================================
+ Hits          27477    27480       +3     
+ Misses         8810     8805       -5     
  Partials       2695     2695              
Impacted Files Coverage Δ
...aidu/hugegraph/backend/store/mysql/MysqlTable.java 83.45% <100.00%> (-0.08%) ⬇️
...u/hugegraph/backend/tx/SchemaIndexTransaction.java 72.72% <0.00%> (-6.82%) ⬇️
...hugegraph/backend/serializer/BinarySerializer.java 85.56% <0.00%> (ø)
...va/com/baidu/hugegraph/util/collection/IntMap.java 72.80% <0.00%> (+0.39%) ⬆️
...va/com/baidu/hugegraph/backend/cache/RamCache.java 72.77% <0.00%> (+0.55%) ⬆️
...egraph/backend/store/cassandra/CassandraShard.java 54.54% <0.00%> (+1.81%) ⬆️
...om/baidu/hugegraph/api/filter/ExceptionFilter.java 60.57% <0.00%> (+3.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6861f12...30c7618. Read the comment docs.

for (HugeKeys key : entry.columns().keySet()) {
if (idNames.contains(key)) {
size--;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: the id key may be the last key

update.append(", ");
}
update.append(formatKey(key));
update.append("=?");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could add a uri example to diff the logic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SQL example:
UPDATE il SET INDEX_TYPE=21, FIELDS='[76]', STATUS=4, USER_DATA='xx', BASE_VALUE=16, NAME='personByAge', BASE_TYPE=1, WHERE ID=1
=>
UPDATE il SET INDEX_TYPE=21, FIELDS='[76]', STATUS=4, USER_DATA='xx', BASE_VALUE=16, NAME='personByAge', BASE_TYPE=1 WHERE ID=1

@javeme javeme merged commit 7274a5f into master Jul 19, 2022
@javeme javeme deleted the pg-where-comma-fix branch July 19, 2022 03:25
@javeme javeme changed the title fix possible extra comma before where statement fix possible extra comma before where statement in MySQL backend Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] 'BASE_TYPE=1, WHERE ID=1' was aborted: ERROR: syntax error at or near "WHERE"
3 participants