1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-4328 There is a new option in both cpimport and cpimport.bin to asign

an owner for all data files created by cpimport

The patch consists of two parts: cpimport.bin changes, cpimport splitter
changes

cpimport.bin computes uid_t and gid_t early and propagates it down the stack
where MCS creates data files
This commit is contained in:
Roman Nozdrin
2020-10-01 12:19:32 +00:00
parent f584bab846
commit 328ae25650
19 changed files with 200 additions and 43 deletions

View File

@ -105,7 +105,8 @@ void printUsage()
" [-c readBufSize] [-e maxErrs] [-B libBufSize] [-n NullOption] " << endl <<
" [-E encloseChar] [-C escapeChar] [-I binaryOpt] [-S] "
"[-d debugLevel] [-i] " << endl <<
" [-D] [-N] [-L rejectDir] [-T timeZone]" << endl;
" [-D] [-N] [-L rejectDir] [-T timeZone]" << endl <<
" [-U username]" << endl << endl;
cout << endl << "Traditional usage without positional parameters "
"(XML job file required):" << endl <<
@ -115,7 +116,8 @@ void printUsage()
" [-E encloseChar] [-C escapeChar] [-I binaryOpt] [-S] "
"[-d debugLevel] [-i] " << endl <<
" [-p path] [-l loadFile]" << endl <<
" [-D] [-N] [-L rejectDir] [-T timeZone]" << endl << endl;
" [-D] [-N] [-L rejectDir] [-T timeZone]" << endl <<
" [-U username]" << endl << endl;
cout << " Positional parameters:" << endl <<
" dbName Name of database to load" << endl <<
@ -171,7 +173,8 @@ void printUsage()
" -K S3 Authentication Secret (for S3 imports)" << endl <<
" -t S3 Bucket (for S3 imports)" << endl <<
" -H S3 Hostname (for S3 imports, Amazon's S3 default)" << endl <<
" -g S3 Regions (for S3 imports)" << endl;
" -g S3 Regions (for S3 imports)" << endl <<
" -U username of new data files owner. Default is mysql" << endl;
cout << " Example1:" << endl <<
" cpimport.bin -j 1234" << endl <<
@ -322,7 +325,7 @@ void parseCmdLineArgs(
std::string jobUUID;
while ( (option = getopt(
argc, argv, "b:c:d:e:f:hij:kl:m:n:p:r:s:u:w:B:C:DE:I:P:R:ST:X:NL:y:K:t:H:g:")) != EOF )
argc, argv, "b:c:d:e:f:hij:kl:m:n:p:r:s:u:w:B:C:DE:I:P:R:ST:X:NL:y:K:t:H:g:U:")) != EOF )
{
switch (option)
{
@ -743,6 +746,11 @@ void parseCmdLineArgs(
break;
}
case 'U':
{
curJob.setUsername(optarg);
break;
}
default :
{
@ -1083,12 +1091,6 @@ int main(int argc, char** argv)
{
#ifdef _MSC_VER
_setmaxstdio(2048);
#else
// set effective ID to root
if( setuid( 0 ) < 0 )
{
std::cerr << " cpimport: couldn't set uid " << std::endl;
}
#endif
setupSignalHandlers();