Skip to content

Commit

Permalink
add --with-build-string
Browse files Browse the repository at this point in the history
  • Loading branch information
tony2001 committed Nov 11, 2015
1 parent 90dd8e7 commit 06f730d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
16 changes: 16 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,22 @@ AC_ARG_WITH(histogram-size,
)
dnl }}}

dnl {{{ --with-build-string
AC_ARG_WITH(build-string,
[AS_HELP_STRING([--with-build-string],[set custom build information here])
],
[
dq="\""
ws=" "
if test "${with_build_string#*$ws}" != "$with_build_string" || test "${with_build_string#*$dq}" != "$with_build_string"; then
AC_MSG_ERROR([Build string cannot contain whitespaces or double quotes])
fi
AC_DEFINE_UNQUOTED([PINBA_BUILD_STRING], "$with_build_string", [custom build string])
],
[ ]
)
dnl }}}

AC_SUBST(INSTALL_STRIP_FLAG)

AC_SUBST(DEPS_LIBS)
Expand Down
3 changes: 2 additions & 1 deletion default_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -520,5 +520,6 @@ CREATE TABLE `status` (
`current_timer_pool_size` int(11) NOT NULL,
`lost_tmp_records` int(11) NOT NULL,
`invalid_packets` int(11) NOT NULL,
`invalid_request_data` int(11) NOT NULL
`invalid_request_data` int(11) NOT NULL,
`build_string` varchar(256) DEFAULT NULL
) ENGINE=PINBA DEFAULT CHARSET=latin1 COMMENT='status';
6 changes: 6 additions & 0 deletions src/ha_pinba.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5665,6 +5665,12 @@ inline int ha_pinba::status_fetch_row(unsigned char *buf) /* {{{ */
(*field)->store((long)D->stats.invalid_request_data);
pthread_rwlock_unlock(&D->stats_lock);
break;
case 5: /* build string */
#ifdef PINBA_ENGINE_PINBA_BUILD_STRING
(*field)->set_notnull();
(*field)->store((const char *)PINBA_ENGINE_PINBA_BUILD_STRING, strlen((char *)PINBA_ENGINE_PINBA_BUILD_STRING), &my_charset_bin);
#endif
break;
}
}
}
Expand Down

0 comments on commit 06f730d

Please sign in to comment.