Skip to content

Instantly share code, notes, and snippets.

View rkitover's full-sized avatar

Rafael Kitover rkitover

  • San Francisco, CA, United States
View GitHub Profile
if line('$') <= 5000
syn sync fromstart
else
syn sync minlines=0
endif
Oracle LOBs ReWork Stage 1: LOB Writes
- test deprecated Oracle LOB types such as LONG as well
- steal code from ASE for insert(bulk)/update LOB handling:
- insert:
- throw on lack of PK/UK
- replace LOB binds with \'EMPTY_BLOB()' or \'EMPTY_CLOB()'
- start txn
use strict;
use warnings;
use DeHawse;
my $app = DeHawse->apply_default_middlewares(DeHawse->psgi_app);
$app;
use strict;
use warnings;
use Grimlock;
my $app = Grimlock->apply_default_middlewares(Grimlock->psgi_app);
$app;
Index: lib/DBD/Oracle.pm
===================================================================
--- lib/DBD/Oracle.pm (revision 15190)
+++ lib/DBD/Oracle.pm (working copy)
@@ -753,7 +753,38 @@
}
}
$SQL .= " ORDER BY TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION\n";
- my $sth = $dbh->prepare( $SQL ) or return undef;
+
Index: lib/DBD/Oracle.pm
===================================================================
--- lib/DBD/Oracle.pm (revision 15190)
+++ lib/DBD/Oracle.pm (working copy)
@@ -753,7 +753,38 @@
}
}
$SQL .= " ORDER BY TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION\n";
- my $sth = $dbh->prepare( $SQL ) or return undef;
+
if [ -z "$APPDATA" ]; then
# ssh session, set env vars
# this from Corinna at http://cygwin.com/ml/cygwin/2010-08/msg00246.html
_sid=$(grep "^$USER:" /etc/passwd | sed -e 's/[^:]*:[^:]*:[^:]*:[^:]*:[^:]*,\(S-1-5-[^:]*\):.*/\1/')
_prof=$(cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows\ NT/CurrentVersion/ProfileList/${_sid}/ProfileImagePath)
export APPDATA="${_prof}\\AppData\\Roaming"
export LOCALAPPDATA="${_prof}\\AppData\\Local"
unset _sid
unset _prof
rkitover@eeebox ~/src/dbic patchsets/ribas_cherry % prove -wl t/746mssql.t
DBIx::Class::ResultSet::as_subselect_rs(): Unable to safely perform "skimming type" limit with supplied unstable order criteria at t/746mssql.t line 272
# Tests were run but no plan was declared and done_testing() was not seen.
t/746mssql.t ..
Dubious, test returned 255 (wstat 65280, 0xff00)
All 16 subtests passed
Test Summary Report
-------------------
t/746mssql.t (Wstat: 65280 Tests: 16 Failed: 0)
diff --git a/t/746mssql.t b/t/746mssql.t
index 6557d49..3dc602f 100644
--- a/t/746mssql.t
+++ b/t/746mssql.t
@@ -382,7 +382,7 @@ SQL
},
{
prefetch => 'books',
- order_by => { -asc => \['name + ?', [ test => 'xxx' ]] }, # test bindvar propagation
+ order_by => { -asc => [\['name + ?', [ test => 'xxx' ]],'id'] }, # test bindvar propagation
rkitover@eeebox ~/src/dbic patchsets/ribas_cherry % prove -wl t/746mssql.t
DBIx::Class::ResultSet::all(): DBI Exception: DBD::ODBC::st execute failed: [Microsoft][SQL Server Native Client 10.0]COUNT field incorrect or syntax error (SQL-07002) [for Statement "SELECT me.id, me.name, books.id, books.source, books.owner, books.title, books.price FROM (SELECT TOP 3 id, name, ORDER__BY__1 AS name + ? FROM ( SELECT TOP 3 me.id, me.name, name + ? AS ORDER__BY__1 FROM owners me LEFT JOIN books books ON books.owner = me.id WHERE ( ( books.id IS NOT NULL AND me.name != ? ) ) GROUP BY me.id, me.name ORDER BY name + ? ASC, me.id ) me ORDER BY ORDER__BY__1 ASC, me.id) me LEFT JOIN books books ON books.owner = me.id WHERE ( ( books.id IS NOT NULL AND me.name != ? ) ) ORDER BY name + ? ASC, me.id, books.owner" with ParamValues: 1='x.x.x.', 2='s.o.m.e.b.o.g.u.s.s.t.r.i.n.g.', 3='x.x.x.', 4='s.o.m.e.b.o.g.u.s.s.t.r.i.n.g.', 5='x.x.x.', 6=undef] at t/746mssql.t line 409
# Tests were run but no plan was declared and done_tes