You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FROM {$explicitDB[0]}..syscolumns a, {$explicitDB[0]}..systypes b, {$explicitDB[0]}..systypes s, {$explicitDB[0]}..systypes st
298
+
WHERE a.usertype = b.usertype
299
+
AND s.usertype = a.usertype
300
+
AND s.type = st.type
301
+
AND st.name not in ('timestamp', 'sysname', 'longsysname', 'nchar', 'nvarchar')
302
+
AND st.usertype < 100
303
+
AND object_name(a.id, db_id('{$explicitDB[0]}')) = '{$explicitDB[1]}'
304
+
QUERY;
305
+
} else {
306
+
return<<<QUERY
307
+
select a.name, st.name as type
308
+
FROM syscolumns a, systypes b, systypes s, systypes st
309
+
WHERE a.usertype = b.usertype
310
+
AND s.usertype = a.usertype
311
+
AND s.type = st.type
312
+
AND st.name not in ('timestamp', 'sysname', 'longsysname', 'nchar', 'nvarchar')
313
+
AND st.usertype < 100
314
+
AND object_name(a.id) = '{$table}'
315
+
QUERY;
316
+
}
317
+
}
318
+
300
319
/**
301
320
* Set new bindings with specified column types to Sybase
302
321
*
@@ -338,18 +357,12 @@ public function compileOffset($offset, $query, $bindings = array(), $me)
338
357
if (!isset($limit)) {
339
358
$limit = 999999999999999999999999999;
340
359
}
341
-
$explicitDB = explode('..', $from);
342
-
if (isset($explicitDB[1])) {
343
-
$identity = $this->getPdo()->query("select b.name as 'column' from ".$explicitDB[0]."..syscolumns AS b INNER JOIN ".$explicitDB[0]."..sysobjects AS a ON a.id = b.id WHERE status & 128 = 128 AND a.name ='".$explicitDB[1]."'")->fetchAll($me->getFetchMode())[0];
344
-
} else {
345
-
$identity = $this->getPdo()->query("select name as 'column' from syscolumns where status & 128 = 128 AND object_name(id)='".$from."'")->fetchAll($me->getFetchMode())[0];
$primaries = $this->getPdo()->query("SELECT index_col(".$from.", i.indid, c.colid) AS primary_key FROM ".$explicitDB[0]."..sysindexes i, ".$explicitDB[0]."..syscolumns c WHERE i.id = c.id AND c.colid <= i.keycnt AND i.id = object_id('".$from."')")->fetchAll($me->getFetchMode());
350
-
} else {
351
-
$primaries = $this->getPdo()->query("SELECT index_col(".$from.", i.indid, c.colid) AS primary_key FROM sysindexes i, syscolumns c WHERE i.id = c.id AND c.colid <= i.keycnt AND i.id = object_id('".$from."')")->fetchAll($me->getFetchMode());
0 commit comments