user->get_info().user_email = "tester@ceph.com";
RGWAccessKey k1("0555b35654ad1656d804", "h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q==");
user->get_info().access_keys["0555b35654ad1656d804"] = k1;
+ user->get_info().max_buckets = RGW_DEFAULT_MAX_BUCKETS;
int r = user->store_user(dpp, null_yield, true);
if (r < 0) {
/* XXX: handle delete_children */
+ if (!delete_children) {
+ /* Check if there are any objects */
+ rgw::sal::Bucket::ListParams params;
+ params.list_versions = true;
+ params.allow_unordered = true;
+
+ rgw::sal::Bucket::ListResults results;
+
+ results.objs.clear();
+
+ ret = list(dpp, params, 2, results, null_yield);
+
+ if (ret < 0) {
+ ldpp_dout(dpp, 20) << __func__ << ": Bucket list objects returned " <<
+ ret << dendl;
+ return ret;
+ }
+
+ if (!results.objs.empty()) {
+ ret = -ENOTEMPTY;
+ ldpp_dout(dpp, -1) << __func__ << ": Bucket Not Empty.. returning " <<
+ ret << dendl;
+ return ret;
+ }
+ }
+
ret = store->getDB()->remove_bucket(dpp, info);
return ret;
#define SQL_BIND_TEXT(dpp, stmt, index, str, sdb) \
do { \
- rc = sqlite3_bind_text(stmt, index, str, -1, SQLITE_TRANSIENT); \
+ if (strcmp(str, "null") == 0) { \
+ rc = sqlite3_bind_text(stmt, index, "", -1, SQLITE_TRANSIENT); \
+ } else { \
+ rc = sqlite3_bind_text(stmt, index, str, -1, SQLITE_TRANSIENT); \
+ } \
\
if (rc != SQLITE_OK) { \
ldpp_dout(dpp, 0)<<"sqlite bind text failed for index(" \