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: query parameters are not allowed to be included in where #67

Merged
merged 4 commits into from
Apr 24, 2019

Conversation

hoythan
Copy link
Contributor

@hoythan hoythan commented Apr 11, 2019

#66

不知道设计的初衷是什么?但这种情况确实是存在的且合理的。
当 查询条件等于某个值时,才允许修改某个值。

    if (column in options.where) {	
      continue;	
    }

如果有其他顾虑请告知。

@fengmk2
Copy link
Member

fengmk2 commented Apr 12, 2019

请补充一下bug场景,为什么这样会是bug。还有单元测试

@hoythan
Copy link
Contributor Author

hoythan commented Apr 12, 2019

使用场景请参考: #66
当数据表中的某个值符合某个条件时,再进行 SET 操作。

示例

userID key value
1 手机 iPhone
1 手机 mi
1 手机 Meizu

需要修改用户1的手机iPhoneiPhone Max
则 sql 语句为

UPDATE `user_meta` SET `value` = 'iPhone Max' WHERE `userID` = 1 AND `value` = 'iPhone';

这种情况下, SET 和 WHERE 中都会有 value

@fengmk2
Copy link
Member

fengmk2 commented Apr 12, 2019

将测试用例提交上来,让ci可以持续保证这个变更逻辑不会被随便改掉

@codecov
Copy link

codecov bot commented Apr 12, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@cbb8503). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #67   +/-   ##
=========================================
  Coverage          ?   97.92%           
=========================================
  Files             ?        6           
  Lines             ?      338           
  Branches          ?       53           
=========================================
  Hits              ?      331           
  Misses            ?        7           
  Partials          ?        0
Impacted Files Coverage Δ
lib/operator.js 100% <ø> (ø)

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 cbb8503...4456b09. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 12, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@cbb8503). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #67   +/-   ##
=========================================
  Coverage          ?   97.92%           
=========================================
  Files             ?        6           
  Lines             ?      338           
  Branches          ?       53           
=========================================
  Hits              ?      331           
  Misses            ?        7           
  Partials          ?        0
Impacted Files Coverage Δ
lib/operator.js 100% <ø> (ø)

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 cbb8503...150a81d. Read the comment docs.

@dead-horse
Copy link
Member

CI 我单独解决

@dead-horse dead-horse merged commit 52147de into ali-sdk:master Apr 24, 2019
@dead-horse
Copy link
Member

3.3.1

@fengmk2
Copy link
Member

fengmk2 commented Apr 25, 2019

有 bug,回滚到 3.3.0

@fengmk2
Copy link
Member

fengmk2 commented Apr 25, 2019

npm dist-tag ls
latest-2: 2.7.2
latest: 3.3.0

@hoythan
Copy link
Contributor Author

hoythan commented Apr 26, 2019

有 bug,回滚到 3.3.0

可能会造成哪些问题

fengmk2 pushed a commit to node-modules/rds that referenced this pull request Jan 30, 2024
[skip ci]

## 1.0.0 (2024-01-30)

### ⚠ BREAKING CHANGES

* In `Promise.all` case, Parallel beginTransactionScope will create isolated transactions.
* drop Node.js < 16 support

### Features

* add *beginTransactionScope(scope) ([0013a63](0013a63))
* add count(table, where) ([6286c46](6286c46))
* add get(), list(), insert(), update() ([9cae1cb](9cae1cb))
* add options.needFields, default is true ([18e0dea](18e0dea))
* add queryOne api ([ali-sdk#9](https://github.com/node-modules/myrds/issues/9)) ([19fc1bb](19fc1bb))
* add Transaction ([cfdcf26](cfdcf26))
* add unlock/lock tables ([ali-sdk#97](https://github.com/node-modules/myrds/issues/97)) ([4dc3452](4dc3452))
* add unlock/lock tables ([ali-sdk#97](https://github.com/node-modules/myrds/issues/97)) ([0a61be6](0a61be6))
* dynamic retrieval of database connection configuration ([ali-sdk#110](https://github.com/node-modules/myrds/issues/110)) ([f437efb](f437efb))
* export connection and query diagnostics_channel ([ali-sdk#111](https://github.com/node-modules/myrds/issues/111)) ([64aa75d](64aa75d))
* export sqlstring method ([ali-sdk#79](https://github.com/node-modules/myrds/issues/79)) ([2e99ab8](2e99ab8))
* impl with typescript ([ali-sdk#103](https://github.com/node-modules/myrds/issues/103)) ([1cf7814](1cf7814))
* promiseify ([ali-sdk#20](https://github.com/node-modules/myrds/issues/20)) ([e4aed30](e4aed30))
* stats 增加使用中的连接数 ([ali-sdk#115](https://github.com/node-modules/myrds/issues/115)) ([2b152a1](2b152a1))
* support custom query lifecricle ([ali-sdk#104](https://github.com/node-modules/myrds/issues/104)) ([5941c69](5941c69))
* support doomed transaction scope on test cases ([ali-sdk#58](https://github.com/node-modules/myrds/issues/58)) ([b227bc1](b227bc1))
* support end() ([b3eab93](b3eab93))
* support insert multi rows ([abb4804](abb4804))
* support mysql2 ([#1](#1)) ([eb9f391](eb9f391))
* support query(sql, object) ([ali-sdk#12](https://github.com/node-modules/myrds/issues/12)) ([a55e82f](a55e82f))
* support transaction on one request ctx ([ali-sdk#7](https://github.com/node-modules/myrds/issues/7)) ([3bd4e44](3bd4e44))
* update multiple rows ([ali-sdk#55](https://github.com/node-modules/myrds/issues/55)) ([859d818](859d818))
* use AsyncLocalStorage to refactor transaction, to make it more safe ([ali-sdk#108](https://github.com/node-modules/myrds/issues/108)) ([ae327fa](ae327fa))
* where condition support NULL value ([ali-sdk#60](https://github.com/node-modules/myrds/issues/60)) ([0d4d4ab](0d4d4ab))
* wrap generator function to promise ([ali-sdk#19](https://github.com/node-modules/myrds/issues/19)) ([fe1b4a3](fe1b4a3))

### Bug Fixes

* `where` with empty object ([ali-sdk#15](https://github.com/node-modules/myrds/issues/15)) ([db0b90e](db0b90e))
* add default value now() of `gmt_modified` and `gmt_create` ([ali-sdk#56](https://github.com/node-modules/myrds/issues/56)) ([db6d596](db6d596))
* don't export protected methods ([ali-sdk#106](https://github.com/node-modules/myrds/issues/106)) ([b2757df](b2757df))
* don't redefined sqlstring.escape ([ali-sdk#39](https://github.com/node-modules/myrds/issues/39)) ([5ca4489](5ca4489))
* export pool getter from rds client ([ali-sdk#102](https://github.com/node-modules/myrds/issues/102)) ([4048807](4048807))
* handle concurrent transaction ([ali-sdk#85](https://github.com/node-modules/myrds/issues/85)) ([d983478](d983478))
* move sql to error stack ([ali-sdk#8](https://github.com/node-modules/myrds/issues/8)) ([54349cd](54349cd))
* mysql type not found ([ali-sdk#109](https://github.com/node-modules/myrds/issues/109)) ([6a9bc45](6a9bc45))
* query parameters are not allowed to be included in where ([ali-sdk#67](https://github.com/node-modules/myrds/issues/67)) ([52147de](52147de))
* should export conn property ([ali-sdk#101](https://github.com/node-modules/myrds/issues/101)) ([37afa42](37afa42))
* support multi lifecricle hooks ([ali-sdk#105](https://github.com/node-modules/myrds/issues/105)) ([53b0a70](53b0a70))
* use master branch ([758877d](758877d))
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.

None yet

3 participants