mariano / node-db-mysql

MySQL database bindings for Node.js
http://nodejsdb.org
150 stars 30 forks source link

undefined argument in where clause causes terminate #63

Open IfpnI opened 12 years ago

IfpnI commented 12 years ago
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::replace
Aborted```

The following code triggers the bug:

new mysql.Database(mysqlOpts).connect (err, server) ->
  this.query('UPDATE table SET counter=counter+1 WHERE foo_id=? AND other_id=?',
                            [undefined, 1]
                            ).execute (err, result) ->
    console.log err, result

It seems related to the undefined argument, if it is a valid integer it is OK.