summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorunknown <malff/marcsql@weblab.(none)>2007-08-30 13:23:59 -0600
committerunknown <malff/marcsql@weblab.(none)>2007-08-30 13:23:59 -0600
commit89d3d585112fd71d62bcac511dab6530b6df793e (patch)
tree8a9eb637bc86a49e83f7ac315d1483f381fea0a2 /sql/sql_class.h
parent674f49f8f415c35b37660d85234e268bd3bd03ef (diff)
parent88cf551a16af65e6b5e1396a31447e9b38cd5519 (diff)
downloadmariadb-git-89d3d585112fd71d62bcac511dab6530b6df793e.tar.gz
Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into weblab.(none):/home/marcsql/TREE/mysql-5.1-rt50-merge client/mysql.cc: Auto merged mysql-test/r/query_cache.result: Auto merged mysql-test/t/query_cache.test: Auto merged sql/item_cmpfunc.h: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_db.cc: Auto merged sql/sql_handler.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_yacc.yy: Auto merged
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h39
1 files changed, 34 insertions, 5 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 7117c08a7e1..0a3aa3ed20c 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1802,11 +1802,27 @@ public:
}
}
- /*
- Initialize the current database from a NULL-terminated string with length
- If we run out of memory, we free the current database and return TRUE.
- This way the user will notice the error as there will be no current
- database selected (in addition to the error message set by malloc).
+ /**
+ Set the current database; use deep copy of C-string.
+
+ @param new_db a pointer to the new database name.
+ @param new_db_len length of the new database name.
+
+ Initialize the current database from a NULL-terminated string with
+ length. If we run out of memory, we free the current database and
+ return TRUE. This way the user will notice the error as there will be
+ no current database selected (in addition to the error message set by
+ malloc).
+
+ @note This operation just sets {thd->db, thd->db_length}. Switching the
+ current database usually involves other actions, like switching other
+ database attributes including security context. In the future, this
+ operation will be made private and more convenient interface will be
+ provided.
+
+ @return Operation status
+ @retval FALSE Success
+ @retval TRUE Out-of-memory error
*/
bool set_db(const char *new_db, size_t new_db_len)
{
@@ -1821,6 +1837,19 @@ public:
db_length= db ? new_db_len : 0;
return new_db && !db;
}
+
+ /**
+ Set the current database; use shallow copy of C-string.
+
+ @param new_db a pointer to the new database name.
+ @param new_db_len length of the new database name.
+
+ @note This operation just sets {thd->db, thd->db_length}. Switching the
+ current database usually involves other actions, like switching other
+ database attributes including security context. In the future, this
+ operation will be made private and more convenient interface will be
+ provided.
+ */
void reset_db(char *new_db, size_t new_db_len)
{
db= new_db;