drizzle.dbi.lib.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Interface to the Drizzle extension
  5. *
  6. * WARNING - EXPERIMENTAL, never use in production,
  7. * drizzle module segfaults often and when you least expect it to
  8. *
  9. * TODO: This file and drizzle-wrappers.lib.php should be devoid
  10. * of any segault related hacks.
  11. * TODO: Crashing versions of drizzle module and/or libdrizzle
  12. * should be blacklisted
  13. *
  14. * @package PhpMyAdmin-DBI
  15. * @subpackage Drizzle
  16. */
  17. if (! defined('PHPMYADMIN')) {
  18. exit;
  19. }
  20. require_once './libraries/logging.lib.php';
  21. require_once './libraries/dbi/drizzle-wrappers.lib.php';
  22. /**
  23. * MySQL client API
  24. */
  25. if (!defined('PMA_MYSQL_CLIENT_API')) {
  26. define('PMA_MYSQL_CLIENT_API', (int)drizzle_version());
  27. }
  28. /**
  29. * Helper function for connecting to the database server
  30. *
  31. * @param PMA_Drizzle $drizzle connection handle
  32. * @param string $host Drizzle host
  33. * @param integer $port Drizzle port
  34. * @param string $uds server socket
  35. * @param string $user username
  36. * @param string $password password
  37. * @param string $db database name
  38. * @param integer $options connection options
  39. *
  40. * @return PMA_DrizzleCon
  41. */
  42. function PMA_DBI_real_connect($drizzle, $host, $port, $uds, $user, $password,
  43. $db = null, $options = DRIZZLE_CON_NONE
  44. ) {
  45. if ($uds) {
  46. $con = $drizzle->addUds($uds, $user, $password, $db, $options);
  47. } else {
  48. $con = $drizzle->addTcp($host, $port, $user, $password, $db, $options);
  49. }
  50. return $con;
  51. }
  52. /**
  53. * connects to the database server
  54. *
  55. * @param string $user drizzle user name
  56. * @param string $password drizzle user password
  57. * @param bool $is_controluser whether this is a control user connection
  58. * @param array $server host/port/socket/persistent
  59. * @param bool $auxiliary_connection (when true, don't go back to login if
  60. * connection fails)
  61. *
  62. * @return mixed false on error or a mysqli object on success
  63. */
  64. function PMA_DBI_connect($user, $password, $is_controluser = false,
  65. $server = null, $auxiliary_connection = false
  66. ) {
  67. global $cfg;
  68. if ($server) {
  69. $server_port = (empty($server['port']))
  70. ? false
  71. : (int)$server['port'];
  72. $server_socket = (empty($server['socket']))
  73. ? ''
  74. : $server['socket'];
  75. $server['host'] = (empty($server['host']))
  76. ? 'localhost'
  77. : $server['host'];
  78. } else {
  79. $server_port = (empty($cfg['Server']['port']))
  80. ? false
  81. : (int) $cfg['Server']['port'];
  82. $server_socket = (empty($cfg['Server']['socket']))
  83. ? null
  84. : $cfg['Server']['socket'];
  85. }
  86. if (strtolower($GLOBALS['cfg']['Server']['connect_type']) == 'tcp') {
  87. $GLOBALS['cfg']['Server']['socket'] = '';
  88. }
  89. $drizzle = new PMA_Drizzle();
  90. $client_flags = 0;
  91. /* Optionally compress connection */
  92. if ($GLOBALS['cfg']['Server']['compress']) {
  93. $client_flags |= DRIZZLE_CAPABILITIES_COMPRESS;
  94. }
  95. /* Optionally enable SSL */
  96. if ($GLOBALS['cfg']['Server']['ssl']) {
  97. $client_flags |= DRIZZLE_CAPABILITIES_SSL;
  98. }
  99. if (!$server) {
  100. $link = @PMA_DBI_real_connect(
  101. $drizzle, $cfg['Server']['host'], $server_port, $server_socket, $user,
  102. $password, false, $client_flags
  103. );
  104. // Retry with empty password if we're allowed to
  105. if ($link == false && isset($cfg['Server']['nopassword'])
  106. && $cfg['Server']['nopassword'] && !$is_controluser
  107. ) {
  108. $link = @PMA_DBI_real_connect(
  109. $drizzle, $cfg['Server']['host'], $server_port, $server_socket,
  110. $user, null, false, $client_flags
  111. );
  112. }
  113. } else {
  114. $link = @PMA_DBI_real_connect(
  115. $drizzle, $server['host'], $server_port, $server_socket,
  116. $user, $password
  117. );
  118. }
  119. if ($link == false) {
  120. if ($is_controluser) {
  121. trigger_error(
  122. __(
  123. 'Connection for controluser as defined'
  124. . ' in your configuration failed.'
  125. ),
  126. E_USER_WARNING
  127. );
  128. return false;
  129. }
  130. // we could be calling PMA_DBI_connect() to connect to another
  131. // server, for example in the Synchronize feature, so do not
  132. // go back to main login if it fails
  133. if (! $auxiliary_connection) {
  134. PMA_log_user($user, 'drizzle-denied');
  135. global $auth_plugin;
  136. $auth_plugin->authFails();
  137. } else {
  138. return false;
  139. }
  140. } else {
  141. PMA_DBI_postConnect($link, $is_controluser);
  142. }
  143. return $link;
  144. }
  145. /**
  146. * selects given database
  147. *
  148. * @param string $dbname database name to select
  149. * @param PMA_DrizzleCom $link connection object
  150. *
  151. * @return bool
  152. */
  153. function PMA_DBI_select_db($dbname, $link = null)
  154. {
  155. if (empty($link)) {
  156. if (isset($GLOBALS['userlink'])) {
  157. $link = $GLOBALS['userlink'];
  158. } else {
  159. return false;
  160. }
  161. }
  162. return $link->selectDb($dbname);
  163. }
  164. /**
  165. * runs a query and returns the result
  166. *
  167. * @param string $query query to execute
  168. * @param PMA_DrizzleCon $link connection object
  169. * @param int $options query options
  170. *
  171. * @return PMA_DrizzleResult
  172. */
  173. function PMA_DBI_real_query($query, $link, $options)
  174. {
  175. $buffer_mode = $options & PMA_DBI_QUERY_UNBUFFERED
  176. ? PMA_Drizzle::BUFFER_ROW
  177. : PMA_Drizzle::BUFFER_RESULT;
  178. $res = $link->query($query, $buffer_mode);
  179. return $res;
  180. }
  181. /**
  182. * returns array of rows with associative and numeric keys from $result
  183. *
  184. * @param PMA_DrizzleResult $result Drizzle result object
  185. *
  186. * @return array
  187. */
  188. function PMA_DBI_fetch_array($result)
  189. {
  190. return $result->fetchRow(PMA_Drizzle::FETCH_BOTH);
  191. }
  192. /**
  193. * returns array of rows with associative keys from $result
  194. *
  195. * @param PMA_DrizzleResult $result Drizzle result object
  196. *
  197. * @return array
  198. */
  199. function PMA_DBI_fetch_assoc($result)
  200. {
  201. return $result->fetchRow(PMA_Drizzle::FETCH_ASSOC);
  202. }
  203. /**
  204. * returns array of rows with numeric keys from $result
  205. *
  206. * @param PMA_DrizzleResult $result Drizzle result object
  207. *
  208. * @return array
  209. */
  210. function PMA_DBI_fetch_row($result)
  211. {
  212. return $result->fetchRow(PMA_Drizzle::FETCH_NUM);
  213. }
  214. /**
  215. * Adjusts the result pointer to an arbitrary row in the result
  216. *
  217. * @param PMA_DrizzleResult $result Drizzle result object
  218. * @param int $offset offset to seek
  219. *
  220. * @return boolean true on success, false on failure
  221. */
  222. function PMA_DBI_data_seek($result, $offset)
  223. {
  224. return $result->seek($offset);
  225. }
  226. /**
  227. * Frees memory associated with the result
  228. *
  229. * @param PMA_DrizzleResult $result database result
  230. *
  231. * @return void
  232. */
  233. function PMA_DBI_free_result($result)
  234. {
  235. if ($result instanceof PMA_DrizzleResult) {
  236. $result->free();
  237. }
  238. }
  239. /**
  240. * Check if there are any more query results from a multi query
  241. *
  242. * @return bool false
  243. */
  244. function PMA_DBI_more_results()
  245. {
  246. // N.B.: PHP's 'mysql' extension does not support
  247. // multi_queries so this function will always
  248. // return false. Use the 'mysqli' extension, if
  249. // you need support for multi_queries.
  250. return false;
  251. }
  252. /**
  253. * Prepare next result from multi_query
  254. *
  255. * @return bool false
  256. */
  257. function PMA_DBI_next_result()
  258. {
  259. // N.B.: PHP's 'mysql' extension does not support
  260. // multi_queries so this function will always
  261. // return false. Use the 'mysqli' extension, if
  262. // you need support for multi_queries.
  263. return false;
  264. }
  265. /**
  266. * Returns a string representing the type of connection used
  267. *
  268. * @param PMA_DrizzleCon $link connection object
  269. *
  270. * @return string type of connection used
  271. */
  272. function PMA_DBI_get_host_info($link = null)
  273. {
  274. if (null === $link) {
  275. if (isset($GLOBALS['userlink'])) {
  276. $link = $GLOBALS['userlink'];
  277. } else {
  278. return false;
  279. }
  280. }
  281. $str = $link->port()
  282. ? $link->host() . ':' . $link->port() . ' via TCP/IP'
  283. : 'Localhost via UNIX socket';
  284. return $str;
  285. }
  286. /**
  287. * Returns the version of the Drizzle protocol used
  288. *
  289. * @param PMA_DrizzleCon $link connection object
  290. *
  291. * @return int version of the Drizzle protocol used
  292. */
  293. function PMA_DBI_get_proto_info($link = null)
  294. {
  295. if (null === $link) {
  296. if (isset($GLOBALS['userlink'])) {
  297. $link = $GLOBALS['userlink'];
  298. } else {
  299. return false;
  300. }
  301. }
  302. return $link->protocolVersion();
  303. }
  304. /**
  305. * returns a string that represents the client library version
  306. *
  307. * @return string Drizzle client library version
  308. */
  309. function PMA_DBI_get_client_info()
  310. {
  311. return 'libdrizzle (Drizzle ' . drizzle_version() . ')';
  312. }
  313. /**
  314. * returns last error message or false if no errors occured
  315. *
  316. * @param PMA_DrizzleCon $link connection object
  317. *
  318. * @return string|bool $error or false
  319. */
  320. function PMA_DBI_getError($link = null)
  321. {
  322. $GLOBALS['errno'] = 0;
  323. /* Treat false same as null because of controllink */
  324. if ($link === false) {
  325. $link = null;
  326. }
  327. if (null === $link && isset($GLOBALS['userlink'])) {
  328. $link =& $GLOBALS['userlink'];
  329. // Do not stop now. We still can get the error code
  330. // with mysqli_connect_errno()
  331. // } else {
  332. // return false;
  333. }
  334. if (null !== $link) {
  335. $error_number = drizzle_con_errno($link->getConnectionObject());
  336. $error_message = drizzle_con_error($link->getConnectionObject());
  337. } else {
  338. $error_number = drizzle_errno();
  339. $error_message = drizzle_error();
  340. }
  341. if (0 == $error_number) {
  342. return false;
  343. }
  344. // keep the error number for further check after the call to PMA_DBI_getError()
  345. $GLOBALS['errno'] = $error_number;
  346. return PMA_DBI_formatError($error_number, $error_message);
  347. }
  348. /**
  349. * returns the number of rows returned by last query
  350. *
  351. * @param PMA_DrizzleResult $result Drizzle result object
  352. *
  353. * @return string|int
  354. */
  355. function PMA_DBI_num_rows($result)
  356. {
  357. // see the note for PMA_DBI_try_query();
  358. if (!is_bool($result)) {
  359. return @$result->numRows();
  360. } else {
  361. return 0;
  362. }
  363. }
  364. /**
  365. * returns last inserted auto_increment id for given $link or $GLOBALS['userlink']
  366. *
  367. * @param PMA_DrizzleCon $link connection object
  368. *
  369. * @return string|int
  370. */
  371. function PMA_DBI_insert_id($link = null)
  372. {
  373. if (empty($link)) {
  374. if (isset($GLOBALS['userlink'])) {
  375. $link = $GLOBALS['userlink'];
  376. } else {
  377. return false;
  378. }
  379. }
  380. // copied from mysql and mysqli
  381. // When no controluser is defined, using mysqli_insert_id($link)
  382. // does not always return the last insert id due to a mixup with
  383. // the tracking mechanism, but this works:
  384. return PMA_DBI_fetch_value('SELECT LAST_INSERT_ID();', 0, 0, $link);
  385. // Curiously, this problem does not happen with the mysql extension but
  386. // there is another problem with BIGINT primary keys so PMA_DBI_insert_id()
  387. // in the mysql extension also uses this logic.
  388. }
  389. /**
  390. * returns the number of rows affected by last query
  391. *
  392. * @param PMA_DrizzleResult $link connection object
  393. * @param bool $get_from_cache whether to retrieve from cache
  394. *
  395. * @return string|int
  396. */
  397. function PMA_DBI_affected_rows($link = null, $get_from_cache = true)
  398. {
  399. if (empty($link)) {
  400. if (isset($GLOBALS['userlink'])) {
  401. $link = $GLOBALS['userlink'];
  402. } else {
  403. return false;
  404. }
  405. }
  406. if ($get_from_cache) {
  407. return $GLOBALS['cached_affected_rows'];
  408. } else {
  409. return $link->affectedRows();
  410. }
  411. }
  412. /**
  413. * returns metainfo for fields in $result
  414. *
  415. * @param PMA_DrizzleResult $result Drizzle result object
  416. *
  417. * @return array meta info for fields in $result
  418. */
  419. function PMA_DBI_get_fields_meta($result)
  420. {
  421. // Build an associative array for a type look up
  422. $typeAr = array();
  423. /*$typeAr[DRIZZLE_COLUMN_TYPE_DECIMAL] = 'real';
  424. $typeAr[DRIZZLE_COLUMN_TYPE_NEWDECIMAL] = 'real';
  425. $typeAr[DRIZZLE_COLUMN_TYPE_BIT] = 'int';
  426. $typeAr[DRIZZLE_COLUMN_TYPE_TINY] = 'int';
  427. $typeAr[DRIZZLE_COLUMN_TYPE_SHORT] = 'int';
  428. $typeAr[DRIZZLE_COLUMN_TYPE_LONG] = 'int';
  429. $typeAr[DRIZZLE_COLUMN_TYPE_FLOAT] = 'real';
  430. $typeAr[DRIZZLE_COLUMN_TYPE_DOUBLE] = 'real';
  431. $typeAr[DRIZZLE_COLUMN_TYPE_NULL] = 'null';
  432. $typeAr[DRIZZLE_COLUMN_TYPE_TIMESTAMP] = 'timestamp';
  433. $typeAr[DRIZZLE_COLUMN_TYPE_LONGLONG] = 'int';
  434. $typeAr[DRIZZLE_COLUMN_TYPE_INT24] = 'int';
  435. $typeAr[DRIZZLE_COLUMN_TYPE_DATE] = 'date';
  436. $typeAr[DRIZZLE_COLUMN_TYPE_TIME] = 'date';
  437. $typeAr[DRIZZLE_COLUMN_TYPE_DATETIME] = 'datetime';
  438. $typeAr[DRIZZLE_COLUMN_TYPE_YEAR] = 'year';
  439. $typeAr[DRIZZLE_COLUMN_TYPE_NEWDATE] = 'date';
  440. $typeAr[DRIZZLE_COLUMN_TYPE_ENUM] = 'unknown';
  441. $typeAr[DRIZZLE_COLUMN_TYPE_SET] = 'unknown';
  442. $typeAr[DRIZZLE_COLUMN_TYPE_VIRTUAL] = 'unknown';
  443. $typeAr[DRIZZLE_COLUMN_TYPE_TINY_BLOB] = 'blob';
  444. $typeAr[DRIZZLE_COLUMN_TYPE_MEDIUM_BLOB] = 'blob';
  445. $typeAr[DRIZZLE_COLUMN_TYPE_LONG_BLOB] = 'blob';
  446. $typeAr[DRIZZLE_COLUMN_TYPE_BLOB] = 'blob';
  447. $typeAr[DRIZZLE_COLUMN_TYPE_VAR_STRING] = 'string';
  448. $typeAr[DRIZZLE_COLUMN_TYPE_VARCHAR] = 'string';
  449. $typeAr[DRIZZLE_COLUMN_TYPE_STRING] = 'string';
  450. $typeAr[DRIZZLE_COLUMN_TYPE_GEOMETRY] = 'geometry';*/
  451. $typeAr[DRIZZLE_COLUMN_TYPE_DRIZZLE_BLOB] = 'blob';
  452. $typeAr[DRIZZLE_COLUMN_TYPE_DRIZZLE_DATE] = 'date';
  453. $typeAr[DRIZZLE_COLUMN_TYPE_DRIZZLE_DATETIME] = 'datetime';
  454. $typeAr[DRIZZLE_COLUMN_TYPE_DRIZZLE_DOUBLE] = 'real';
  455. $typeAr[DRIZZLE_COLUMN_TYPE_DRIZZLE_ENUM] = 'unknown';
  456. $typeAr[DRIZZLE_COLUMN_TYPE_DRIZZLE_LONG] = 'int';
  457. $typeAr[DRIZZLE_COLUMN_TYPE_DRIZZLE_LONGLONG] = 'int';
  458. $typeAr[DRIZZLE_COLUMN_TYPE_DRIZZLE_MAX] = 'unknown';
  459. $typeAr[DRIZZLE_COLUMN_TYPE_DRIZZLE_NULL] = 'null';
  460. $typeAr[DRIZZLE_COLUMN_TYPE_DRIZZLE_TIMESTAMP] = 'timestamp';
  461. $typeAr[DRIZZLE_COLUMN_TYPE_DRIZZLE_TINY] = 'int';
  462. $typeAr[DRIZZLE_COLUMN_TYPE_DRIZZLE_VARCHAR] = 'string';
  463. // array of DrizzleColumn
  464. $columns = $result->getColumns();
  465. // columns in a standarized format
  466. $std_columns = array();
  467. foreach ($columns as $k => $column) {
  468. $c = new stdClass();
  469. $c->name = $column->name();
  470. $c->orgname = $column->origName();
  471. $c->table = $column->table();
  472. $c->orgtable = $column->origTable();
  473. $c->def = $column->defaultValue();
  474. $c->db = $column->db();
  475. $c->catalog = $column->catalog();
  476. // $column->maxSize() returns always 0 while size() seems
  477. // to return a correct value (drizzle extension v.0.5, API v.7)
  478. $c->max_length = $column->size();
  479. $c->decimals = $column->decimals();
  480. $c->charsetnr = $column->charset();
  481. $c->type = $typeAr[$column->typeDrizzle()];
  482. $c->_type = $column->type();
  483. $c->flags = PMA_DBI_field_flags($result, $k);
  484. $c->_flags = $column->flags();
  485. $c->multiple_key = (int) (bool) ($c->_flags & DRIZZLE_COLUMN_FLAGS_MULTIPLE_KEY);
  486. $c->primary_key = (int) (bool) ($c->_flags & DRIZZLE_COLUMN_FLAGS_PRI_KEY);
  487. $c->unique_key = (int) (bool) ($c->_flags & DRIZZLE_COLUMN_FLAGS_UNIQUE_KEY);
  488. $c->not_null = (int) (bool) ($c->_flags & DRIZZLE_COLUMN_FLAGS_NOT_NULL);
  489. $c->unsigned = (int) (bool) ($c->_flags & DRIZZLE_COLUMN_FLAGS_UNSIGNED);
  490. $c->zerofill = (int) (bool) ($c->_flags & DRIZZLE_COLUMN_FLAGS_ZEROFILL);
  491. $c->numeric = (int) (bool) ($c->_flags & DRIZZLE_COLUMN_FLAGS_NUM);
  492. $c->blob = (int) (bool) ($c->_flags & DRIZZLE_COLUMN_FLAGS_BLOB);
  493. $std_columns[] = $c;
  494. }
  495. return $std_columns;
  496. }
  497. /**
  498. * return number of fields in given $result
  499. *
  500. * @param PMA_DrizzleResult $result Drizzle result object
  501. *
  502. * @return int field count
  503. */
  504. function PMA_DBI_num_fields($result)
  505. {
  506. return $result->numColumns();
  507. }
  508. /**
  509. * returns the length of the given field $i in $result
  510. *
  511. * @param PMA_DrizzleResult $result Drizzle result object
  512. * @param int $i field
  513. *
  514. * @return int length of field
  515. */
  516. function PMA_DBI_field_len($result, $i)
  517. {
  518. $colums = $result->getColumns();
  519. return $colums[$i]->size();
  520. }
  521. /**
  522. * returns name of $i. field in $result
  523. *
  524. * @param PMA_DrizzleResult $result Drizzle result object
  525. * @param int $i field
  526. *
  527. * @return string name of $i. field in $result
  528. */
  529. function PMA_DBI_field_name($result, $i)
  530. {
  531. $colums = $result->getColumns();
  532. return $colums[$i]->name();
  533. }
  534. /**
  535. * returns concatenated string of human readable field flags
  536. *
  537. * @param PMA_DrizzleResult $result Drizzle result object
  538. * @param int $i field
  539. *
  540. * @return string field flags
  541. */
  542. function PMA_DBI_field_flags($result, $i)
  543. {
  544. $columns = $result->getColumns();
  545. $f = $columns[$i];
  546. $type = $f->typeDrizzle();
  547. $charsetnr = $f->charset();
  548. $f = $f->flags();
  549. $flags = '';
  550. if ($f & DRIZZLE_COLUMN_FLAGS_UNIQUE_KEY) {
  551. $flags .= 'unique ';
  552. }
  553. if ($f & DRIZZLE_COLUMN_FLAGS_NUM) {
  554. $flags .= 'num ';
  555. }
  556. if ($f & DRIZZLE_COLUMN_FLAGS_PART_KEY) {
  557. $flags .= 'part_key ';
  558. }
  559. if ($f & DRIZZLE_COLUMN_FLAGS_SET) {
  560. $flags .= 'set ';
  561. }
  562. if ($f & DRIZZLE_COLUMN_FLAGS_TIMESTAMP) {
  563. $flags .= 'timestamp ';
  564. }
  565. if ($f & DRIZZLE_COLUMN_FLAGS_AUTO_INCREMENT) {
  566. $flags .= 'auto_increment ';
  567. }
  568. if ($f & DRIZZLE_COLUMN_FLAGS_ENUM) {
  569. $flags .= 'enum ';
  570. }
  571. // See http://dev.mysql.com/doc/refman/6.0/en/c-api-datatypes.html:
  572. // to determine if a string is binary, we should not use MYSQLI_BINARY_FLAG
  573. // but instead the charsetnr member of the MYSQL_FIELD
  574. // structure. Watch out: some types like DATE returns 63 in charsetnr
  575. // so we have to check also the type.
  576. // Unfortunately there is no equivalent in the mysql extension.
  577. if (($type == DRIZZLE_COLUMN_TYPE_DRIZZLE_BLOB
  578. || $type == DRIZZLE_COLUMN_TYPE_DRIZZLE_VARCHAR)
  579. && 63 == $charsetnr
  580. ) {
  581. $flags .= 'binary ';
  582. }
  583. if ($f & DRIZZLE_COLUMN_FLAGS_ZEROFILL) {
  584. $flags .= 'zerofill ';
  585. }
  586. if ($f & DRIZZLE_COLUMN_FLAGS_UNSIGNED) {
  587. $flags .= 'unsigned ';
  588. }
  589. if ($f & DRIZZLE_COLUMN_FLAGS_BLOB) {
  590. $flags .= 'blob ';
  591. }
  592. if ($f & DRIZZLE_COLUMN_FLAGS_MULTIPLE_KEY) {
  593. $flags .= 'multiple_key ';
  594. }
  595. if ($f & DRIZZLE_COLUMN_FLAGS_UNIQUE_KEY) {
  596. $flags .= 'unique_key ';
  597. }
  598. if ($f & DRIZZLE_COLUMN_FLAGS_PRI_KEY) {
  599. $flags .= 'primary_key ';
  600. }
  601. if ($f & DRIZZLE_COLUMN_FLAGS_NOT_NULL) {
  602. $flags .= 'not_null ';
  603. }
  604. return trim($flags);
  605. }
  606. /**
  607. * Store the result returned from multi query
  608. *
  609. * @return false
  610. */
  611. function PMA_DBI_store_result()
  612. {
  613. return false;
  614. }
  615. ?>