Skip to content

Instantly share code, notes, and snippets.

@chadj
chadj / dbd_odbc_patch.rb
Created March 5, 2009 15:46
A monkey patch to fix how DBD::ODBC passes credentials to underlying DB driver
#
# Monkey patch DBD::ODBC to pass usernames and passwords along
# to the DB driver correctly
#
# Are you running a new version of DBI?
begin
require 'dbd/ODBC'
rescue Exception
end
[FreeTDS]
Description = FreeTDS unixODBC Driver
Driver = /usr/lib/libtdsodbc.so.0
Setup = /usr/lib/libtdsodbc.so.0
UsageCount = 1
# This file is installed by FreeTDS if no file by the same
# name is found in the installation directory.
#
# For information about the layout of this file and its settings,
# see the freetds.conf manpage "man freetds.conf".
# Global settings are overridden by those in a database
# server specific section
[global]
# TDS protocol version
require 'dbi'
require 'dbd_odbc_patch'
dbh = DBI.connect("dbi:ODBC:DRIVER=FreeTDS;SERVERNAME=dbservername;DATABASE=MyDBName", "username", "password")
sth = dbh.prepare("select 1")
sth.execute
while row=sth.fetch do
p row
end
/* $Id: dbdimp.c 12185 2008-12-19 19:39:22Z mjevans $
*
* portions Copyright (c) 1994,1995,1996,1997 Tim Bunce
* portions Copyright (c) 1997 Thomas K. Wenrich
* portions Copyright (c) 1997-2001 Jeff Urlwin
* portions Copyright (c) 2007-2008 Martin J. Evans
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the Perl README file.
*
--- ../ruby-odbc-0.9996/odbc.c 2009-02-02 12:06:38.000000000 -0600
+++ odbc.c 2009-03-12 11:43:38.000000000 -0500
@@ -166,6 +166,7 @@
SQLSMALLINT ctype;
SQLSMALLINT outtype;
int outsize;
+ int biggestparam;
char *outbuf;
} PINFO;
/*
Script output when run :
Success: http://feeds.feedburner.com/IrrationalBehavior
Success: http://feeds.feedburner.com/dancarlin/history?format=xml
Success: http://feeds.feedburner.com/diggnation
Success: http://feeds.feedburner.com/javaposse
Success: http://feeds.feedburner.com/TheHistoryOfRome
Success: http://feeds.feedburner.com/YouLookNiceToday
events:11
throw arguments[1];
^
Error: Parse Error
at Client.ondata (http:861:22)
at IOWatcher.callback (net:502:31)
Index: vendor/extensions/recommendations/app/views/admin/recommendations/available.js.erb
===================================================================
diff -u -N -r11137 -r11555
--- vendor/extensions/recommendations/app/views/admin/recommendations/available.js.erb (.../available.js.erb) (revision 11137)
+++ vendor/extensions/recommendations/app/views/admin/recommendations/available.js.erb (.../available.js.erb) (revision 11555)
@@ -21,9 +21,9 @@
<%= image_tag "spinner.gif", :style => "display:none", :id => "#{dom_id(recommendation, :spinner)}" %>
<%= link_to_remote icon('add') + ' ' + t('select'),
{:url => select_admin_product_recommendation_path(@product, recommendation),
- :loading => "$(#{dom_id(recommendation, :spinner)}).show();",
export PS1="\[\033[01;32m\]\u@\h \[\033[01;34m\]\w\[\033[00m\]\n\[\033[38;5;141m\]\$ \[\033[00m\]"