summaryrefslogtreecommitdiff
path: root/adodb-lib.inc.php
diff options
context:
space:
mode:
authorMarat <vanilla-thunder@users.noreply.github.com>2016-05-18 16:42:41 +0200
committerDamien Regad <dregad@mantisbt.org>2019-12-30 00:59:50 +0100
commit84eef2cb39e1da925977aef70e8ec2a0cf6ae005 (patch)
treea41a313b5c86231e83f0fe761680beaa5687b338 /adodb-lib.inc.php
parent127dd199cad830c88f4fcc39ad4cd8cc760ee5ba (diff)
downloadadodb-84eef2cb39e1da925977aef70e8ec2a0cf6ae005.tar.gz
adodb-84eef2cb39e1da925977aef70e8ec2a0cf6ae005.tar.bz2
adodb-84eef2cb39e1da925977aef70e8ec2a0cf6ae005.zip
Support for T-SQL-styled square Brackets
Microsoft wraps column names in square brackets in T-SQL statements, which is not really obligatory but becomes necessary when reserved keywords are used as columns names (e.g. 'BEGIN' or 'CURRENT'). Fixes #246 Signed-off-by: Damien Regad <dregad@mantisbt.org> Original commits from PR squashed and message reworded.
Diffstat (limited to 'adodb-lib.inc.php')
-rw-r--r--adodb-lib.inc.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/adodb-lib.inc.php b/adodb-lib.inc.php
index 444ac04a..443d0d86 100644
--- a/adodb-lib.inc.php
+++ b/adodb-lib.inc.php
@@ -696,6 +696,8 @@ function _adodb_getupdatesql(&$zthis,&$rs, $arrFields,$forceUpdate=false,$magicq
if ((strpos($upperfname,' ') !== false) || ($ADODB_QUOTE_FIELDNAMES)) {
switch ($ADODB_QUOTE_FIELDNAMES) {
+ case 'BRACKETS':
+ $fnameq = $zthis->leftBracket.$upperfname.$zthis->rightBracket;break;
case 'LOWER':
$fnameq = $zthis->nameQuote.strtolower($field->name).$zthis->nameQuote;break;
case 'NATIVE':
@@ -880,6 +882,8 @@ static $cacheCols;
$bad = false;
if ((strpos($upperfname,' ') !== false) || ($ADODB_QUOTE_FIELDNAMES)) {
switch ($ADODB_QUOTE_FIELDNAMES) {
+ case 'BRACKETS':
+ $fnameq = $zthis->leftBracket.$upperfname.$zthis->rightBracket;break;
case 'LOWER':
$fnameq = $zthis->nameQuote.strtolower($field->name).$zthis->nameQuote;break;
case 'NATIVE':