pike.git
/
lib
/
modules
/
Sql.pmod
/
mysql.pike
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Sql.pmod/mysql.pike:865:
//! and @[big_typed_query()]. //! //! @seealso //! @[big_typed_query()], @[streaming_typed_query()] { QUERY_BODY (streaming_typed_query); } array(string) list_dbs(string|void wild) {
-
return fix_result_charset(::list_dbs(
wild && fix_query_charset(wild
)
[0]
)
)
;
+
if (!wild) {
+
return fix_result_charset(::list_dbs());
}
-
+
return fix_result_charset(::list_dbs(fix_query_charset(wild)[0]));
+
}
array(string) list_tables(string|void wild) {
-
return fix_result_charset(::list_tables(
wild && fix_query_charset(wild
)
[0]
)
)
;
+
if (!wild) {
+
return fix_result_charset(::list_tables());
}
-
+
return fix_result_charset(::list_tables(fix_query_charset(wild)[0]));
+
}
array(mapping(string:mixed)) list_fields(string table, string|void wild) { if (!wild) { // Very common case. return fix_result_charset(::list_fields(fix_query_charset(table)[0])); } string table_and_wild = table + "\0\0PIKE\0\0" + wild; table_and_wild = fix_query_charset(table_and_wild)[0]; array(string) a = table_and_wild / "\0\0PIKE\0\0"; if (sizeof(a) == 2) { // Common case. return fix_result_charset(::list_fields(@a)); }
-
// Very uncommon
case
, but...
-
//
+
// Very uncommon
cases
, but...
+
+
if (sizeof(a) == 1) {
+
//
The split marker has been recoded.
+
// Assume that fix_query_charset() is stable.
+
return fix_result_charset(::list_fields(fix_query_charset(table)[0],
+
fix_query_charset(wild)[0]));
+
}
+
// Assume that the table name can not contain NUL characters. return fix_result_charset(::list_fields(a[0], a[1..] * "\0\0PIKE\0\0")); } int(0..1) is_keyword( string name ) //! Return 1 if the argument @[name] is a mysql keyword that needs to //! be quoted in a query. The list is currently up-to-date with MySQL //! 5.1. { return ([