You've already forked mariadb-columnstore-engine
							
							
				mirror of
				https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
				synced 2025-10-30 07:25:34 +03:00 
			
		
		
		
	* MSan added with fixes for libc++ * libc++ sepatare build * add libc++ to ci * libstdc++ in CI * libcpp and msan to external projects * std::sqrt * awful_hack(ci): install whole llvm instead of libc++ in terrible way for test containers * Adding ddeb packages for teststages and repos * libc++ more for test container * save some money on debug * colored coredumps * revert ci * chore(ci): collect asan ubsan and libc++ build with mtr and regression status ignored
		
			
				
	
	
		
			59 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			59 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| #include "functor_json.h"
 | |
| #include "functioncolumn.h"
 | |
| #include "constantcolumn.h"
 | |
| using namespace execplan;
 | |
| 
 | |
| #include "rowgroup.h"
 | |
| using namespace rowgroup;
 | |
| 
 | |
| #include "joblisttypes.h"
 | |
| using namespace joblist;
 | |
| 
 | |
| namespace funcexp
 | |
| {
 | |
| 
 | |
| class QueryJSONPathWrapper : public JSONPathWrapper
 | |
| {
 | |
|   bool checkAndGetValue(JSONEgWrapper* je, std::string& res, int* error) override
 | |
|   {
 | |
|     return je->checkAndGetComplexVal(res, error);
 | |
|   }
 | |
| };
 | |
| 
 | |
| bool JSONEgWrapper::checkAndGetComplexVal(std::string& ret, int* error)
 | |
| {
 | |
|   if (json_value_scalar(this))
 | |
|   {
 | |
|     /* We skip scalar values. */
 | |
|     if (json_scan_next(this))
 | |
|       *error = 1;
 | |
|     return true;
 | |
|   }
 | |
| 
 | |
|   const uchar* tmpValue = value;
 | |
|   if (json_skip_level(this))
 | |
|   {
 | |
|     *error = 1;
 | |
|     return true;
 | |
|   }
 | |
| 
 | |
|   ret.append((const char*)value, s.c_str - tmpValue);
 | |
|   return false;
 | |
| }
 | |
| 
 | |
| CalpontSystemCatalog::ColType Func_json_query::operationType(FunctionParm& fp,
 | |
|                                                              CalpontSystemCatalog::ColType& /*resultType*/)
 | |
| {
 | |
|   return fp[0]->data()->resultType();
 | |
| }
 | |
| 
 | |
| std::string Func_json_query::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
 | |
|                                        execplan::CalpontSystemCatalog::ColType& /*type*/)
 | |
| {
 | |
|   std::string ret;
 | |
|   QueryJSONPathWrapper qpw;
 | |
|   isNull = qpw.extract(ret, row, fp[0], fp[1]);
 | |
|   return isNull ? "" : ret;
 | |
| }
 | |
| }  // namespace funcexp
 |