19 var
$_genIDSQL =
"update %s set id=LAST_INSERT_ID(id+1);";
27 $parentDriver->hasTransactions =
false;
28 #$parentDriver->_bindInputArray = false; 29 $parentDriver->hasInsertID =
true;
30 $parentDriver->_connectionID->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,
true);
38 $fraction = $dayFraction * 24 * 3600;
39 return $date .
' + INTERVAL ' . $fraction.
' SECOND';
47 $arr = func_get_args();
50 $s = implode(
',',$arr);
51 if (strlen($s) > 0)
return "CONCAT($s)";
return '';
56 $arr[
'description'] = ADOConnection::GetOne(
"select version()");
57 $arr[
'version'] = ADOConnection::_findvers($arr[
'description']);
61 function MetaTables($ttype=
false,$showSchema=
false,$mask=
false)
64 if ($showSchema && is_string($showSchema)) {
65 $this->metaTablesSQL .=
" from $showSchema";
69 $mask = $this->qstr($mask);
70 $this->metaTablesSQL .=
" like $mask";
72 $ret = ADOConnection::MetaTables($ttype,$showSchema);
74 $this->metaTablesSQL = $save;
80 $this->_transmode = $transaction_mode;
81 if (empty($transaction_mode)) {
82 $this->Execute(
'SET TRANSACTION ISOLATION LEVEL REPEATABLE READ');
85 if (!stristr($transaction_mode,
'isolation')) $transaction_mode =
'ISOLATION LEVEL '.$transaction_mode;
86 $this->Execute(
"SET SESSION TRANSACTION ".$transaction_mode);
91 $this->_findschema($table,$schema);
94 $this->SelectDB($schema);
96 global $ADODB_FETCH_MODE;
97 $save = $ADODB_FETCH_MODE;
98 $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
100 if ($this->fetchMode !==
false) $savem = $this->SetFetchMode(
false);
101 $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
104 $this->SelectDB($dbName);
107 if (isset($savem)) $this->SetFetchMode($savem);
108 $ADODB_FETCH_MODE = $save;
109 if (!is_object(
$rs)) {
116 $fld =
new ADOFieldObject();
117 $fld->name =
$rs->fields[0];
118 $type =
$rs->fields[1];
122 if (preg_match(
"/^(.+)\((\d+),(\d+)/", $type, $query_array)) {
123 $fld->type = $query_array[1];
124 $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
125 $fld->scale = is_numeric($query_array[3]) ? $query_array[3] : -1;
126 } elseif (preg_match(
"/^(.+)\((\d+)/", $type, $query_array)) {
127 $fld->type = $query_array[1];
128 $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
129 } elseif (preg_match(
"/^(enum)\((.*)\)$/i", $type, $query_array)) {
130 $fld->type = $query_array[1];
131 $arr = explode(
",",$query_array[2]);
133 $zlen = max(array_map(
"strlen",$arr)) - 2;
134 $fld->max_length = ($zlen > 0) ? $zlen : 1;
137 $fld->max_length = -1;
139 $fld->not_null = (
$rs->fields[2] !=
'YES');
140 $fld->primary_key = (
$rs->fields[3] ==
'PRI');
141 $fld->auto_increment = (strpos(
$rs->fields[5],
'auto_increment') !==
false);
142 $fld->binary = (strpos($type,
'blob') !==
false);
143 $fld->unsigned = (strpos($type,
'unsigned') !==
false);
147 if ($d !=
'' && $d !=
'NULL') {
148 $fld->has_default =
true;
149 $fld->default_value = $d;
151 $fld->has_default =
false;
155 if ($save == ADODB_FETCH_NUM) {
158 $retarr[strtoupper($fld->name)] = $fld;
171 $offsetStr =($offset>=0) ?
"$offset," :
'';
173 if ($nrows < 0) $nrows =
'18446744073709551615';
176 $rs = $this->CacheExecute($secs,
$sql.
" LIMIT $offsetStr$nrows",$inputarr);
178 $rs = $this->Execute(
$sql.
" LIMIT $offsetStr$nrows",$inputarr);
MetaColumns($table, $normalize=true)
if(isset($_REQUEST['nrows'])) else $rs
SelectLimit($sql, $nrows=-1, $offset=-1, $inputarr=false, $secs=0)
SetTransactionMode( $transaction_mode)
OffsetDate($dayFraction, $date=false)
MetaTables($ttype=false, $showSchema=false, $mask=false)