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
Copy file name to clipboardExpand all lines: Database/SybaseConnection.php
+10-5Lines changed: 10 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -104,8 +104,8 @@ private function compileForSelect(Builder $builder, $bindings) {
104
104
105
105
$explicitDB = explode('..', $tables);
106
106
if(isset($explicitDB[1])){
107
-
$queryRes = $this->getPdo()->query("select b.name, c.name AS type from".$explicitDB[0]."..sysobjects a noholdlock JOIN ".$explicitDB[0]."..syscolumns b noholdlock ON a.id = b.id JOIN ".$explicitDB[0]."..systypes c noholdlock ON b.usertype = c.usertype and a.name = '".$explicitDB[1]."'");
108
-
}else{
107
+
$queryRes = $this->getPdo()->query("select a.name, b.name AS type FROM".$explicitDB[0]."..syscolumns a noholdlock JOIN ".$explicitDB[0]."..systypes b noholdlock ON a.usertype = b.usertype and object_name(a.id, db_id('".$explicitDB[0]."')) = '".$explicitDB[1]."'");
108
+
}else{
109
109
$queryRes = $this->getPdo()->query("select a.name, b.name AS type FROM syscolumns a noholdlock JOIN systypes b noholdlock ON a.usertype = b.usertype and object_name(a.id) = '".$tables."'");
110
110
}
111
111
@@ -185,7 +185,7 @@ private function compileBindings($query, $bindings)
@@ -206,7 +206,12 @@ private function compileBindings($query, $bindings)
206
206
$table = $campos;
207
207
}
208
208
if(!array_key_exists($table, $new_format)){
209
-
$queryRes = $this->getPdo()->query("select a.name, b.name AS type FROM syscolumns a noholdlock JOIN systypes b noholdlock ON a.usertype = b.usertype and object_name(a.id) = '".$table."'");
209
+
$explicitDB = explode('..', $table);
210
+
if(isset($explicitDB[1])){
211
+
$queryRes = $this->getPdo()->query("select a.name, b.name AS type FROM ".$explicitDB[0]."..syscolumns a noholdlock JOIN ".$explicitDB[0]."..systypes b noholdlock ON a.usertype = b.usertype and object_name(a.id, db_id('".$explicitDB[0]."')) = '".$explicitDB[1]."'");
212
+
}else{
213
+
$queryRes = $this->getPdo()->query("select a.name, b.name AS type FROM syscolumns a noholdlock JOIN systypes b noholdlock ON a.usertype = b.usertype and object_name(a.id) = '".$table."'");
0 commit comments