To put it delicately, getting waived wasn’t the biggest pain in the rear for Salah Mejri when the Mavericks made the trade of Harrison Barnes to Sacramento.

To reset the situation, the Mavericks completed the trade on Jan. 6, although it wasn’t made official until the following day. Mejri spent the first half of the Jan. 6 game against Charlotte on the bench for that game, then was absent in the second half.

It was fair to assume that he had been informed something was up.

That wasn’t the case, he said.

“To be honest, everybody thought I left that game because I got waived,” he said. “But I didn’t. I was sick. I was in pain. I had hemorrhoids. I was sitting there. And I wasn’t playing, obviously. I talked to Casey (Smith, the athletic trainer) before the game and told him I’m going to try to go. But if the pain got bad, we’d see how it goes.

“So at halftime, I talked to Casey and told him it’s very painful. I can’t sit anymore. I’ll go home and (the following day) we’ll go see the doctor.”

So the 7-2 Mejri went to the locker room and showered. It just so happened that president of basketball operations Donnie Nelson was showing some visitors around the locker room. They saw Mejri, whom Nelson affectionately calls the president of Tunisia, and took a few photos and moved along.

“Then five minutes later, he saw me again and said: I just got the call and we made a trade,” Mejri remembers. “He didn’t mention any names. But he said they needed a roster spot and we waived you. So then my agent called and we talked.

“Two days later, my agent calls again and said: do you want to come back to Dallas. They want you back.”

And that was it. Within the span of a couple days, Mejri was back with the Mavericks.

There is more to the story, though. Mejri knows that a lot of people believe the Mavericks brought him back, at least in part, because he’s such close friends with Luka Doncic. And while he and the rookie are close, the Mavericks – and other NBA teams, by the way – don’t do friendly favors very often, if ever. It’s just not the way the business works.

But the reason he’s back, primarily, is because he was the best option for what the Mavericks need in the final 25 games of the season.

“He’s doing very well,” coach Rick Carlisle said of Mejri’s health. “And we’re going to need him the last 25 games. We need rebounding, we need rim protection. We need a guy that can roll and finish. So, with DJ (DeAndre Jordan) gone, we just need somebody to absorb some of those minutes.”

And as for that Doncic connection?

“He’s back here for basketball reasons,” Carlisle said. “His relationship with Luka has nothing to do with it. I don’t know where you go to find a guy who can do the kinds of things he can do at the center position and has some familiarity with our system. It just made perfect sense to me. It was totally about basketball and what we need from him on the floor.”

But anyway, back to the hemorrhoid problem.

Mejri was so uncomfortable during the game against Charlotte when the trade came to fruition that he didn’t even digest the news about getting waived right away.

“I love Dallas, but I was in so much pain that day, I didn’t even think about the waiving part,” Mejri said. “I was still processing it. But I was in too much pain. Let me deal with that. In fact, the next day, I had surgery to remove it. That’s why I wasn’t in Houston (on Feb. 11). I was still recovering. And I’m still recovering now. The other thing happened so quick. There was a lot of emotion, a lot of pain, a lot of everything.

“But I’m happy to be back here. And that’s it.”

And theres one positive byproduct of Mejri being waived and then rehired by the Mavericks. He’s getting two paychecks. When he got waived, his original salary was guaranteed for the remainder of the season. When the team re-signed him, he got another veteran-minimum contract, pro-rated of course.

“That’s the good part, I guess,” he said. “There’s, like, a good thing about everything bad, as they say.”

And so now Mejri can focus on trying to help the Mavericks for the final third of the season. He received inconsistent playing time before the All-Star break, mostly because Jordan and Dirk Nowitzki would eat up all the minutes at center.

Now, there’s a need there. With Kristaps Porzingis being ruled out for the remainder of the season, the Mavericks will need more than the center grouping of Dwight Powell, Maxi Kleber and Nowitzki.

Much will depend on matchups, but Mejri obviously will be in the rotation. He was in the starting lineup in the final game before the All-Star break, although he played only eight minutes because Miami went with mostly smaller lineups and the game got out of hand in the Heat’s favor.

For the season, Mejri has played only 17 games and averaged 2.3 points and 2.3 rebounds in very limited minutes.

He knows how that looks to the Mavericks, to fans and to other teams. And as a free-agent-to-be, he knows he needs to show as much as he can in the remaining 25 games.

“I need to make a case for myself and play the whole season,” Mejri said. “A lot of people think I can’t play because I didn’t get the chance to play. If you’re not playing, if the coach isn’t giving you an opportunity, it means something’s wrong with you. It’s not something wrong with the rotation or what the coach wants. People always think there’s something wrong with the player.

“But for the team to waive me and then sign me back a few days later, that’s a huge sign. There’s nothing wrong with me. I will do whatever they ask me to do. If they ask me to play 20, I’ll play 20. If they tell me to play one, I’ll play one. I’m a professional. I’m getting paid twice now, so I will do whatever I can do.”

Mejri’s waiving did set off shock waves halfway around the world. As the only Arabic player in the NBA, he is followed widely in northern Africa and elsewhere in that part of the world.

He received a lot of inquiries from people wondering what his next move would be. He’s happy that it ended up being back with the Mavericks – the only team he’s played for in four NBA seasons.

“I would love to finish my career in Dallas,” the 32-year-old said. “But if not, there are 29 other teams in the NBA and many teams overseas. There’s nothing as good as the NBA and I would love to stay here.”

The future will be whatever it is. But for now, just having the chance to salvage a heretofore rough season is a good thing.

As Mejri might say, his problems are behind him.

Twitter: @ESefko