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

First steps towards implementing the PostgreSQL protocol. #2491

Closed
wants to merge 1 commit into from

Conversation

bdarnell
Copy link
Contributor

Only supports simple queries with no placeholders. No support yet for
authentication or transactions.

Review on Reviewable

}
// size includes itself.
size -= 4
data := make([]byte, size)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we perform sanity checking on the value of 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.

Maybe, but what limit would we want? We don't have hard limits anywhere else (including in our rpc server). We can at least check that it's not negative.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We limit the size of keys and values at the KV layer. Perhaps some multiple of that.

@petermattis
Copy link
Collaborator

LGTM

Only supports simple queries with no placeholders. No support yet for
authentication or transactions.
err = c.handleParse(buf)

default:
log.Fatalf("unrecognized client message type %c", typ)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be a Fatal? Seems that it would crash the server based on a malformed client message, unless the resulting panic is being caught somewhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fatal doesn't panic, I believe it just calls os.Exit(something).
On Sep 14, 2015 2:01 PM, "mrtracy" notifications@github.com wrote:

In sql/pgwire/v3.go
#2491 (comment):

  •       return err
    
  •   }
    
  •   typ, msg, err := readTypedMsg(rd)
    
  •   if err != nil {
    
  •       return err
    
  •   }
    
  •   buf := bytes.NewBuffer(msg)
    
  •   switch typ {
    
  •   case clientMsgSimpleQuery:
    
  •       err = c.handleSimpleQuery(buf)
    
  •   case clientMsgParse:
    
  •       err = c.handleParse(buf)
    
  •   default:
    
  •       log.Fatalf("unrecognized client message type %c", typ)
    

Should this be a Fatal? Seems that it would crash the server based on a
malformed client message, unless the resulting panic is being caught
somewhere.


Reply to this email directly or view it on GitHub
https://github.com/cockroachdb/cockroach/pull/2491/files#r39425437.

@mberhault
Copy link
Contributor

Could you put a link to the spec somewhere in there? maybe a barebones readme?

@mberhault
Copy link
Contributor

LGTM. nice.
what's the plan for the startup message? postgres requires a user, and database defaults to user.
Will we decouple those and allow unspecified database?

@tamird
Copy link
Contributor

tamird commented Oct 29, 2015

Closing this since the work has been picked up by @petermattis in https://github.com/cockroachdb/cockroach/tree/pmattis/pgwire

@tamird tamird closed this Oct 29, 2015
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

5 participants