MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / create_database

Function create_database

src/gpre/cmd.cpp:1339–1404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1337//
1338
1339static void create_database( gpre_req* request, const act* action)
1340{
1341 const gpre_dbb* db = ((mdbb*) action->act_object)->mdbb_database;
1342 request->add_byte(isc_dpb_version1);
1343 request->add_byte(isc_dpb_overwrite);
1344 request->add_byte(1);
1345 request->add_byte(0);
1346
1347 request->add_byte(isc_dpb_sql_dialect);
1348 request->add_byte(sizeof(int));
1349 int def_db_dial = 3;
1350 if (gpreGlob.dialect_specified && (gpreGlob.sw_sql_dialect == 1 || gpreGlob.sw_sql_dialect == 3))
1351 def_db_dial = gpreGlob.sw_sql_dialect;
1352 request->add_long(def_db_dial);
1353
1354#ifdef NOT_USED_OR_REPLACED
1355 if (db->dbb_allocation)
1356 {
1357 request->add_byte(isc_dpb_allocation);
1358 request->add_byte(4);
1359 request->add_long(db->dbb_allocation);
1360 }
1361#endif
1362
1363 if (db->dbb_pagesize)
1364 {
1365 request->add_byte(isc_dpb_page_size);
1366 request->add_byte(4);
1367 request->add_long(db->dbb_pagesize);
1368 }
1369
1370 if (db->dbb_buffercount)
1371 {
1372 request->add_byte(isc_dpb_num_buffers);
1373 request->add_byte(4);
1374 request->add_long(db->dbb_buffercount);
1375 }
1376
1377 SSHORT l;
1378
1379 if (db->dbb_c_user && !db->dbb_r_user)
1380 {
1381 request->add_byte(isc_dpb_user_name);
1382 l = static_cast<SSHORT>(strlen(db->dbb_c_user));
1383 request->add_byte(l);
1384 const char* ch = db->dbb_c_user;
1385 while (*ch)
1386 request->add_byte(*ch++);
1387 }
1388
1389 if (db->dbb_c_password && !db->dbb_r_password)
1390 {
1391 request->add_byte(isc_dpb_password);
1392 l = static_cast<SSHORT>(strlen(db->dbb_c_password));
1393 request->add_byte(l);
1394 const char* ch = db->dbb_c_password;
1395 while (*ch)
1396 request->add_byte(*ch++);

Callers 2

restore_databaseMethod · 0.85
CMD_compile_ddlFunction · 0.85

Calls 2

add_byteMethod · 0.45
add_longMethod · 0.45

Tested by

no test coverage detected