OQL: Fixed a number of bugs, and implemented new features

- bug: a JOIN b on b.extkey = a.id
- bug: operators precedence (still a shift-reduce conflict with JOINS)
- changed pkey into id (preserved the compatibility for DBObjectSearch::AddCondition()
- allow implicit class name in WHERE condition
- bug: wrong report on typo error
- suggest an alternative in case of typo error

SVN:code[12]
This commit is contained in:
Romain Quetiez
2009-03-27 14:36:14 +00:00
parent a0f4fdb130
commit 8d9ea9dcdd
15 changed files with 989 additions and 612 deletions

View File

@@ -42,7 +42,7 @@ function ShowClass($sClass, $sBaseArgs)
$aProps["Subclasses (children + pure PHP)"] = sexyclasslist(MetaModel::GetSubclasses($sClass), $sBaseArgs);
$aProps["Description"] = MetaModel::GetClassDescription($sClass);
$aProps["Autoincrement pkey?"] = MetaModel::IsAutoIncrementKey($sClass);
$aProps["Autoincrement id?"] = MetaModel::IsAutoIncrementKey($sClass);
$aProps["Key label"] = MetaModel::GetKeyLabel($sClass);
$aProps["Name attribute"] = MetaModel::GetNameAttributeCode($sClass);
$aProps["Reconciliation keys"] = implode(", ", MetaModel::GetReconcKeys($sClass));
@@ -188,7 +188,8 @@ function DebugQuery($sConfigFile)
echo "<h1>Follow up the query build</h1>\n";
MetaModel::StartDebugQuery();
$oFlt = DBObjectSearch::FromSibuSQL($sQuery);
$oFlt = DBObjectSearch::FromOQL($sQuery);
echo "<p>To OQL: ".$oFlt->ToOQL()."</p>";
$sSQL = MetaModel::MakeSelectQuery($oFlt);
MetaModel::StopDebugQuery();