MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / load_src

Function load_src

lua/sp.c:1766–1795  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1764}
1765
1766static char *load_src(char *spname, struct spversion_t *spversion,
1767 int bootstrap, char **err)
1768{
1769 char *src, *sys_src;
1770 int size;
1771 char *override = NULL;
1772 if (IS_SYS(spname)) {
1773 sys_src = find_syssp(spname, &override);
1774 if (sys_src == NULL) {
1775 *err = no_such_procedure(spname, spversion);
1776 return NULL;
1777 }
1778 if (override && (src = load_user_src(override, spversion, bootstrap, err))) {
1779 return src;
1780 }
1781
1782 size = strlen(sys_src) + 1;
1783 if (bootstrap) {
1784 char *bsrc = malloc(size + sizeof(bootstrap_src));
1785 strcpy(bsrc, sys_src);
1786 strcat(bsrc, bootstrap_src);
1787 return bsrc;
1788 } else {
1789 return strdup(sys_src);
1790 }
1791 }
1792
1793 src = load_user_src(spname, spversion, bootstrap, err);
1794 return src;
1795}
1796
1797static int load_debugging_information(struct stored_proc *sp, char **err)
1798{

Callers 3

db_spFunction · 0.85
setup_sp_intFunction · 0.85

Calls 5

find_sysspFunction · 0.85
no_such_procedureFunction · 0.85
load_user_srcFunction · 0.85
mallocFunction · 0.85
strdupFunction · 0.50

Tested by

no test coverage detected