Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Patch from Sannis

  • Loading branch information...
commit db395ae3d7b4c5309f532f69aa612da9d320d2d0 1 parent 1fffbfe
@masuidrive authored
Showing with 2 additions and 52 deletions.
  1. +1 −0  AUTHORS
  2. +0 −51 examples/speedtest.js~
  3. +1 −1  lib/mysql/node-socket.js
View
1  AUTHORS
@@ -3,3 +3,4 @@
Yuichiro MASUI <masui@masuidrive.jp>
Scott González <scott.gonzalez@gmail.com>
Delyan Angelov <delian66@gmail.com>
+Oleg Efimov <efimovov@gmail.com>
View
51 examples/speedtest.js~
@@ -1,51 +0,0 @@
-var
- sys = require("sys"),
- mysql = require('../lib/mysql');
-
-var puts = sys.puts;
-var inspect = sys.inspect;
-
-function readTest(db) {
- var t0 = new Date;
- var rows = 0;
- conn.query("SELECT * FROM t1;", function(result) {
- var d = ((new Date)-t0)/1000;
- puts("**** " + result.records.length + " rows in " + d + "s (" + (result.records.length/d) + "/s)");
-
- conn.close();
- });
-}
-
-function writeTest(db, i, callback) {
- conn.query("INSERT INTO t1 VALUES (1);", function (row) {
- if (!--i) {
- // end of results
- var dt = ((new Date)-t0)/1000;
- puts("**** " + count + " insertions in " + dt + "s (" + (count/dt) + "/s)");
-
- if (callback) callback(db);
- }
- else {
- writeTest(db, i--, callback);
- }
- });
-}
-
-var count = 100000;
-var t0;
-
-/*
-> mysql -u root
-CREATE DATABASE nodejs_mysql DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
-GRANT ALL ON nodejs_mysql.* TO nodejs_mysql@localhost IDENTIFIED BY "nodejs_mysql";
-*/
-var conn = new mysql.Connection('localhost','nodejs_mysql', 'nodejs_mysql', 'nodejs_mysql');
-conn.connect();
-
-conn.query("DROP TABLE t1;");
-
-conn.query("CREATE TABLE t1 (alpha INTEGER) TYPE=MEMORY;", function () {
- puts("create table callback" + inspect(arguments));
- t0 = new Date;
- writeTest(conn, count, readTest);
-});
View
2  lib/mysql/node-socket.js
@@ -2,7 +2,7 @@
// Append read() to tcp.Connection
//
var sys = require('sys');
-var tcp = require("tcp_old");
+var tcp = require("tcp");
var events = require("events");
var errors = require('./errors');
var utils = require('./utils');
Please sign in to comment.
Something went wrong with that request. Please try again.