Skip to content

Commit

Permalink
fix: added check for prisma prepare statement matching (#1990)
Browse files Browse the repository at this point in the history
Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>
Co-authored-by: Sarthak Shyngle <50234097+Sarthak160@users.noreply.github.com>
  • Loading branch information
PranshuSrivastava and Sarthak160 committed Jun 25, 2024
1 parent 8728c43 commit c74f290
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/core/proxy/integrations/postgres/v1/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func getRecordPrepStatement(allMocks []*models.Mock) PrepMap {
p := 0
for _, header := range req.PacketTypes {
if header == "P" {
if strings.Contains(req.Parses[p].Name, "S_") {
if strings.Contains(req.Parses[p].Name, "S_") || strings.Contains(req.Parses[p].Name, "s") {
psMap[req.Parses[p].Query] = req.Parses[p].Name
querydata = append(querydata, QueryData{PrepIdentifier: req.Parses[p].Name,
Query: req.Parses[p].Query,
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/proxy/integrations/postgres/v1/match.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func getTestPS(reqBuff [][]byte, logger *zap.Logger, ConnectionID string) {
p := 0
for _, header := range actualPgReq.PacketTypes {
if header == "P" {
if strings.Contains(actualPgReq.Parses[p].Name, "S_") && !IsValuePresent(ConnectionID, actualPgReq.Parses[p].Name) {
if (strings.Contains(actualPgReq.Parses[p].Name, "S_") || strings.Contains(actualPgReq.Parses[p].Name, "s")) && !IsValuePresent(ConnectionID, actualPgReq.Parses[p].Name) {
querydata = append(querydata, QueryData{PrepIdentifier: actualPgReq.Parses[p].Name, Query: actualPgReq.Parses[p].Query})
}
p++
Expand Down

0 comments on commit c74f290

Please sign in to comment.