Permalink
Browse files

fix #7

  • Loading branch information...
1 parent 364b33f commit 8a8656254af46898dc99a7065ba3fee92edd248d @hgourvest committed Sep 27, 2012
Showing with 25 additions and 6 deletions.
  1. +22 −3 lib/index.js
  2. +3 −3 test/test.js
View
@@ -298,6 +298,17 @@ const
isc_tpb_no_auto_undo = 20,
isc_tpb_lock_timeout = 21; // >= FB20
+/****************************/
+/* Common, structural codes */
+/****************************/
+const
+ isc_info_end = 1,
+ isc_info_truncated = 2,
+ isc_info_error = 3,
+ isc_info_data_not_ready = 4,
+ isc_info_length = 126,
+ isc_info_flag_end = 127;
+
/*************************/
/* SQL information items */
/*************************/
@@ -989,8 +1000,14 @@ function Database(connection) {
}
Database.prototype.detach = function(callback, error) {
- this.connection.detach(callback, error);
- this.connection.disconnect();
+ var self = this;
+ this.connection.detach(
+ function(obj) {
+ self.connection.disconnect();
+ doCallback(obj, callback, error)
+ }
+ );
+
};
Database.prototype.startTransaction = function(isolation, callback, error) {
@@ -1474,6 +1491,8 @@ function describe(ret, statement){
case isc_info_sql_relation_alias:
param.relationAlias = br.readString(DEFAULT_ENCODING);
break;
+ case isc_info_truncated:
+ throw new Error('truncated');
default:
finishDescribe = true;
br.pos--;
@@ -1502,7 +1521,7 @@ Connection.prototype.prepareStatement = function (transaction, statement, query,
msg.addInt(3); // dialect = 3
msg.addString(query, DEFAULT_ENCODING);
msg.addBlr(blr);
- msg.addInt(1024); // buffer_length
+ msg.addInt(65535); // buffer_length
this._queueEvent(function (ret) {
if (!ret.status){
View
@@ -2,8 +2,8 @@ fb = require("../lib");
repl = require("repl");
macdb = '/fbdata/test.fdb';
-windb = 'D:\\test\\test.fdb';
-db = macdb;
+windb = 'C:\\dev\\bases\\test.fdb';
+db = windb;
host = '127.0.0.1';
port = 3050;
@@ -154,6 +154,6 @@ repl.start("");
fb.attachOrCreate(host, port, db, user, password, pagesize,
function (db) {
database = db;
- test1()
+ test1();
}, logerror
);

0 comments on commit 8a86562

Please sign in to comment.