boostcampwm-2021/web14-salondesrefuses

[BUG] 옥션 히스토리 group by 쿼리쪽 에러

Alencion opened this issue · 0 comments

📃 버그 내용

옥션 히스토리 group by 쿼리쪽 에러

스크린샷

query failed: SELECT `auctionHistory`.`id` AS `auctionHistory_id`, `auctionHistory`.`bidder_id` AS `auctionHistory_bidder_id`, `auctionHistory`.`price` AS `auctionHistory_price`, `auctionHistory`.`bidded_at` AS `auctionHistory_bidded_at`, `auctionHistory`.`auction_id` A
S `auctionHistory_auction_id`, `auction`.`id` AS `auction_id`, `auction`.`start_at` AS `auction_start_at`, `auction`.`end_at` AS `auction_end_at`, `auction`.`is_complete` AS `auction_is_complete`, `auction`.`seller_id` AS `auction_seller_id`, `auction`.`artwork_id` AS `
auction_artwork_id`, `artwork`.`id` AS `artwork_id`, `artwork`.`title` AS `artwork_title`, `artwork`.`type` AS `artwork_type`, `artwork`.`year` AS `artwork_year`, `artwork`.`price` AS `artwork_price`, `artwork`.`description` AS `artwork_description`, `artwork`.`status`
AS `artwork_status`, `artwork`.`cid` AS `artwork_cid`, `artwork`.`nft_token` AS `artwork_nft_token`, `artwork`.`original_image` AS `artwork_original_image`, `artwork`.`cropped_image` AS `artwork_cropped_image`, `artwork`.`exhibition_id` AS `artwork_exhibition_id`, `artw
ork`.`artist_id` AS `artwork_artist_id`, `artwork`.`owner_id` AS `artwork_owner_id` FROM `auction_history` `auctionHistory` INNER JOIN `auction` `auction` ON `auction`.`id`=`auctionHistory`.`auction_id`  INNER JOIN `artwork` `artwork` ON `artwork`.`id`=`auction`.`artwor
k_id` WHERE `auctionHistory`.`bidder_id` = ? GROUP BY `artwork`.`id` -- PARAMETERS: [19]
error: Error: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'salondesrefuses.auctionHistory.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
    at Packet.asError (/root/web14/server/node_modules/mysql2/lib/packets/packet.js:728:17)
    at Query.execute (/root/web14/server/node_modules/mysql2/lib/commands/command.js:29:26)
    at PoolConnection.handlePacket (/root/web14/server/node_modules/mysql2/lib/connection.js:456:32)
    at PacketParser.onPacket (/root/web14/server/node_modules/mysql2/lib/connection.js:85:12)
    at PacketParser.executeStart (/root/web14/server/node_modules/mysql2/lib/packet_parser.js:75:16)
    at Socket.<anonymous> (/root/web14/server/node_modules/mysql2/lib/connection.js:92:25)
    at Socket.emit (events.js:400:28)
    at Socket.emit (domain.js:475:12)
    at addChunk (internal/streams/readable.js:293:12)
    at readableAddChunk (internal/streams/readable.js:267:9) {
  code: 'ER_WRONG_FIELD_WITH_GROUP',
  errno: 1055,
  sqlState: '42000',
  sqlMessage: "Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'salondesrefuses.auctionHistory.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by",
  sql: 'SELECT `auctionHistory`.`id` AS `auctionHistory_id`, `auctionHistory`.`bidder_id` AS `auctionHistory_bidder_id`, `auctionHistory`.`price` AS `auctionHistory_price`, `auctionHistory`.`bidded_at` AS `auctionHistory_bidded_at`, `auctionHistory`.`auction_id` AS `auc
tionHistory_auction_id`, `auction`.`id` AS `auction_id`, `auction`.`start_at` AS `auction_start_at`, `auction`.`end_at` AS `auction_end_at`, `auction`.`is_complete` AS `auction_is_complete`, `auction`.`seller_id` AS `auction_seller_id`, `auction`.`artwork_id` AS `auctio
n_artwork_id`, `artwork`.`id` AS `artwork_id`, `artwork`.`title` AS `artwork_title`, `artwork`.`type` AS `artwork_type`, `artwork`.`year` AS `artwork_year`, `artwork`.`price` AS `artwork_price`, `artwork`.`description` AS `artwork_description`, `artwork`.`status` AS `ar
twork_status`, `artwork`.`cid` AS `artwork_cid`, `artwork`.`nft_token` AS `artwork_nft_token`, `artwork`.`original_image` AS `artwork_original_image`, `artwork`.`cropped_image` AS `artwork_cropped_image`, `artwork`.`exhibition_id` AS `artwork_exhibition_id`, `artwork`.`
artist_id` AS `artwork_artist_id`, `artwork`.`owner_id` AS `artwork_owner_id` FROM `auction_history` `auctionHistory` INNER JOIN `auction` `auction` ON `auction`.`id`=`auctionHistory`.`auction_id`  INNER JOIN `artwork` `artwork` ON `artwork`.`id`=`auction`.`artwork_id`
WHERE `auctionHistory`.`bidder_id` = 19 GROUP BY `artwork`.`id`'
}
[Nest] 25483  - 11/18/2021, 11:16:41 PM   ERROR [ExceptionsHandler] Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'salondesrefuses.auctionHistory.id' which is not functionally dependent on column
s in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
QueryFailedError: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'salondesrefuses.auctionHistory.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
    at QueryFailedError.TypeORMError [as constructor] (/root/web14/server/node_modules/typeorm/error/TypeORMError.js:9:28)
    at new QueryFailedError (/root/web14/server/node_modules/typeorm/error/QueryFailedError.js:13:28)
    at Query.onResult (/root/web14/server/node_modules/typeorm/driver/mysql/MysqlQueryRunner.js:222:57)
    at Query.execute (/root/web14/server/node_modules/mysql2/lib/commands/command.js:36:14)
    at PoolConnection.handlePacket (/root/web14/server/node_modules/mysql2/lib/connection.js:456:32)
    at PacketParser.onPacket (/root/web14/server/node_modules/mysql2/lib/connection.js:85:12)
    at PacketParser.executeStart (/root/web14/server/node_modules/mysql2/lib/packet_parser.js:75:16)
    at Socket.<anonymous> (/root/web14/server/node_modules/mysql2/lib/connection.js:92:25)
    at Socket.emit (events.js:400:28)
    at Socket.emit (domain.js:475:12)