Revision 9578
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/sh/db.sh | ||
---|---|---|
92 | 92 |
fi # load new aliases |
93 | 93 |
if self_being_included; then |
94 | 94 |
|
95 |
mysql() # usage: [output_data=1] [data_only=1] mysql ... |
|
95 |
mysql() # usage: [output_data=1] [data_only=1] [log_queries=] mysql ...
|
|
96 | 96 |
{ |
97 |
echo_func; kw_params output_data data_only |
|
97 |
echo_func; kw_params output_data data_only query_verbosity
|
|
98 | 98 |
if test "$data_only"; then local output_data="${output_data-1}"; fi |
99 |
local log_queries="${log_queries-1}" |
|
99 | 100 |
set_database |
100 | 101 |
|
101 | 102 |
set -- ${database:+--database="$database" }--local-infile=1 \ |
102 | 103 |
--${data_only:+skip-}column-names "$@" |
103 | 104 |
if test "$output_data"; then echo_stdin|mysql_cmd --batch "$@" |
104 |
else cmd_log_fd=1 mysql_cmd --verbose "$@"
|
|
105 |
else cmd_log_fd=1 mysql_cmd ${log_queries:+--verbose }"$@"
|
|
105 | 106 |
fi |
106 | 107 |
} |
107 | 108 |
|
Also available in: Unified diff
lib/sh/db.sh: mysql(): added $log_queries flag, which can be turned off to avoid using --verbose. this is useful when running bulk INSERT statements.