Commit afb33c17 authored by Taylor Otwell's avatar Taylor Otwell

Fix bug with table prefix and columns.

parent 91a6cb88
...@@ -89,9 +89,18 @@ abstract class Grammar { ...@@ -89,9 +89,18 @@ abstract class Grammar {
// Since columns may be prefixed with their corresponding table // Since columns may be prefixed with their corresponding table
// name so as to not make them ambiguous, we will need to wrap // name so as to not make them ambiguous, we will need to wrap
// the table and the column in keyword identifiers. // the table and the column in keyword identifiers.
foreach (explode('.', $value) as $segment) $segments = explode('.', $value);
foreach ($segments as $key => $value)
{
if ($key == 0 and count($segments) > 1)
{ {
$wrapped[] = $this->wrap_value($segment); $wrapped[] = $this->wrap_table($value);
}
else
{
$wrapped[] = $this->wrap_value($value);
}
} }
return implode('.', $wrapped); return implode('.', $wrapped);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment